[Bf-blender-cvs] [c39d82daf4a] master: Cleanup: remove unused derivedmesh code.

Brecht Van Lommel noreply at git.blender.org
Thu Mar 28 20:04:48 CET 2019


Commit: c39d82daf4ac79d87a10283eff2694d1744ed183
Author: Brecht Van Lommel
Date:   Wed Mar 27 19:07:16 2019 +0100
Branches: master
https://developer.blender.org/rBc39d82daf4ac79d87a10283eff2694d1744ed183

Cleanup: remove unused derivedmesh code.

===================================================================

M	source/blender/blenkernel/BKE_DerivedMesh.h
M	source/blender/blenkernel/BKE_mesh_runtime.h
M	source/blender/blenkernel/BKE_modifier.h
M	source/blender/blenkernel/intern/DerivedMesh.c
M	source/blender/blenkernel/intern/crazyspace.c
M	source/blender/blenkernel/intern/modifier.c
M	source/blender/blenkernel/intern/object_update.c
M	source/blender/blenkernel/intern/subsurf_ccg.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/python/bmesh/bmesh_py_types.c
M	source/blender/python/mathutils/mathutils_bvhtree.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index cd7422415dc..46938b13ea6 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -87,21 +87,11 @@ struct Object;
 struct PBVH;
 struct Scene;
 
-/* number of sub-elements each mesh element has (for interpolation) */
-// #define SUB_ELEMS_VERT 0 /* UNUSED */
-#define SUB_ELEMS_EDGE 2
-#define SUB_ELEMS_FACE 50
-
 /*
  * Note: all mface interfaces now officially operate on tessellated data.
  *       Also, the mface origindex layer indexes mpolys, not mfaces.
  */
 
-typedef struct DMCoNo {
-	float co[3];
-	float no[3];
-} DMCoNo;
-
 /* keep in sync with MFace/MPoly types */
 typedef struct DMFlagMat {
 	short mat_nr;
@@ -411,14 +401,6 @@ void *DM_get_tessface_data_layer(struct DerivedMesh *dm, int type);
 void *DM_get_poly_data_layer(struct DerivedMesh *dm, int type);
 void *DM_get_loop_data_layer(struct DerivedMesh *dm, int type);
 
-/* custom data setting functions
- * copy supplied data into first layer of type using layer's copy function
- * (deep copy if appropriate)
- */
-void DM_set_vert_data(struct DerivedMesh *dm, int index, int type, void *data);
-void DM_set_edge_data(struct DerivedMesh *dm, int index, int type, void *data);
-void DM_set_tessface_data(struct DerivedMesh *dm, int index, int type, void *data);
-
 /* custom data copy functions
  * copy count elements from source_index in source to dest_index in dest
  * these copy all layers for which the CD_FLAG_NOCOPY flag is not set
@@ -426,28 +408,6 @@ void DM_set_tessface_data(struct DerivedMesh *dm, int index, int type, void *dat
 void DM_copy_vert_data(
         struct DerivedMesh *source, struct DerivedMesh *dest,
         int source_index, int dest_index, int count);
-void DM_copy_edge_data(
-        struct DerivedMesh *source, struct DerivedMesh *dest,
-        int source_index, int dest_index, int count);
-void DM_copy_tessface_data(
-        struct DerivedMesh *source, struct DerivedMesh *dest,
-        int source_index, int dest_index, int count);
-void DM_copy_loop_data(
-        struct DerivedMesh *source, struct DerivedMesh *dest,
-        int source_index, int dest_index, int count);
-void DM_copy_poly_data(
-        struct DerivedMesh *source, struct DerivedMesh *dest,
-        int source_index, int dest_index, int count);
-
-/* custom data free functions
- * free count elements, starting at index
- * they free all layers for which the CD_FLAG_NOCOPY flag is not set
- */
-void DM_free_vert_data(struct DerivedMesh *dm, int index, int count);
-void DM_free_edge_data(struct DerivedMesh *dm, int index, int count);
-void DM_free_tessface_data(struct DerivedMesh *dm, int index, int count);
-void DM_free_loop_data(struct DerivedMesh *dm, int index, int count);
-void DM_free_poly_data(struct DerivedMesh *dm, int index, int count);
 
 /*sets up mpolys for a DM based on face iterators in source*/
 void DM_DupPolys(DerivedMesh *source, DerivedMesh *target);
@@ -461,31 +421,6 @@ void DM_interp_vert_data(
         int *src_indices, float *weights,
         int count, int dest_index);
 
-typedef float EdgeVertWeight[SUB_ELEMS_EDGE][SUB_ELEMS_EDGE];
-void DM_interp_edge_data(
-        struct DerivedMesh *source, struct DerivedMesh *dest,
-        int *src_indices,
-        float *weights, EdgeVertWeight *vert_weights,
-        int count, int dest_index);
-
-typedef float FaceVertWeight[SUB_ELEMS_FACE][SUB_ELEMS_FACE];
-void DM_interp_tessface_data(
-        struct DerivedMesh *source, struct DerivedMesh *dest,
-        int *src_indices,
-        float *weights, FaceVertWeight *vert_weights,
-        int count, int dest_index);
-
-void DM_interp_loop_data(
-        struct DerivedMesh *source, struct DerivedMesh *dest,
-        int *src_indices,
-        float *weights, int count, int dest_index);
-
-void DM_interp_poly_data(
-        struct DerivedMesh *source, struct DerivedMesh *dest,
-        int *src_indices,
-        float *weights, int count, int dest_index);
-
-
 void mesh_get_mapped_verts_coords(struct Mesh *me_eval, float (*r_cos)[3], const int totcos);
 
 DerivedMesh *mesh_create_derived_render(
@@ -510,18 +445,12 @@ float (*editbmesh_get_vertex_cos(struct BMEditMesh *em, int *r_numVerts))[3];
 bool editbmesh_modifier_is_enabled(struct Scene *scene, struct ModifierData *md, bool has_prev_mesh);
 void makeDerivedMesh(
         struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct BMEditMesh *em,
-        const struct CustomData_MeshMasks *dataMask, const bool build_shapekey_layers);
-
-void DM_add_named_tangent_layer_for_uv(
-        CustomData *uv_data, CustomData *tan_data, int numLoopData,
-        const char *layer_name);
+        const struct CustomData_MeshMasks *dataMask);
 
 void DM_calc_loop_tangents(
         DerivedMesh *dm, bool calc_active_tangent, const char (*tangent_names)[MAX_NAME],
         int tangent_names_count);
 
-void DM_init_origspace(DerivedMesh *dm);
-
 /* debug only */
 #ifndef NDEBUG
 char *DM_debug_info(DerivedMesh *dm);
diff --git a/source/blender/blenkernel/BKE_mesh_runtime.h b/source/blender/blenkernel/BKE_mesh_runtime.h
index d3eb573bc2d..3be97ad7afe 100644
--- a/source/blender/blenkernel/BKE_mesh_runtime.h
+++ b/source/blender/blenkernel/BKE_mesh_runtime.h
@@ -39,13 +39,6 @@ struct Mesh;
 struct Object;
 struct Scene;
 
-/* Undefine to hide DerivedMesh-based function declarations */
-#undef USE_DERIVEDMESH
-
-#ifdef USE_DERIVEDMESH
-struct DerivedMesh;
-#endif
-
 void BKE_mesh_runtime_reset(struct Mesh *mesh);
 void BKE_mesh_runtime_reset_on_copy(struct Mesh *mesh, const int flag);
 int BKE_mesh_runtime_looptri_len(const struct Mesh *mesh);
@@ -64,19 +57,9 @@ void BKE_mesh_runtime_verttri_from_looptri(
  * to a more suitable location when that file is removed.
  * They should also be renamed to use conventions from BKE, not old DerivedMesh.c.
  * For now keep the names similar to avoid confusion. */
-#ifdef USE_DERIVEDMESH
-struct DerivedMesh *mesh_get_derived_final(
-        struct Depsgraph *depsgraph, struct Scene *scene,
-        struct Object *ob, const struct CustomData_MeshMasks *dataMask);
-#endif
 struct Mesh *mesh_get_eval_final(
         struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, const struct CustomData_MeshMasks *dataMask);
 
-#ifdef USE_DERIVEDMESH
-struct DerivedMesh *mesh_get_derived_deform(
-        struct Depsgraph *depsgraph, struct Scene *scene,
-        struct Object *ob, const struct CustomData_MeshMasks *dataMask);
-#endif
 struct Mesh *mesh_get_eval_deform(
         struct Depsgraph *depsgraph, struct Scene *scene,
         struct Object *ob, const struct CustomData_MeshMasks *dataMask);
@@ -85,32 +68,20 @@ struct Mesh *mesh_create_eval_final_render(
         struct Depsgraph *depsgraph, struct Scene *scene,
         struct Object *ob, const struct CustomData_MeshMasks *dataMask);
 
-#ifdef USE_DERIVEDMESH
-struct DerivedMesh *mesh_create_derived_index_render(
-        struct Depsgraph *depsgraph, struct Scene *scene,
-        struct Object *ob, const struct CustomData_MeshMasks *dataMask, int index);
-#endif
 struct Mesh *mesh_create_eval_final_index_render(
         struct Depsgraph *depsgraph, struct Scene *scene,
         struct Object *ob, const struct CustomData_MeshMasks *dataMask, int index);
 
-#ifdef USE_DERIVEDMESH
-struct DerivedMesh *mesh_create_derived_view(
-        struct Depsgraph *depsgraph, struct Scene *scene,
-        struct Object *ob, const struct CustomData_MeshMasks *dataMask);
-#endif
 struct Mesh *mesh_create_eval_final_view(
         struct Depsgraph *depsgraph, struct Scene *scene,
         struct Object *ob, const struct CustomData_MeshMasks *dataMask);
 
 struct Mesh *mesh_create_eval_no_deform(
         struct Depsgraph *depsgraph, struct Scene *scene,
-        struct Object *ob, float (*vertCos)[3],
-        const struct CustomData_MeshMasks *dataMask);
+        struct Object *ob, const struct CustomData_MeshMasks *dataMask);
 struct Mesh *mesh_create_eval_no_deform_render(
         struct Depsgraph *depsgraph, struct Scene *scene,
-        struct Object *ob, float (*vertCos)[3],
-        const struct CustomData_MeshMasks *dataMask);
+        struct Object *ob, const struct CustomData_MeshMasks *dataMask);
 
 
 void BKE_mesh_runtime_eval_to_meshkey(struct Mesh *me_deformed, struct Mesh *me, struct KeyBlock *kb);
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index 22782b675f5..683c932731d 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -431,14 +431,6 @@ void modwrap_deformVertsEM(
         struct BMEditMesh *em, struct Mesh *me,
         float (*vertexCos)[3], int numVerts);
 
-/* wrappers for modifier callbacks that accept Mesh and select the proper implementation
- * depending on if the modifier has been ported to Mesh or is still using DerivedMesh
- */
-
-struct DerivedMesh *modifier_applyModifier_DM_deprecated(
-        struct ModifierData *md, const struct ModifierEvalContext *ctx,
-        struct DerivedMesh *dm);
-
 struct Mesh *BKE_modifier_get_evaluated_mesh_from_evaluated_object(
         struct Object *ob_eval, const bool get_cage_mesh);
 
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 28b87d034b1..886545ff4b1 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -768,21 +768,6 @@ void *DM_get_loop_data_layer(DerivedMesh *dm, int type)
 	return CustomData_get_layer(&dm->loopData, type);
 }
 
-void DM_set_vert_data(DerivedMesh *dm, int index, int type, void *data)
-{
-	CustomData_set(&dm->vertData, index, type, data);
-}
-
-void DM_set_edge_data(DerivedMesh *dm, int index, int type, void *data)
-{
-	CustomData_set(&dm->edgeData, index, type, data);
-}
-
-void DM_set_tessface_data(DerivedMesh *dm, int index, int type, void *data)
-{
-	CustomData_set(&dm->faceData, index, type, data);
-}
-
 void DM_copy_vert_data(DerivedMesh *source, DerivedMesh *dest,
                        int source_index, int dest_index, int count)
 {
@@ -790,59 +775,6 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list