79 #ifdef WITH_OPENSUBDIV
86 #ifdef USE_MODIFIER_VALIDATE
87 # define ASSERT_IS_VALID_MESH(mesh) \
88 (BLI_assert((mesh == nullptr) || (BKE_mesh_is_valid(mesh) == true)))
90 # define ASSERT_IS_VALID_MESH(mesh)
184 dm->
getNumVerts(dm),
sizeof(*tmp),
"dm_dupVertArray tmp");
196 dm->
getNumEdges(dm),
sizeof(*tmp),
"dm_dupEdgeArray tmp");
220 dm->
getNumLoops(dm),
sizeof(*tmp),
"dm_dupLoopArray tmp");
232 dm->
getNumPolys(dm),
sizeof(*tmp),
"dm_dupPolyArray tmp");
256 if (looptri !=
nullptr) {
503 if ((looptris_num > dm->
looptris.
num_alloc) || (looptris_num < dm->looptris.num_alloc * 2) ||
526 const int totvert = me_deformed->
totvert;
595 BLI_assert(index >= 0 && index < dm->getNumVerts(dm));
607 BLI_assert(index >= 0 && index < dm->getNumTessFaces(dm));
613 BLI_assert(index >= 0 && index < dm->getNumPolys(dm));
719 if (kb && kb->
data) {
720 return (
float(*)[3])kb->
data;
758 float(*orco)[3], (*layerorco)[3];
766 if (mesh_orco->
totvert == totvert) {
791 memcpy(layerorco, orco,
sizeof(
float[3]) * totvert);
800 const bool sculpt_dyntopo,
814 if (do_poly_normals) {
830 if (do_loop_normals) {
836 if (sculpt_dyntopo ==
false) {
851 if (!do_loop_normals) {
910 r_geometry_set = new_geometry_set;
928 Mesh *mesh_output =
nullptr;
936 if (!
ELEM(new_input_mesh, input_mesh, mesh_output)) {
959 mesh_output = mesh_component.
release();
963 if (mesh_output ==
nullptr) {
976 const bool need_mapping,
979 const bool use_cache,
980 const bool allow_shared_mesh,
990 Mesh *mesh_final =
nullptr;
991 Mesh *mesh_deform =
nullptr;
1007 float(*deformed_verts)[3] =
nullptr;
1008 int num_deformed_verts = mesh_input->
totvert;
1009 bool isPrevDeform =
false;
1014 Mesh *mesh_orco =
nullptr;
1015 Mesh *mesh_orco_cloth =
nullptr;
1023 bool multires_applied =
false;
1025 const bool sculpt_dyntopo = (sculpt_mode && ob->
sculpt->
bm) && !use_render;
1061 scene, ob, md, &final_datamask, required_mode, previewmd, &previewmask);
1071 for (; md; md = md->
next, md_datamask = md_datamask->
next) {
1083 if (!deformed_verts) {
1087 if (mesh_final ==
nullptr) {
1096 isPrevDeform =
true;
1115 if (deformed_verts) {
1122 bool have_non_onlydeform_modifiers_appled =
false;
1123 for (; md; md = md->
next, md_datamask = md_datamask->
next) {
1135 have_non_onlydeform_modifiers_appled) {
1140 if (sculpt_mode && (!has_multires || multires_applied || sculpt_dyntopo)) {
1141 bool unsupported =
false;
1145 if (!sculpt_dyntopo) {
1150 if (sculpt_dyntopo) {
1158 unsupported |= multires_applied;
1161 if (sculpt_dyntopo) {
1193 if (!deformed_verts) {
1196 geometry_set_final);
1197 if (mesh_final_new != mesh_final) {
1200 mesh_final = mesh_final_new;
1215 if (mesh_final ==
nullptr) {
1224 bool check_for_needs_mapping =
false;
1226 if (mesh_final !=
nullptr) {
1227 if (have_non_onlydeform_modifiers_appled ==
false) {
1230 check_for_needs_mapping =
true;
1236 check_for_needs_mapping =
true;
1239 if (deformed_verts) {
1243 have_non_onlydeform_modifiers_appled =
true;
1248 if (check_for_needs_mapping) {
1269 mesh_final->totvert,
1272 mesh_final->totedge,
1275 mesh_final->totpoly,
1307 md, mectx, mesh_final, geometry_set_final);
1312 if (mesh_final != mesh_next) {
1316 mesh_final = mesh_next;
1318 if (deformed_verts) {
1320 deformed_verts =
nullptr;
1348 if (mesh_orco != mesh_next) {
1353 mesh_orco = mesh_next;
1359 if (!mesh_orco_cloth) {
1374 if (mesh_orco_cloth != mesh_next) {
1379 mesh_orco_cloth = mesh_next;
1389 mesh_final->runtime.deformed_only =
false;
1400 multires_applied =
true;
1406 for (md = firstmd; md; md = md->
next) {
1413 if (mesh_final ==
nullptr) {
1417 if (deformed_verts ==
nullptr && allow_shared_mesh &&
1420 mesh_final = mesh_input;
1426 if (deformed_verts) {
1429 deformed_verts =
nullptr;
1434 const bool is_own_mesh = (mesh_final != mesh_input);
1452 if (mesh_orco_cloth) {
1481 *r_final = mesh_final;
1483 *r_deform = mesh_deform;
1485 if (r_geometry_set) {
1486 *r_geometry_set =
new GeometrySet(std::move(geometry_set_final));
1497 *r_vert_len = em->bm->totvert;
1545 if (do_poly_normals) {
1561 if (do_loop_normals) {
1578 if (!do_loop_normals) {
1603 Mesh *mesh_final =
nullptr;
1604 Mesh *mesh_cage =
nullptr;
1611 geometry_set_final.get_component_for_write<
MeshComponent>();
1618 float(*deformed_verts)[3] =
nullptr;
1619 int num_deformed_verts = 0;
1620 bool isPrevDeform =
false;
1625 Mesh *mesh_orco =
nullptr;
1648 scene, ob, md, &final_datamask, required_mode,
nullptr,
nullptr);
1654 if (r_cage && cageIndex == -1) {
1656 em_input, &final_datamask,
nullptr, mesh_input);
1662 for (
int i = 0; md; i++, md = md->
next, md_datamask = md_datamask->
next) {
1683 if (!deformed_verts) {
1695 if (mesh_final ==
nullptr) {
1705 md, &mectx, em_input, mesh_final, deformed_verts, num_deformed_verts);
1714 if (deformed_verts) {
1716 if (mesh_final != mesh_cage) {
1719 mesh_final = mesh_tmp;
1722 else if (mesh_final == mesh_cage) {
1729 em_input,
nullptr, deformed_verts, mesh_input);
1730 deformed_verts =
nullptr;
1751 if (mesh_orco && mesh_orco != mesh_next) {
1754 mesh_orco = mesh_next;
1778 md, mectx, mesh_final, geometry_set_final);
1782 if (mesh_final && mesh_final != mesh_next) {
1785 mesh_final = mesh_next;
1787 if (deformed_verts) {
1789 deformed_verts =
nullptr;
1792 mesh_final->runtime.deformed_only =
false;
1795 if (r_cage && i == cageIndex) {
1796 if (mesh_final && deformed_verts) {
1800 else if (mesh_final) {
1801 mesh_cage = mesh_final;
1804 Mesh *me_orig = mesh_input;
1814 deformed_verts ? (
const float(*)[3])
MEM_dupallocN(deformed_verts) :
nullptr,
1828 if (deformed_verts) {
1830 if (mesh_final != mesh_cage) {
1833 mesh_final = mesh_tmp;
1837 else if (!deformed_verts && mesh_cage) {
1839 mesh_final = mesh_cage;
1844 em_input, &final_datamask, deformed_verts, mesh_input);
1845 deformed_verts =
nullptr;
1848 if (deformed_verts) {
1871 if (mesh_cage && (mesh_cage != mesh_final)) {
1876 *r_final = mesh_final;
1878 *r_cage = mesh_cage;
1880 if (r_geometry_set) {
1881 *r_geometry_set =
new GeometrySet(std::move(geometry_set_final));
1906 const bool need_mapping)
1928 Mesh *mesh_eval =
nullptr, *mesh_deform_eval =
nullptr;
1941 &geometry_set_eval);
2001 depsgraph,
scene, obedit, em, dataMask, &me_cage, &me_final, &non_mesh_components);
2017 bool *r_need_mapping)
2023 if (r_need_mapping) {
2024 *r_need_mapping =
false;
2039 if (r_need_mapping) {
2104 if ((mesh_eval ==
nullptr) ||
2113 if (mesh_eval !=
nullptr) {
2158 depsgraph,
scene, ob, 1,
false, dataMask, -1,
false,
false,
nullptr, &
final,
nullptr);
2172 depsgraph,
scene, ob, 1,
false, dataMask, index,
false,
false,
nullptr, &
final,
nullptr);
2185 depsgraph,
scene, ob, 0,
false, dataMask, -1,
false,
false,
nullptr, &
final,
nullptr);
2198 depsgraph,
scene, ob, 0,
false, dataMask, -1,
false,
false,
nullptr, &
final,
nullptr);
2276 const float UNUSED(no_f[3]),
2277 const short UNUSED(no_s[3]))
2294 memset(r_cos, 0,
sizeof(*r_cos) * totcos);
2302 for (
int i = 0; i < totcos; i++,
mv++) {
2309 bool calc_active_tangent,
2310 const char (*tangent_names)[
MAX_NAME],
2311 int tangent_names_len)
2321 calc_active_tangent,
2335 const float default_osf[4][2] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
2348 for (i = 0; i < numpoly; i++, mp++) {
2352 for (j = 0; j < mp->
totloop; j++, lof++) {
2358 float p_nor[3], co[3];
2361 float min[2] = {FLT_MAX, FLT_MAX},
max[2] = {-FLT_MAX, -FLT_MAX};
2362 float translate[2], scale[2];
2368 for (j = 0; j < mp->
totloop; j++,
l++) {
2372 for (k = 0; k < 2; k++) {
2373 if (co[k] >
max[k]) {
2376 else if (co[k] <
min[k]) {
2387 if (scale[0] == 0.0f) {
2390 if (scale[1] == 0.0f) {
2397 for (j = 0; j < mp->
totloop; j++, lof++) {
2425 const void *pt = getElemDataArray(dm,
type);
2427 const char *structname;
2432 " dict(name='%s', struct='%s', type=%d, ptr='%p', elem=%d, length=%d),\n",
2453 tstr =
"DM_TYPE_CDDM";
2456 tstr =
"DM_TYPE_CCGDM";
2506 const bool do_verbose =
true;
2507 const bool do_fixes =
false;
2510 bool changed =
true;
typedef float(TangentPoint)[2]
void CustomData_free(struct CustomData *data, int totelem)
const CustomData_MeshMasks CD_MASK_BAREMESH_ORIGINDEX
void CustomData_free_layers(struct CustomData *data, int type, int totelem)
bool CustomData_has_layer(const struct CustomData *data, int type)
void CustomData_MeshMasks_update(CustomData_MeshMasks *mask_dst, const CustomData_MeshMasks *mask_src)
void CustomData_set_only_copy(const struct CustomData *data, CustomDataMask mask)
bool CustomData_MeshMasks_are_matching(const CustomData_MeshMasks *mask_ref, const CustomData_MeshMasks *mask_required)
const CustomData_MeshMasks CD_MASK_BAREMESH
void CustomData_interp(const struct CustomData *source, struct CustomData *dest, const int *src_indices, const float *weights, const float *sub_weights, int count, int dest_index)
const char * CustomData_layertype_name(int type)
void * CustomData_get_layer(const struct CustomData *data, int type)
int CustomData_sizeof(int type)
void CustomData_file_write_info(int type, const char **r_struct_name, int *r_struct_num)
void CustomData_free_temporary(struct CustomData *data, int totelem)
void * CustomData_add_layer(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem)
void CustomData_set_layer_flag(struct CustomData *data, int type, int flag)
const CustomData_MeshMasks CD_MASK_DERIVEDMESH
void CustomData_copy(const struct CustomData *source, struct CustomData *dest, CustomDataMask mask, eCDAllocType alloctype, int totelem)
void * CustomData_get(const struct CustomData *data, int index, int type)
void CustomData_copy_data(const struct CustomData *source, struct CustomData *dest, int source_index, int dest_index, int count)
void BKE_editmesh_free_derivedmesh(BMEditMesh *em)
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
struct KeyBlock * BKE_keyblock_from_key(struct Key *key, int index)
struct Key * BKE_key_from_object(const struct Object *ob)
void BKE_keyblock_convert_from_mesh(struct Mesh *me, struct Key *key, struct KeyBlock *kb)
void BKE_id_free(struct Main *bmain, void *idv)
General operations, lookup, etc. for materials.
float(* BKE_mesh_orco_verts_get(struct Object *ob))[3]
void BKE_mesh_tessface_clear(struct Mesh *mesh)
bool BKE_mesh_validate_all_customdata(struct CustomData *vdata, const uint totvert, struct CustomData *edata, const uint totedge, struct CustomData *ldata, const uint totloop, struct CustomData *pdata, const uint totpoly, const bool check_meshmask, const bool do_verbose, const bool do_fixes, bool *r_change)
void BKE_mesh_vert_coords_apply(struct Mesh *mesh, const float(*vert_coords)[3])
void BKE_mesh_tessface_ensure(struct Mesh *mesh)
struct Mesh * BKE_mesh_copy_for_eval(struct Mesh *source, bool reference)
struct Mesh * BKE_mesh_new_nomain(int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
struct Mesh * BKE_mesh_from_bmesh_for_eval_nomain(struct BMesh *bm, const struct CustomData_MeshMasks *cd_mask_extra, const struct Mesh *me_settings)
void BKE_mesh_calc_poly_normal(const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray, float r_no[3])
void BKE_mesh_calc_normals_split(struct Mesh *mesh)
void BKE_mesh_orco_verts_transform(struct Mesh *me, float(*orco)[3], int totvert, int invert)
void BKE_mesh_update_customdata_pointers(struct Mesh *me, const bool do_ensure_tess_cd)
void BKE_mesh_copy_settings(struct Mesh *me_dst, const struct Mesh *me_src)
float(* BKE_mesh_vert_coords_alloc(const struct Mesh *mesh, int *r_vert_len))[3]
void BKE_mesh_ensure_normals_for_display(struct Mesh *mesh)
bool BKE_mesh_validate_arrays(struct Mesh *me, struct MVert *mverts, unsigned int totvert, struct MEdge *medges, unsigned int totedge, struct MFace *mfaces, unsigned int totface, struct MLoop *mloops, unsigned int totloop, struct MPoly *mpolys, unsigned int totpoly, struct MDeformVert *dverts, const bool do_verbose, const bool do_fixes, bool *r_change)
void BKE_mesh_calc_normals_poly(struct MVert *mverts, float(*r_vertnors)[3], int numVerts, const struct MLoop *mloop, const struct MPoly *mpolys, int numLoops, int numPolys, float(*r_polyNors)[3], const bool only_face_normals)
void BKE_mesh_foreach_mapped_vert(struct Mesh *mesh, void(*func)(void *userData, int index, const float co[3], const float no_f[3], const short no_s[3]), void *userData, MeshForeachFlag flag)
bool BKE_mesh_runtime_reset_edit_data(struct Mesh *mesh)
bool BKE_mesh_runtime_ensure_edit_data(struct Mesh *mesh)
void BKE_mesh_calc_loop_tangent_ex(const struct MVert *mvert, const struct MPoly *mpoly, const uint mpoly_len, const struct MLoop *mloop, const struct MLoopTri *looptri, const uint looptri_len, struct CustomData *loopdata, bool calc_active_tangent, const char(*tangent_names)[64], int tangent_names_len, const float(*poly_normals)[3], const float(*loop_normals)[3], const float(*vert_orco)[3], struct CustomData *loopdata_out, const uint loopdata_out_len, short *tangent_mask_curr_p)
void BKE_mesh_wrapper_ensure_mdata(struct Mesh *me)
struct Mesh * BKE_mesh_wrapper_from_editmesh_with_coords(struct BMEditMesh *em, const struct CustomData_MeshMasks *cd_mask_extra, const float(*vert_coords)[3], const struct Mesh *me_settings)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
void BKE_modifier_deform_vertsEM(ModifierData *md, const struct ModifierEvalContext *ctx, struct BMEditMesh *em, struct Mesh *me, float(*vertexCos)[3], int numVerts)
bool BKE_modifier_is_enabled(const struct Scene *scene, struct ModifierData *md, int required_mode)
struct Mesh * BKE_modifier_modify_mesh(ModifierData *md, const struct ModifierEvalContext *ctx, struct Mesh *me)
@ eModifierTypeFlag_RequiresOriginalData
void BKE_modifier_deform_verts(ModifierData *md, const struct ModifierEvalContext *ctx, struct Mesh *me, float(*vertexCos)[3], int numVerts)
struct ModifierData * BKE_modifier_get_last_preview(const struct Scene *scene, struct ModifierData *md, int required_mode)
struct ModifierData * BKE_modifiers_get_virtual_modifierlist(const struct Object *ob, struct VirtualModifierData *data)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
bool BKE_modifier_supports_mapping(struct ModifierData *md)
@ eModifierTypeType_OnlyDeform
void BKE_modifier_free_temporary_data(struct ModifierData *md)
void BKE_modifier_set_error(const struct Object *ob, struct ModifierData *md, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_modifiers_clear_errors(struct Object *ob)
struct CDMaskLink * BKE_modifier_calc_data_masks(const struct Scene *scene, struct Object *ob, struct ModifierData *md, struct CustomData_MeshMasks *final_datamask, int required_mode, ModifierData *previewmd, const struct CustomData_MeshMasks *previewmask)
int BKE_modifiers_get_cage_index(const struct Scene *scene, struct Object *ob, int *r_lastPossibleCageIndex, bool is_virtual)
General operations, lookup, etc. for blender objects.
struct Mesh * BKE_object_get_evaluated_mesh(struct Object *object)
void BKE_object_free_derived_caches(struct Object *ob)
void BKE_object_boundbox_calc_from_mesh(struct Object *ob, struct Mesh *me_eval)
void BKE_object_eval_assign_data(struct Object *object, struct ID *data, bool is_owned)
void BKE_sculpt_update_object_before_eval(struct Object *ob_eval)
bool BKE_paint_select_face_test(struct Object *ob)
void BKE_sculpt_update_object_after_eval(struct Depsgraph *depsgraph, struct Object *ob_eval)
struct MultiresModifierData * BKE_sculpt_multires_active(struct Scene *scene, struct Object *ob)
void BKE_shrinkwrap_compute_boundary_data(struct Mesh *mesh)
A (mainly) macro array library.
#define BLI_BITMAP_TEST(_bitmap, _index)
#define BLI_BITMAP_ENABLE(_bitmap, _index)
#define BLI_BITMAP_NEW(_tot, _alloc_string)
A dynamically sized string ADT.
DynStr * BLI_dynstr_new(void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL()
void BLI_dynstr_appendf(DynStr *__restrict ds, const char *__restrict format,...) ATTR_PRINTF_FORMAT(2
char * BLI_dynstr_get_cstring(DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_dynstr_append(DynStr *__restrict ds, const char *cstr) ATTR_NONNULL()
void BLI_kdtree_nd_() free(KDTree *tree)
void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int poly_to_tri_count(const int poly_count, const int corner_count)
void axis_dominant_v3_to_m3(float r_mat[3][3], const float normal[3])
Normal to x,y matrix.
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
void copy_vn_i(int *array_tar, const int size, const int val)
MINLINE void mul_v2_v2(float r[2], const float a[2])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v2_v2(float r[2], const float a[2])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
void range_vn_i(int *array_tar, const int size, const int start)
MINLINE void invert_v2(float r[2])
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
pthread_rwlock_t ThreadRWMutex
#define THREAD_LOCK_WRITE
void BLI_rw_mutex_lock(ThreadRWMutex *mutex, int mode)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
void BLI_rw_mutex_unlock(ThreadRWMutex *mutex)
pthread_mutex_t ThreadMutex
#define UNUSED_VARS_NDEBUG(...)
struct Depsgraph Depsgraph
bool DEG_is_active(const struct Depsgraph *depsgraph)
@ DAG_EVAL_NEED_SHRINKWRAP_BOUNDARY
bool DEG_is_evaluating(const struct Depsgraph *depsgraph)
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
struct Object * DEG_get_original_object(struct Object *object)
uint32_t DEG_get_eval_flags_for_id(const struct Depsgraph *graph, struct ID *id)
struct ID * DEG_get_evaluated_id(const struct Depsgraph *depsgraph, struct ID *id)
struct ViewLayer * DEG_get_evaluated_view_layer(const struct Depsgraph *graph)
bool DEG_is_evaluated_id(const struct ID *id)
void DEG_get_customdata_mask_for_object(const struct Depsgraph *graph, struct Object *object, struct CustomData_MeshMasks *r_mask)
@ LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT
@ LIB_TAG_COPIED_ON_WRITE
#define CD_MASK_ORIGINDEX
#define CD_MASK_MDEFORMVERT
#define CD_MASK_MVERT_SKIN
#define CD_MASK_ORIGSPACE_MLOOP
#define CD_MASK_CLOTH_ORCO
#define CD_MASK_PREVIEW_MLOOPCOL
@ eModifierType_DynamicPaint
#define OB_MODE_ALL_SCULPT
Object is a sort of wrapper for general info.
Mesh * mesh_create_eval_final(Depsgraph *depsgraph, Scene *scene, Object *ob, const CustomData_MeshMasks *dataMask)
void makeDerivedMesh(struct Depsgraph *depsgraph, Scene *scene, Object *ob, BMEditMesh *em, const CustomData_MeshMasks *dataMask)
static float(* get_editbmesh_orco_verts(BMEditMesh *em))[3]
static CustomData * dm_getVertCData(DerivedMesh *dm)
void DM_add_edge_layer(DerivedMesh *dm, int type, eCDAllocType alloctype, void *layer)
void BKE_mesh_wrapper_deferred_finalize(Mesh *me_eval, const CustomData_MeshMasks *cd_mask_finalize)
static ThreadRWMutex loops_cache_lock
static void mesh_calc_modifiers(struct Depsgraph *depsgraph, Scene *scene, Object *ob, int useDeform, const bool need_mapping, const CustomData_MeshMasks *dataMask, const int index, const bool use_cache, const bool allow_shared_mesh, Mesh **r_deform, Mesh **r_final, GeometrySet **r_geometry_set)
void mesh_get_mapped_verts_coords(Mesh *me_eval, float(*r_cos)[3], const int totcos)
void DM_ensure_normals(DerivedMesh *dm)
bool editbmesh_modifier_is_enabled(Scene *scene, const Object *ob, ModifierData *md, bool has_prev_mesh)
void DM_from_template_ex(DerivedMesh *dm, DerivedMesh *source, DerivedMeshType type, int numVerts, int numEdges, int numTessFaces, int numLoops, int numPolys, const CustomData_MeshMasks *mask)
static MFace * dm_getTessFaceArray(DerivedMesh *dm)
void * DM_get_poly_data(DerivedMesh *dm, int index, int type)
static float(* get_orco_coords(Object *ob, BMEditMesh *em, int layer, int *free))[3]
static void mesh_build_extra_data(struct Depsgraph *depsgraph, Object *ob, Mesh *mesh_eval)
bool DM_is_valid(DerivedMesh *dm)
static MEdge * dm_getEdgeArray(DerivedMesh *dm)
void DM_add_poly_layer(DerivedMesh *dm, int type, eCDAllocType alloctype, void *layer)
static void mesh_build_data(struct Depsgraph *depsgraph, Scene *scene, Object *ob, const CustomData_MeshMasks *dataMask, const bool need_mapping)
static void mesh_calc_modifier_final_normals(const Mesh *mesh_input, const CustomData_MeshMasks *final_datamask, const bool sculpt_dyntopo, Mesh *mesh_final)
void DM_calc_loop_tangents(DerivedMesh *dm, bool calc_active_tangent, const char(*tangent_names)[MAX_NAME], int tangent_names_len)
static CustomData * dm_getTessFaceCData(DerivedMesh *dm)
static void mesh_calc_finalize(const Mesh *mesh_input, Mesh *mesh_eval)
void * DM_get_loop_data_layer(DerivedMesh *dm, int type)
static CustomData * dm_getPolyCData(DerivedMesh *dm)
void DM_debug_print(DerivedMesh *dm)
void * DM_get_poly_data_layer(DerivedMesh *dm, int type)
static MEdge * dm_dupEdgeArray(DerivedMesh *dm)
void * DM_get_vert_data(DerivedMesh *dm, int index, int type)
static CustomData * dm_getLoopCData(DerivedMesh *dm)
Mesh * mesh_get_eval_deform(struct Depsgraph *depsgraph, Scene *scene, Object *ob, const CustomData_MeshMasks *dataMask)
static MVert * dm_dupVertArray(DerivedMesh *dm)
void BKE_mesh_runtime_eval_to_meshkey(Mesh *me_deformed, Mesh *me, KeyBlock *kb)
char * DM_debug_info(DerivedMesh *dm)
static void mesh_init_origspace(Mesh *mesh)
float(* editbmesh_vert_coords_alloc(BMEditMesh *em, int *r_vert_len))[3]
Mesh * mesh_create_eval_no_deform_render(Depsgraph *depsgraph, Scene *scene, Object *ob, const CustomData_MeshMasks *dataMask)
void DM_init(DerivedMesh *dm, DerivedMeshType type, int numVerts, int numEdges, int numTessFaces, int numLoops, int numPolys)
static MLoop * dm_dupLoopArray(DerivedMesh *dm)
Mesh * mesh_get_eval_final(struct Depsgraph *depsgraph, Scene *scene, Object *ob, const CustomData_MeshMasks *dataMask)
static int dm_getNumLoopTri(DerivedMesh *dm)
void DM_interp_vert_data(DerivedMesh *source, DerivedMesh *dest, int *src_indices, float *weights, int count, int dest_index)
Mesh * mesh_create_eval_no_deform(Depsgraph *depsgraph, Scene *scene, Object *ob, const CustomData_MeshMasks *dataMask)
bool DM_release(DerivedMesh *dm)
static void editbmesh_calc_modifiers(struct Depsgraph *depsgraph, Scene *scene, Object *ob, BMEditMesh *em_input, const CustomData_MeshMasks *dataMask, Mesh **r_cage, Mesh **r_final, GeometrySet **r_geometry_set)
void DM_from_template(DerivedMesh *dm, DerivedMesh *source, DerivedMeshType type, int numVerts, int numEdges, int numTessFaces, int numLoops, int numPolys)
void DM_ensure_looptri_data(DerivedMesh *dm)
static MPoly * dm_getPolyArray(DerivedMesh *dm)
static void make_vertexcos__mapFunc(void *userData, int index, const float co[3], const float UNUSED(no_f[3]), const short UNUSED(no_s[3]))
static void editbmesh_build_data(struct Depsgraph *depsgraph, Scene *scene, Object *obedit, BMEditMesh *em, CustomData_MeshMasks *dataMask)
void * DM_get_edge_data_layer(DerivedMesh *dm, int type)
static MPoly * dm_dupPolyArray(DerivedMesh *dm)
static void object_get_datamask(const Depsgraph *depsgraph, Object *ob, CustomData_MeshMasks *r_mask, bool *r_need_mapping)
static MVert * dm_getVertArray(DerivedMesh *dm)
void DM_DupPolys(DerivedMesh *source, DerivedMesh *target)
static CustomData * dm_getEdgeCData(DerivedMesh *dm)
static void mesh_runtime_check_normals_valid(const Mesh *mesh)
Mesh * editbmesh_get_eval_cage_and_final(Depsgraph *depsgraph, Scene *scene, Object *obedit, BMEditMesh *em, const CustomData_MeshMasks *dataMask, Mesh **r_final)
void DM_add_vert_layer(DerivedMesh *dm, int type, eCDAllocType alloctype, void *layer)
void DM_copy_vert_data(DerivedMesh *source, DerivedMesh *dest, int source_index, int dest_index, int count)
static void dm_debug_info_layers(DynStr *dynstr, DerivedMesh *dm, CustomData *cd, void *(*getElemDataArray)(DerivedMesh *, int))
void DM_init_funcs(DerivedMesh *dm)
void DM_add_tessface_layer(DerivedMesh *dm, int type, eCDAllocType alloctype, void *layer)
static MFace * dm_dupFaceArray(DerivedMesh *dm)
static void mesh_set_only_copy(Mesh *mesh, const CustomData_MeshMasks *mask)
Mesh * editbmesh_get_eval_cage_from_orig(struct Depsgraph *depsgraph, Scene *scene, Object *obedit, const CustomData_MeshMasks *dataMask)
static void add_orco_mesh(Object *ob, BMEditMesh *em, Mesh *mesh, Mesh *mesh_orco, int layer)
Mesh * mesh_create_eval_final_index_render(Depsgraph *depsgraph, Scene *scene, Object *ob, const CustomData_MeshMasks *dataMask, int index)
void * DM_get_tessface_data_layer(DerivedMesh *dm, int type)
void * DM_get_tessface_data(DerivedMesh *dm, int index, int type)
static Mesh * prepare_geometry_set_for_mesh_modifier(Mesh *mesh, GeometrySet &r_geometry_set)
static void editbmesh_calc_modifier_final_normals(Mesh *mesh_final, const CustomData_MeshMasks *final_datamask)
Mesh * editbmesh_get_eval_cage(struct Depsgraph *depsgraph, Scene *scene, Object *obedit, BMEditMesh *em, const CustomData_MeshMasks *dataMask)
static const MLoopTri * dm_getLoopTriArray(DerivedMesh *dm)
void DM_add_loop_layer(DerivedMesh *dm, int type, eCDAllocType alloctype, void *layer)
#define ASSERT_IS_VALID_MESH(mesh)
static Mesh * modifier_modify_mesh_and_geometry_set(ModifierData *md, const ModifierEvalContext &mectx, Mesh *input_mesh, GeometrySet &geometry_set)
void * DM_get_vert_data_layer(DerivedMesh *dm, int type)
static MLoop * dm_getLoopArray(DerivedMesh *dm)
static Mesh * create_orco_mesh(Object *ob, Mesh *me, BMEditMesh *em, int layer)
void * DM_get_edge_data(DerivedMesh *dm, int index, int type)
void DM_set_only_copy(DerivedMesh *dm, const CustomData_MeshMasks *mask)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
static bool dependsOnTime(GpencilModifierData *UNUSED(md))
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
virtual int getNumEdges() const
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void replace_mesh_but_keep_vertex_group_names(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void copy_vertex_group_names_from_object(const struct Object &object)
void resize(const int64_t new_size)
const Depsgraph * depsgraph
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
size_t(* MEM_allocN_len)(const void *vmemh)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
GeometrySet geometry_set_realize_mesh_for_modifier(const GeometrySet &geometry_set)
struct Mesh * mesh_eval_final
CustomData_MeshMasks lastDataMask
struct Mesh * mesh_eval_cage
struct CustomData_MeshMasks mask
struct ClothSimSettings * sim_parms
struct DerivedMesh::@15 looptris
struct MLoop *(* getLoopArray)(DerivedMesh *dm)
void *(* getVertDataArray)(DerivedMesh *dm, int type)
struct MPoly *(* dupPolyArray)(DerivedMesh *dm)
struct MVert *(* getVertArray)(DerivedMesh *dm)
struct MFace *(* dupTessFaceArray)(DerivedMesh *dm)
CustomData *(* getEdgeDataLayout)(DerivedMesh *dm)
void(* copyLoopArray)(DerivedMesh *dm, struct MLoop *r_loop)
void(* copyEdgeArray)(DerivedMesh *dm, struct MEdge *r_edge)
int(* getNumVerts)(DerivedMesh *dm)
const struct MLoopTri *(* getLoopTriArray)(DerivedMesh *dm)
int(* getNumLoopTri)(DerivedMesh *dm)
void(* copyPolyArray)(DerivedMesh *dm, struct MPoly *r_poly)
int(* getNumPolys)(DerivedMesh *dm)
CustomData *(* getTessFaceDataLayout)(DerivedMesh *dm)
void *(* getPolyData)(DerivedMesh *dm, int index, int type)
struct MEdge *(* dupEdgeArray)(DerivedMesh *dm)
int(* getNumEdges)(DerivedMesh *dm)
struct MFace *(* getTessFaceArray)(DerivedMesh *dm)
void *(* getLoopDataArray)(DerivedMesh *dm, int type)
void *(* getEdgeData)(DerivedMesh *dm, int index, int type)
void *(* getTessFaceDataArray)(DerivedMesh *dm, int type)
CustomData *(* getPolyDataLayout)(DerivedMesh *dm)
struct MLoop *(* dupLoopArray)(DerivedMesh *dm)
struct MVert *(* dupVertArray)(DerivedMesh *dm)
int(* getNumTessFaces)(DerivedMesh *dm)
struct MLoopTri * array_wip
void(* copyVertArray)(DerivedMesh *dm, struct MVert *r_vert)
void *(* getTessFaceData)(DerivedMesh *dm, int index, int type)
void *(* getVertData)(DerivedMesh *dm, int index, int type)
void *(* getPolyDataArray)(DerivedMesh *dm, int type)
void(* calcNormals)(DerivedMesh *dm)
void *(* getEdgeDataArray)(DerivedMesh *dm, int type)
struct MEdge *(* getEdgeArray)(DerivedMesh *dm)
void(* copyTessFaceArray)(DerivedMesh *dm, struct MFace *r_face)
CustomData *(* getVertDataLayout)(DerivedMesh *dm)
struct MPoly *(* getPolyArray)(DerivedMesh *dm)
void(* recalcLoopTri)(DerivedMesh *dm)
int(* getNumLoops)(DerivedMesh *dm)
CustomData *(* getLoopDataLayout)(DerivedMesh *dm)
const float(* vertexCos)[3]
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
bool has(const GeometryComponentType component_type) const
bool has_instances() const
bool has_pointcloud() const
BLI_bitmap * vertex_visit
struct EditMeshData * edit_data
char wrapper_type_finalize
struct BMEditMesh * edit_mesh
struct CustomData pdata ldata
struct CustomData vdata edata fdata
struct ModifierData * next
void(* modifyGeometrySet)(struct ModifierData *md, const struct ModifierEvalContext *ctx, struct GeometrySet *geometry_set)
void(* deformVertsEM)(struct ModifierData *md, const struct ModifierEvalContext *ctx, struct BMEditMesh *editData, struct Mesh *mesh, float(*vertexCos)[3], int numVerts)
void(* requiredDataMask)(struct Object *ob, struct ModifierData *md, struct CustomData_MeshMasks *r_cddata_masks)
bool(* dependsOnNormals)(struct ModifierData *md)
bool(* dependsOnTime)(struct ModifierData *md)
CustomData_MeshMasks last_data_mask
struct Mesh * mesh_deform_eval
struct GeometrySet * geometry_set_eval
struct SculptSession * sculpt
struct ToolSettings * toolsettings
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)