44 const Mesh *me_settings)
52 mesh->runtime->cd_mask_extra = *cd_mask_extra;
56 mesh->runtime->is_original_bmesh =
true;
59 mesh->runtime->deformed_only =
true;
61 mesh->runtime->edit_mesh = std::move(em);
73 mesh->corners_num = 0;
86 std::lock_guard
lock{
mesh->runtime->eval_mutex};
97 mesh->corners_num = 0;
118 mesh->runtime->is_original_bmesh =
false;
121 mesh->runtime->edit_data.reset();
124 BLI_assert(!
"Should not be converting subd wrapper to mdata wrapper");
139 switch (
mesh->runtime->wrapper_type) {
141 return mesh->runtime->edit_data->vert_positions;
144 return mesh->vert_positions();
152 switch (
mesh->runtime->wrapper_type) {
155 *
mesh->runtime->edit_data);
158 return mesh->face_normals();
166 switch (
mesh->runtime->wrapper_type) {
169 edit_data->vert_normals = {};
170 edit_data->face_centers = {};
171 edit_data->face_normals = {};
176 mesh->tag_positions_changed();
183 switch (
mesh->runtime->wrapper_type) {
210 float (*vert_coords)[3],
212 const float mat[4][4])
214 switch (
mesh->runtime->wrapper_type) {
220 for (
int i = 0; i < vert_coords_len; i++) {
238 for (
int i = 0; i < vert_coords_len; i++) {
255 switch (
mesh->runtime->wrapper_type) {
260 return mesh->verts_num;
268 switch (
mesh->runtime->wrapper_type) {
273 return mesh->edges_num;
281 switch (
mesh->runtime->wrapper_type) {
286 return mesh->corners_num;
294 switch (
mesh->runtime->wrapper_type) {
299 return mesh->faces_num;
333 runtime_data,
mesh,
false);
345 memcpy(
data,
mesh->corner_normals().data(),
mesh->corner_normals().size_in_bytes());
363 if (subdiv_mesh !=
mesh) {
369 if (
mesh->runtime->mesh_eval !=
nullptr) {
372 mesh->runtime->mesh_eval = subdiv_mesh;
377 return mesh->runtime->mesh_eval;
382 if (
mesh->runtime->subsurf_runtime_data ==
nullptr) {
388 return (
mesh->runtime->mesh_eval) ?
mesh->runtime->mesh_eval :
mesh;
392 std::lock_guard
lock{
mesh->runtime->eval_mutex};
394 return (
mesh->runtime->mesh_eval) ?
mesh->runtime->mesh_eval :
mesh;
#define BLI_assert_unreachable()
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
constexpr void copy_from(Span< T > values) const
void free(Subdiv *subdiv)
Mesh * subdiv_to_mesh(Subdiv *subdiv, const ToMeshSettings *settings, const Mesh *coarse_mesh)
void mesh_set_custom_normals_normalized(Mesh &mesh, MutableSpan< float3 > corner_normals)
auto isolate_task(const Function &function)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
char * STRNCPY(char(&dst)[N], const char *src)
BMesh * BKE_editmesh_bmesh_get_for_write(Mesh *mesh)
MINLINE void copy_v3_v3(float r[3], const float a[3])
int BKE_mesh_wrapper_edge_len(const Mesh *mesh)
bool CustomData_free_layers(CustomData *data, eCustomDataType type)
static Mesh * mesh_wrapper_ensure_subdivision(Mesh *mesh)
void BKE_mesh_ensure_default_orig_index_customdata_no_check(Mesh *mesh)
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
Span< float3 > BKE_mesh_wrapper_face_normals(Mesh *mesh)
void BKE_mesh_wrapper_ensure_mdata(Mesh *mesh)
void BKE_mesh_wrapper_vert_coords_copy(const Mesh *mesh, MutableSpan< float3 > positions)
void BKE_mesh_wrapper_vert_coords_copy_with_mat4(const Mesh *mesh, float(*vert_coords)[3], int vert_coords_len, const float mat[4][4])
int BKE_mesh_wrapper_face_len(const Mesh *mesh)
ATTR_WARN_UNUSED_RESULT const BMVert * v
void BM_mesh_bm_to_me_for_eval(BMesh &bm, Mesh &mesh, const CustomData_MeshMasks *cd_mask_extra)
void BKE_mesh_copy_parameters_for_eval(Mesh *me_dst, const Mesh *me_src)
BMesh const char void * data
void BKE_mesh_wrapper_tag_positions_changed(Mesh *mesh)
int BKE_mesh_wrapper_vert_len(const Mesh *mesh)
void BKE_id_free(Main *bmain, void *idv)
void * BKE_id_new_nomain(short type, const char *name)
bke::subdiv::Subdiv * BKE_subsurf_modifier_subdiv_descriptor_ensure(SubsurfRuntimeData *runtime_data, const Mesh *mesh, bool for_draw_code)
int BKE_mesh_wrapper_loop_len(const Mesh *mesh)
Span< float3 > BKE_mesh_wrapper_vert_coords(const Mesh *mesh)
const BMesh * BKE_editmesh_bmesh_get(const Object *ob)
Mesh * BKE_mesh_wrapper_from_editmesh(std::shared_ptr< BMEditMesh > em, const CustomData_MeshMasks *cd_mask_extra, const Mesh *me_settings)
Span< float3 > BKE_editmesh_cache_ensure_face_normals(BMesh &bm, bke::EditMeshData &emd)
void * CustomData_get_layer_for_write(CustomData *data, eCustomDataType type, int totelem)
VecBase< float, 3 > float3
Mesh * BKE_mesh_wrapper_ensure_subdivision(Mesh *mesh)
void BKE_mesh_runtime_ensure_edit_data(Mesh *mesh)
void * CustomData_add_layer(CustomData *data, eCustomDataType type, eCDAllocType alloctype, int totelem)
bke::subdiv::Subdiv * subdiv_gpu
bke::subdiv::Settings settings
bke::subdiv::Subdiv * subdiv_cpu
Array< float3 > vert_positions