[Bf-blender-cvs] [01661ff] depsgraph_refactor: Depsgraph: Pass bmain to the new modifier updateDepsgraph callback

Sergey Sharybin noreply at git.blender.org
Mon Mar 16 17:14:06 CET 2015


Commit: 01661ff3933ae3f14c54cd61d6edf8f164a78314
Author: Sergey Sharybin
Date:   Mon Mar 16 20:46:43 2015 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rB01661ff3933ae3f14c54cd61d6edf8f164a78314

Depsgraph: Pass bmain to the new modifier updateDepsgraph callback

This is complementary change to what we did in master in order to deal
with simulation modifiers.

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

M	source/blender/blenkernel/BKE_modifier.h
M	source/blender/depsgraph/intern/depsgraph_build.h
M	source/blender/depsgraph/intern/depsgraph_build_relations.cpp
M	source/blender/modifiers/intern/MOD_armature.c
M	source/blender/modifiers/intern/MOD_array.c
M	source/blender/modifiers/intern/MOD_boolean.c
M	source/blender/modifiers/intern/MOD_cast.c
M	source/blender/modifiers/intern/MOD_cloth.c
M	source/blender/modifiers/intern/MOD_curve.c
M	source/blender/modifiers/intern/MOD_datatransfer.c
M	source/blender/modifiers/intern/MOD_displace.c
M	source/blender/modifiers/intern/MOD_dynamicpaint.c
M	source/blender/modifiers/intern/MOD_fluidsim.c
M	source/blender/modifiers/intern/MOD_hook.c
M	source/blender/modifiers/intern/MOD_lattice.c
M	source/blender/modifiers/intern/MOD_mask.c
M	source/blender/modifiers/intern/MOD_meshdeform.c
M	source/blender/modifiers/intern/MOD_mirror.c
M	source/blender/modifiers/intern/MOD_normal_edit.c
M	source/blender/modifiers/intern/MOD_particleinstance.c
M	source/blender/modifiers/intern/MOD_screw.c
M	source/blender/modifiers/intern/MOD_shrinkwrap.c
M	source/blender/modifiers/intern/MOD_simpledeform.c
M	source/blender/modifiers/intern/MOD_smoke.c
M	source/blender/modifiers/intern/MOD_uvproject.c
M	source/blender/modifiers/intern/MOD_uvwarp.c
M	source/blender/modifiers/intern/MOD_warp.c
M	source/blender/modifiers/intern/MOD_wave.c
M	source/blender/modifiers/intern/MOD_weightvgedit.c
M	source/blender/modifiers/intern/MOD_weightvgmix.c
M	source/blender/modifiers/intern/MOD_weightvgproximity.c

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

diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index 3afa931..67aa9c6 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -267,7 +267,11 @@ typedef struct ModifierTypeInfo {
 	 * This function is optional.
 	 */
 	/* XXX DEPSGRAPH PORTING: remove the old callback above once porting is complete! */
-	void (*updateDepsgraph)(struct ModifierData *md, struct Scene *scene, struct Object *ob, struct DepsNodeHandle *node);
+	void (*updateDepsgraph)(struct ModifierData *md,
+	                        struct Main *bmain,
+	                        struct Scene *scene,
+	                        struct Object *ob,
+	                        struct DepsNodeHandle *node);
 
 	/* Should return true if the modifier needs to be recalculated on time
 	 * changes.
diff --git a/source/blender/depsgraph/intern/depsgraph_build.h b/source/blender/depsgraph/intern/depsgraph_build.h
index edcbcc1..7682248 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.h
+++ b/source/blender/depsgraph/intern/depsgraph_build.h
@@ -253,8 +253,8 @@ struct DepsgraphRelationBuilder
 	                              eDepsRelation_Type type, const string &description);
 
 	void build_scene(Main *bmain, Scene *scene);
-	void build_group(Scene *scene, Object *object, Group *group);
-	void build_object(Scene *scene, Object *ob);
+	void build_group(Main *bmain, Scene *scene, Object *object, Group *group);
+	void build_object(Main *bmain, Scene *scene, Object *ob);
 	void build_object_parent(Object *ob);
 	void build_constraints(Scene *scene, ID *id, eDepsNode_Type component_type, const char *component_subdata,
 	                       ListBase *constraints, RootPChanMap *root_map);
@@ -268,7 +268,7 @@ struct DepsgraphRelationBuilder
 	void build_rig(Scene *scene, Object *ob);
 	void build_proxy_rig(Object *ob);
 	void build_shapekeys(ID *obdata, Key *key);
-	void build_obdata_geom(Scene *scene, Object *ob);
+	void build_obdata_geom(Main *bmain, Scene *scene, Object *ob);
 	void build_camera(Object *ob);
 	void build_lamp(Object *ob);
 	void build_nodetree(ID *owner, bNodeTree *ntree);
diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
index 1eae35f..56ca11d 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
@@ -235,11 +235,11 @@ void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene)
 		Object *ob = base->object;
 
 		/* object itself */
-		build_object(scene, ob);
+		build_object(bmain, scene, ob);
 
 		/* object that this is a proxy for */
 		if (ob->proxy) {
-			build_object(scene, ob->proxy);
+			build_object(bmain, scene, ob->proxy);
 			/* TODO(sergey): This is an inverted relation, matches old depsgraph
 			 * behavior and need to be investigated if it still need to be inverted.
 			 */
@@ -250,7 +250,7 @@ void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene)
 
 		/* Object dupligroup. */
 		if (ob->dup_group) {
-			build_group(scene, ob, ob->dup_group);
+			build_group(bmain, scene, ob, ob->dup_group);
 		}
 	}
 
@@ -280,7 +280,8 @@ void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene)
 	}
 }
 
-void DepsgraphRelationBuilder::build_group(Scene *scene,
+void DepsgraphRelationBuilder::build_group(Main *bmain,
+                                           Scene *scene,
                                            Object *object,
                                            Group *group)
 {
@@ -294,7 +295,7 @@ void DepsgraphRelationBuilder::build_group(Scene *scene,
 	     go = go->next)
 	{
 		if (!group_done) {
-			build_object(scene, go->ob);
+			build_object(bmain, scene, go->ob);
 		}
 		ComponentKey dupli_transform_key(&go->ob->id, DEPSNODE_TYPE_TRANSFORM);
 		add_relation(dupli_transform_key,
@@ -305,7 +306,7 @@ void DepsgraphRelationBuilder::build_group(Scene *scene,
 	group_id->flag |= LIB_DOIT;
 }
 
-void DepsgraphRelationBuilder::build_object(Scene *scene, Object *ob)
+void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *ob)
 {
 	if (ob->id.flag & LIB_DOIT) {
 		return;
@@ -383,7 +384,7 @@ void DepsgraphRelationBuilder::build_object(Scene *scene, Object *ob)
 			case OB_MBALL:
 			case OB_LATTICE:
 			{
-				build_obdata_geom(scene, ob);
+				build_obdata_geom(bmain, scene, ob);
 			}
 			break;
 
@@ -1465,7 +1466,7 @@ void DepsgraphRelationBuilder::build_shapekeys(ID *obdata, Key *key)
  *   re-evaluation of the individual instances of this geometry.
  */
 // TODO: Materials and lighting should probably get their own component, instead of being lumped under geometry?
-void DepsgraphRelationBuilder::build_obdata_geom(Scene *scene, Object *ob)
+void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Object *ob)
 {
 	ID *obdata = (ID *)ob->data;
 
@@ -1499,7 +1500,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Scene *scene, Object *ob)
 
 			if (mti->updateDepsgraph) {
 				DepsNodeHandle handle = create_node_handle(mod_key);
-				mti->updateDepsgraph(md, scene, ob, &handle);
+				mti->updateDepsgraph(md, bmain, scene, ob, &handle);
 			}
 
 			if (BKE_object_modifier_use_time(ob, md)) {
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c
index 23923dc..9ce31ce 100644
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@ -116,6 +116,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 }
 
 static void updateDepsgraph(ModifierData *md,
+                            struct Main *UNUSED(bmain),
                             struct Scene *UNUSED(scene),
                             Object *UNUSED(ob),
                             struct DepsNodeHandle *node)
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c
index ae4d49c..25115ce 100644
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@ -136,6 +136,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 }
 
 static void updateDepsgraph(ModifierData *md,
+                            struct Main *UNUSED(bmain),
                             struct Scene *scene,
                             Object *UNUSED(ob),
                             struct DepsNodeHandle *node)
diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
index 950745b..eb54a3c 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -90,6 +90,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 }
 
 static void updateDepsgraph(ModifierData *md,
+                            struct Main *UNUSED(bmain),
                             struct Scene *UNUSED(scene),
                             Object *ob,
                             struct DepsNodeHandle *node)
diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c
index 9a9de69..7c3d65a 100644
--- a/source/blender/modifiers/intern/MOD_cast.c
+++ b/source/blender/modifiers/intern/MOD_cast.c
@@ -122,6 +122,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 }
 
 static void updateDepsgraph(ModifierData *md,
+                            struct Main *UNUSED(bmain),
                             struct Scene *UNUSED(scene),
                             Object *UNUSED(ob),
                             struct DepsNodeHandle *node)
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c
index f749719..4f478a5 100644
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@ -141,6 +141,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 }
 
 static void updateDepsgraph(ModifierData *md,
+                            struct Main *UNUSED(bmain),
                             struct Scene *scene,
                             Object *ob,
                             struct DepsNodeHandle *node)
diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c
index d23db2a..1488296 100644
--- a/source/blender/modifiers/intern/MOD_curve.c
+++ b/source/blender/modifiers/intern/MOD_curve.c
@@ -110,6 +110,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 }
 
 static void updateDepsgraph(ModifierData *md,
+                            struct Main *UNUSED(bmain),
                             struct Scene *scene,
                             Object *UNUSED(ob),
                             struct DepsNodeHandle *node)
diff --git a/source/blender/modifiers/intern/MOD_datatransfer.c b/source/blender/modifiers/intern/MOD_datatransfer.c
index e7df210..57d119f 100644
--- a/source/blender/modifiers/intern/MOD_datatransfer.c
+++ b/source/blender/modifiers/intern/MOD_datatransfer.c
@@ -148,6 +148,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 }
 
 static void updateDepsgraph(ModifierData *md,
+                            struct Main *UNUSED(bmain),
                             struct Scene *UNUSED(scene),
                             Object *UNUSED(ob),
                             struct DepsNodeHandle *node)
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c
index 7ea7fe9..2921472 100644
--- a/source/blender/modifiers/intern/MOD_displace.c
+++ b/source/blender/modifiers/intern/MOD_displace.c
@@ -172,6 +172,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 }
 
 static void updateDepsgraph(ModifierData *md,
+                            struct Main *UNUSED(bmain),
                             struct Scene *UNUSED(scene),
                             Object *ob,
                             struct DepsNodeHandle *node)
diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c
index ae0aed1..95bc470 100644
--- a/source/blender/modifiers/i

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list