[Bf-blender-cvs] [a16e5b8efa8] blender2.8: Cleanup: remove unused DerivedMesh code.

Sebastian Parborg noreply at git.blender.org
Thu Sep 27 20:21:00 CEST 2018


Commit: a16e5b8efa8be09362d5e56812221db4705b0e26
Author: Sebastian Parborg
Date:   Thu Sep 27 15:54:10 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBa16e5b8efa8be09362d5e56812221db4705b0e26

Cleanup: remove unused DerivedMesh code.

Differential Revision: https://developer.blender.org/D3736

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

M	intern/dualcon/dualcon.h
M	source/blender/blenkernel/intern/DerivedMesh.c
M	source/blender/depsgraph/DEG_depsgraph_build.h
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/depsgraph/intern/depsgraph_types.h
M	source/blender/editors/include/ED_mesh.h
M	source/blender/editors/mesh/editmesh_loopcut.c
M	source/blender/editors/mesh/editmesh_utils.c
M	source/blender/editors/sculpt_paint/paint_intern.h
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/sculpt_paint/paint_vertex_proj.c
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/gpu/GPU_buffers.h
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/makesdna/DNA_meshdata_types.h
M	source/blender/makesrna/intern/rna_gpencil_modifier.c
M	source/blender/makesrna/intern/rna_userdef.c
M	source/blender/modifiers/intern/MOD_fluidsim_util.c
M	source/blender/modifiers/intern/MOD_ocean.c
M	source/blender/python/bmesh/bmesh_py_types.c
M	source/blender/python/mathutils/mathutils_bvhtree.c
M	source/blender/render/extern/include/RE_render_ext.h
M	source/blender/render/intern/source/render_texture.c

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

diff --git a/intern/dualcon/dualcon.h b/intern/dualcon/dualcon.h
index 6ec63f4fdac..2e7616f3446 100644
--- a/intern/dualcon/dualcon.h
+++ b/intern/dualcon/dualcon.h
@@ -37,8 +37,6 @@ typedef unsigned int (*DualConTri)[3];
 
 typedef unsigned int (*DualConLoop);
 
-struct DerivedMesh;
-
 typedef struct DualConInput {
 	DualConLoop mloop;
 
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 93764ac5f78..6382fd91d0d 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -1149,60 +1149,6 @@ DerivedMesh *mesh_create_derived(Mesh *me, float (*vertCos)[3])
 	return dm;
 }
 
-/* XXX2.8(Sybren): can be removed once DerivedMesh port is done */
-#ifdef WITH_DERIVEDMESH_DEPRECATED_FUNCS
-DerivedMesh *mesh_create_derived_for_modifier(
-        struct Depsgraph *depsgraph, Scene *scene, Object *ob,
-        ModifierData *md, int build_shapekey_layers)
-{
-	Mesh *me = ob->data;
-	const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
-	DerivedMesh *dm;
-	KeyBlock *kb;
-	ModifierEvalContext mectx = {depsgraph, ob, 0};
-
-	md->scene = scene;
-
-	if (!(md->mode & eModifierMode_Realtime)) {
-		return NULL;
-	}
-
-	if (mti->isDisabled && mti->isDisabled(md, 0)) {
-		return NULL;
-	}
-
-	if (build_shapekey_layers && me->key && (kb = BLI_findlink(&me->key->block, ob->shapenr - 1))) {
-		BKE_keyblock_convert_to_mesh(kb, me);
-	}
-
-	if (mti->type == eModifierTypeType_OnlyDeform) {
-		int numVerts;
-		float (*deformedVerts)[3] = BKE_mesh_vertexCos_get(me, &numVerts);
-
-		modwrap_deformVerts(md, &mectx, NULL, deformedVerts, numVerts);
-		dm = mesh_create_derived(me, deformedVerts);
-
-		if (build_shapekey_layers)
-			add_shapekey_layers(dm, me, ob);
-
-		MEM_freeN(deformedVerts);
-	}
-	else {
-		DerivedMesh *tdm = mesh_create_derived(me, NULL);
-
-		if (build_shapekey_layers)
-			add_shapekey_layers(tdm, me, ob);
-
-		dm = modwrap_applyModifier(md, &mectx, tdm);
-		ASSERT_IS_VALID_DM(dm);
-
-		if (tdm != dm) tdm->release(tdm);
-	}
-
-	return dm;
-}
-#endif
-
 static float (*get_editbmesh_orco_verts(BMEditMesh *em))[3]
 {
 	BMIter iter;
diff --git a/source/blender/depsgraph/DEG_depsgraph_build.h b/source/blender/depsgraph/DEG_depsgraph_build.h
index 30fefb7d4e4..24850c45d3a 100644
--- a/source/blender/depsgraph/DEG_depsgraph_build.h
+++ b/source/blender/depsgraph/DEG_depsgraph_build.h
@@ -113,7 +113,7 @@ typedef enum eDepsObjectComponentType {
 	DEG_OB_COMP_ANIMATION,
 	/* Transform Component (Parenting/Constraints) */
 	DEG_OB_COMP_TRANSFORM,
-	/* Geometry Component (DerivedMesh/Displist) */
+	/* Geometry Component (Mesh/Displist) */
 	DEG_OB_COMP_GEOMETRY,
 
 	/* Evaluation-Related Outer Types (with Subdata) */
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 3a179314fce..65c9cabe9ef 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1765,7 +1765,7 @@ void DepsgraphRelationBuilder::build_shapekeys(Key *key)
  * ==========================
  *
  * The evaluation of geometry on objects is as follows:
- * - The actual evaluated of the derived geometry (e.g. DerivedMesh, DispList)
+ * - The actual evaluated of the derived geometry (e.g. Mesh, DispList)
  *   occurs in the Geometry component of the object which references this.
  *   This includes modifiers, and the temporary "ubereval" for geometry.
  *   Therefore, each user of a piece of shared geometry data ends up evaluating
diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h
index 2bc6ea8fbc9..f5892f49955 100644
--- a/source/blender/depsgraph/intern/depsgraph_types.h
+++ b/source/blender/depsgraph/intern/depsgraph_types.h
@@ -122,7 +122,7 @@ typedef enum eDepsNode_Type {
 	DEG_NODE_TYPE_ANIMATION,
 	/* Transform Component (Parenting/Constraints) */
 	DEG_NODE_TYPE_TRANSFORM,
-	/* Geometry Component (DerivedMesh/Displist) */
+	/* Geometry Component (Mesh/Displist) */
 	DEG_NODE_TYPE_GEOMETRY,
 	/* Sequencer Component (Scene Only) */
 	DEG_NODE_TYPE_SEQUENCER,
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
index 8f5f25f887f..52e8c4eeace 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -86,7 +86,6 @@ void EDBM_selectmode_to_scene(struct bContext *C);
 void EDBM_mesh_make(struct Object *ob, const int select_mode, const bool add_key_index);
 void EDBM_mesh_free(struct BMEditMesh *em);
 void EDBM_mesh_load(struct Main *bmain, struct Object *ob);
-struct DerivedMesh *EDBM_mesh_deform_dm_get(struct BMEditMesh *em);
 
 /* flushes based on the current select mode.  if in vertex select mode,
  * verts select/deselect edges and faces, if in edge select mode,
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index f239ccc5be1..1ca3549090f 100644
--- a/source/blender/editors/mesh/editmesh_loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -44,7 +44,6 @@
 #include "BKE_modifier.h"
 #include "BKE_report.h"
 #include "BKE_editmesh.h"
-#include "BKE_DerivedMesh.h"
 #include "BKE_unit.h"
 #include "BKE_layer.h"
 
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index 37f5aa806de..7fdef86f7e5 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -328,7 +328,7 @@ void EDBM_mesh_make(Object *ob, const int select_mode, const bool add_key_index)
 }
 
 /**
- * \warning This can invalidate the #DerivedMesh cache of other objects (for linked duplicates).
+ * \warning This can invalidate the #Mesh runtime cache of other objects (for linked duplicates).
  * Most callers should run #DEG_id_tag_update on \a ob->data, see: T46738, T46913
  */
 void EDBM_mesh_load(Main *bmain, Object *ob)
@@ -1367,19 +1367,6 @@ void EDBM_update_generic(BMEditMesh *em, const bool do_tessface, const bool is_d
 
 /** \} */
 
-/* -------------------------------------------------------------------- */
-/** \name Data Access
- * \{ */
-
-DerivedMesh *EDBM_mesh_deform_dm_get(BMEditMesh *em)
-{
-	return ((em->derivedFinal != NULL) &&
-	        (em->derivedFinal->type == DM_TYPE_EDITBMESH) &&
-	        (em->derivedFinal->deformedOnly != false)) ? em->derivedFinal : NULL;
-}
-
-/** \} */
-
 /* -------------------------------------------------------------------- */
 /** \name Operator Helpers
  * \{ */
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index 7d3049434d6..c74dc252d0c 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -54,10 +54,14 @@ struct wmEvent;
 struct wmOperator;
 struct wmOperatorType;
 struct wmWindowManager;
-struct DMCoNo;
 struct UndoStep;
 enum ePaintMode;
 
+typedef struct CoNo {
+	float co[3];
+	float no[3];
+} CoNo;
+
 /* paint_stroke.c */
 typedef bool (*StrokeGetLocation)(struct bContext *C, float location[3], const float mouse[2]);
 typedef bool (*StrokeTestStart)(struct bContext *C, struct wmOperator *op, const float mouse[2]);
@@ -161,7 +165,7 @@ void PAINT_OT_weight_sample_group(struct wmOperatorType *ot);
 struct VertProjHandle;
 struct VertProjHandle *ED_vpaint_proj_handle_create(
         struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob,
-        struct DMCoNo **r_vcosnos);
+        struct CoNo **r_vcosnos);
 void  ED_vpaint_proj_handle_update(
         struct Depsgraph *depsgraph, struct VertProjHandle *vp_handle,
         /* runtime vars */
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index d62865b44d0..4821fd4fef4 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -2472,7 +2472,7 @@ struct VPaintData {
 	uint paintcol;
 
 	struct VertProjHandle *vp_handle;
-	struct DMCoNo *vertexcosnos;
+	struct CoNo *vertexcosnos;
 
 	/* modify 'me->mcol' directly, since the derived mesh is drawing from this
 	 * array, otherwise we need to refresh the modifier stack */
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_proj.c b/source/blender/editors/sculpt_paint/paint_vertex_proj.c
index 602bfe1ab8e..31ae12c112a 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_proj.c
@@ -39,7 +39,6 @@
 #include "DNA_mesh_types.h"
 #include "DNA_object_types.h"
 
-#include "BKE_DerivedMesh.h"  /* XXX To be removed, only used for DMCoNo struct */
 #include "BKE_context.h"
 #include "BKE_mesh_iterators.h"
 #include "BKE_mesh_runtime.h"
@@ -56,7 +55,7 @@
 
 /* stored while painting */
 struct VertProjHandle {
-	DMCoNo *vcosnos;
+	CoNo *vcosnos;
 
 	bool use_update;
 
@@ -85,7 +84,7 @@ static void vpaint_proj_dm_map_cosnos_init__map_cb(
         const float no_f[3], const short no_s[3])
 {
 	struct VertProjHandle *vp_handle = userData;
-	DMCoNo *co_no = &vp_handle->vcosnos[index];
+	CoNo *co_no = &vp_handle->vcosnos[index];
 
 	/* check if we've been here before (normal should not be 0) */
 	if (!is_zero_v3(co_no->no)) {
@@ -127,7 +126,7 @@ static void vpaint_proj_dm_map_cosnos_update__map_cb(
 	struct VertProjUpdate *vp_update = userData;
 	struct VertProjHandle *vp_handle = vp_update->vp_handle;
 
-	DMCoNo *co_no = &vp_handle->vcosnos[index];
+	CoNo *co_no = &vp_handle->vcosnos[index];
 
 	/* find closest vertex */
 	{
@@ -187,13 +186,13 @@ static void vpaint_proj_dm_map_cosnos_update(
 
 struct VertProjHandle *ED_vpaint_proj_handle_create(
         struct Depsgraph *depsgraph, Scene *scene, Object *ob,
-        DMCoNo **r_vcosnos)
+        CoNo **r_vcosnos)
 {
 	struct VertProjHandle *vp_handle = MEM_mallocN(sizeof(struct VertProjHandle), __func__);
 	Mesh *me = ob->data;
 
 	/* setup the handle */
-	vp_handle->vcosnos = MEM_mallocN(sizeof(DMCoNo) * me->totvert, "vertexcosnos map");
+	vp_handle->vcosnos = M

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list