[Bf-blender-cvs] [6e860bef288] blender2.8: Merge branch 'master' into blender2.8

Sergey Sharybin noreply at git.blender.org
Thu Feb 22 13:05:07 CET 2018


Commit: 6e860bef2885ea9f5aec3016e90c7557fc80aa01
Author: Sergey Sharybin
Date:   Thu Feb 22 13:05:00 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB6e860bef2885ea9f5aec3016e90c7557fc80aa01

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/blenkernel/BKE_modifier.h
index 8ee67850e5f,c4dc4998e35..b687ebd6196
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@@ -267,11 -285,9 +280,8 @@@ typedef struct ModifierTypeInfo 
  	 *
  	 * This function is optional.
  	 */
 -	/* TODO(sergey): Remove once we finally switched to the new depsgraph. */
  	void (*updateDepsgraph)(struct ModifierData *md,
- 	                        struct Main *bmain,
- 	                        struct Scene *scene,
- 	                        struct Object *ob,
- 	                        struct DepsNodeHandle *node);
+ 	                        const ModifierUpdateDepsgraphContext* ctx);
  
  	/* Should return true if the modifier needs to be recalculated on time
  	 * changes.
diff --cc source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 0fd8f30557a,abb1e3674a7..325596f54fe
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@@ -1626,22 -1534,16 +1626,27 @@@ void DepsgraphRelationBuilder::build_ob
  	/* link components to each other */
  	add_relation(obdata_geom_key, geom_key, "Object Geometry Base Data");
  
 +	OperationKey obdata_ubereval_key(&object->id,
 +	                                 DEG_NODE_TYPE_GEOMETRY,
 +	                                 DEG_OPCODE_GEOMETRY_UBEREVAL);
 +
 +	/* Special case: modifiers and DerivedMesh creation queries scene for various
 +	 * things like data mask to be used. We add relation here to ensure object is
 +	 * never evaluated prior to Scene's CoW is ready.
 +	 */
 +	OperationKey scene_key(&scene_->id,
 +	                       DEG_NODE_TYPE_PARAMETERS,
 +	                       DEG_OPCODE_PLACEHOLDER,
 +	                       "Scene Eval");
 +	add_relation(scene_key, obdata_ubereval_key, "CoW Relation");
 +
  	/* Modifiers */
  	if (object->modifiers.first != NULL) {
 -		OperationKey obdata_ubereval_key(&object->id,
 -		                                 DEG_NODE_TYPE_GEOMETRY,
 -		                                 DEG_OPCODE_GEOMETRY_UBEREVAL);
+ 		ModifierUpdateDepsgraphContext ctx = {};
+ 		ctx.bmain = bmain_;
+ 		ctx.scene = scene_;
+ 		ctx.object = object;
+ 
  		LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
  			const ModifierTypeInfo *mti = modifierType_getInfo((ModifierType)md->type);
  			if (mti->updateDepsgraph) {
diff --cc source/blender/modifiers/intern/MOD_armature.c
index 60c7998853e,22ec13cd0a0..f6640704a83
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@@ -97,11 -99,19 +97,7 @@@ static void foreachObjectLink
  	walk(userData, ob, &amd->object, IDWALK_CB_NOP);
  }
  
- static void updateDepsgraph(ModifierData *md,
-                             struct Main *UNUSED(bmain),
-                             struct Scene *UNUSED(scene),
-                             Object *UNUSED(ob),
-                             struct DepsNodeHandle *node)
 -static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 -{
 -	ArmatureModifierData *amd = (ArmatureModifierData *) md;
 -
 -	if (amd->object) {
 -		DagNode *curNode = dag_get_node(ctx->forest, amd->object);
 -
 -		dag_add_relation(ctx->forest, curNode, ctx->obNode,
 -		                 DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Armature Modifier");
 -	}
 -}
 -
+ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
  {
  	ArmatureModifierData *amd = (ArmatureModifierData *)md;
  	if (amd->object != NULL) {
diff --cc source/blender/modifiers/intern/MOD_array.c
index 91501e539c0,053957d89e2..7a7a4c4bdad
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@@ -96,11 -102,38 +96,7 @@@ static void foreachObjectLink
  	walk(userData, ob, &amd->offset_ob, IDWALK_CB_NOP);
  }
  
- static void updateDepsgraph(ModifierData *md,
-                             struct Main *UNUSED(bmain),
-                             struct Scene *UNUSED(scene),
-                             Object *UNUSED(ob),
-                             struct DepsNodeHandle *node)
 -static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 -{
 -	ArrayModifierData *amd = (ArrayModifierData *) md;
 -
 -	if (amd->start_cap) {
 -		DagNode *curNode = dag_get_node(ctx->forest, amd->start_cap);
 -
 -		dag_add_relation(ctx->forest, curNode, ctx->obNode,
 -		                 DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier");
 -	}
 -	if (amd->end_cap) {
 -		DagNode *curNode = dag_get_node(ctx->forest, amd->end_cap);
 -
 -		dag_add_relation(ctx->forest, curNode, ctx->obNode,
 -		                 DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier");
 -	}
 -	if (amd->curve_ob) {
 -		DagNode *curNode = dag_get_node(ctx->forest, amd->curve_ob);
 -		curNode->eval_flags |= DAG_EVAL_NEED_CURVE_PATH;
 -
 -		dag_add_relation(ctx->forest, curNode, ctx->obNode,
 -		                 DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier");
 -	}
 -	if (amd->offset_ob) {
 -		DagNode *curNode = dag_get_node(ctx->forest, amd->offset_ob);
 -
 -		dag_add_relation(ctx->forest, curNode, ctx->obNode,
 -		                 DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier");
 -	}
 -}
 -
+ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
  {
  	ArrayModifierData *amd = (ArrayModifierData *)md;
  	if (amd->start_cap != NULL) {
diff --cc source/blender/modifiers/intern/MOD_boolean.c
index 7f79c941770,93c4d83870a..c9d762a7fbe
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@@ -95,11 -97,19 +95,7 @@@ static void foreachObjectLink
  	walk(userData, ob, &bmd->object, IDWALK_CB_NOP);
  }
  
- static void updateDepsgraph(ModifierData *md,
-                             struct Main *UNUSED(bmain),
-                             struct Scene *UNUSED(scene),
-                             Object *ob,
-                             struct DepsNodeHandle *node)
 -static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 -{
 -	BooleanModifierData *bmd = (BooleanModifierData *) md;
 -
 -	if (bmd->object) {
 -		DagNode *curNode = dag_get_node(ctx->forest, bmd->object);
 -
 -		dag_add_relation(ctx->forest, curNode, ctx->obNode,
 -		                 DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Boolean Modifier");
 -	}
 -}
 -
+ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
  {
  	BooleanModifierData *bmd = (BooleanModifierData *)md;
  	if (bmd->object != NULL) {
diff --cc source/blender/modifiers/intern/MOD_cast.c
index 93a5b9607bf,60465df0492..bf86377960a
--- a/source/blender/modifiers/intern/MOD_cast.c
+++ b/source/blender/modifiers/intern/MOD_cast.c
@@@ -102,11 -105,19 +102,7 @@@ static void foreachObjectLink
  	walk(userData, ob, &cmd->object, IDWALK_CB_NOP);
  }
  
- static void updateDepsgraph(ModifierData *md,
-                             struct Main *UNUSED(bmain),
-                             struct Scene *UNUSED(scene),
-                             Object *object,
-                             struct DepsNodeHandle *node)
 -static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 -{
 -	CastModifierData *cmd = (CastModifierData *) md;
 -
 -	if (cmd->object) {
 -		DagNode *curNode = dag_get_node(ctx->forest, cmd->object);
 -
 -		dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_OB_DATA,
 -		                 "Cast Modifier");
 -	}
 -}
 -
+ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
  {
  	CastModifierData *cmd = (CastModifierData *)md;
  	if (cmd->object != NULL) {
diff --cc source/blender/modifiers/intern/MOD_cloth.c
index b234cc63228,5f806ba4e4c..0c55d8f8beb
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@@ -114,18 -117,32 +114,14 @@@ static void deformVerts(ModifierData *m
  	dm->release(dm);
  }
  
- static void updateDepsgraph(ModifierData *md,
-                             struct Main *UNUSED(bmain),
-                             struct Scene *scene,
-                             Object *ob,
-                             struct DepsNodeHandle *node)
 -static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 -{
 -	ClothModifierData *clmd = (ClothModifierData *) md;
 -	
 -	if (clmd) {
 -		/* Actual code uses get_collisionobjects */
 -#ifdef WITH_LEGACY_DEPSGRAPH
 -		dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, clmd->coll_parms->group, ctx->object->lay|ctx->scene->lay, eModifierType_Collision, NULL, true, "Cloth Collision");
 -		dag_add_forcefield_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, clmd->sim_parms->effector_weights, true, 0, "Cloth Field");
 -#else
 -	(void)forest;
 -	(void)scene;
 -	(void)ob;
 -	(void)obNode;
 -#endif
 -	}
 -}
 -
+ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
  {
  	ClothModifierData *clmd = (ClothModifierData *)md;
  	if (clmd != NULL) {
  		/* Actual code uses get_collisionobjects */
- 		DEG_add_collision_relations(node, scene, ob, clmd->coll_parms->group, eModifierType_Collision, NULL, true, "Cloth Collision");
 -		DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, clmd->coll_parms->group, ctx->object->lay|ctx->scene->lay, eModifierType_Collision, NULL, true, "Cloth Collision");
++		DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, clmd->coll_parms->group, eModifierType_Collision, NULL, true, "Cloth Collision");
  
- 		DEG_add_forcefield_relations(node, scene, ob, clmd->sim_parms->effector_weights, true, 0, "Cloth Field");
+ 		DEG_add_forcefield_relations(ctx->node, ctx->scene, ctx->object, clmd->sim_parms->effector_weights, true, 0, "Cloth Field");
  	}
  }
  
diff --cc source/blender/modifiers/intern/MOD_curve.c
index 62c9f8796a0,7e16bf450fc..acb69de1e85
--- a/source/blender/modifiers/intern/MOD_curve.c
+++ b/source/blender/modifiers/intern/MOD_curve.c
@@@ -93,11 -92,20 +93,7 @@@ static void foreachObjectLink
  	walk(userData, ob, &cmd->object, I

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list