[Bf-blender-cvs] [05bcb2d5f55] blender2.8: Depsgraph: Fix missing relation from action to animation when it's shared

Sergey Sharybin noreply at git.blender.org
Wed Jun 27 16:35:12 CEST 2018


Commit: 05bcb2d5f55240edf2855176d98be697ab540254
Author: Sergey Sharybin
Date:   Wed Jun 27 14:36:37 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB05bcb2d5f55240edf2855176d98be697ab540254

Depsgraph: Fix missing relation from action to animation when it's shared

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

M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_nodes.h
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.h

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

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index cfb2f1bc8d6..cb455130d4c 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -749,19 +749,14 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
 	if (adt == NULL) {
 		return;
 	}
+	if (adt->action != NULL) {
+		build_action(adt->action);
+	}
 	/* animation */
 	if (adt->action || adt->nla_tracks.first || adt->drivers.first) {
 		(void) add_id_node(id);
 		ID *id_cow = get_cow_id(id);
 
-		if (adt->action != NULL &&
-		    !built_map_.checkIsBuiltAndTag(&adt->action->id))
-		{
-			add_operation_node(&adt->action->id, DEG_NODE_TYPE_ANIMATION,
-			                   NULL,
-			                   DEG_OPCODE_ANIMATION);
-		}
-
 		// XXX: Hook up specific update callbacks for special properties which
 		// may need it...
 
@@ -792,6 +787,17 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
 	}
 }
 
+void DepsgraphNodeBuilder::build_action(bAction *action)
+{
+	if (built_map_.checkIsBuiltAndTag(action)) {
+		return;
+	}
+	add_operation_node(&action->id,
+	                   DEG_NODE_TYPE_ANIMATION,
+	                   NULL,
+	                   DEG_OPCODE_ANIMATION);
+}
+
 /**
  * Build graph node(s) for Driver
  * \param id: ID-Block that driver is attached to
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
index 487b834bd07..6899a86b3e9 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
@@ -37,6 +37,7 @@
 
 struct Base;
 struct bArmature;
+struct bAction;
 struct CacheFile;
 struct Camera;
 struct bGPdata;
@@ -185,6 +186,7 @@ struct DepsgraphNodeBuilder {
 	void build_particle_settings(ParticleSettings *part);
 	void build_cloth(Object *object);
 	void build_animdata(ID *id);
+	void build_action(bAction *action);
 	void build_driver(ID *id, FCurve *fcurve, int driver_index);
 	void build_driver_variables(ID *id, FCurve *fcurve);
 	void build_driver_id_property(ID *id, const char *rna_path);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 06c17b19a8c..252f9a60a0e 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1032,6 +1032,9 @@ void DepsgraphRelationBuilder::build_animdata_curves(ID *id)
 	if (adt == NULL) {
 		return;
 	}
+	if (adt->action != NULL) {
+		build_action(adt->action);
+	}
 	if (adt->action == NULL && adt->nla_tracks.first == NULL) {
 		return;
 	}
@@ -1040,9 +1043,7 @@ void DepsgraphRelationBuilder::build_animdata_curves(ID *id)
 	TimeSourceKey time_src_key;
 	add_relation(time_src_key, adt_key, "TimeSrc -> Animation");
 	/* Relation from action itself. */
-	if (adt->action != NULL &&
-	    !built_map_.checkIsBuiltAndTag(&adt->action->id))
-	{
+	if (adt->action != NULL) {
 		ComponentKey action_key(&adt->action->id, DEG_NODE_TYPE_ANIMATION);
 		add_relation(action_key, adt_key, "Action -> Animation");
 	}
@@ -1204,6 +1205,13 @@ void DepsgraphRelationBuilder::build_animdata_drivers(ID *id)
 	}
 }
 
+void DepsgraphRelationBuilder::build_action(bAction *action)
+{
+	if (built_map_.checkIsBuiltAndTag(action)) {
+		return;
+	}
+}
+
 void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu)
 {
 	ChannelDriver *driver = fcu->driver;
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
index 9996e420663..d4f1271b217 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
@@ -50,6 +50,7 @@
 
 struct Base;
 struct bArmature;
+struct bAction;
 struct bGPdata;
 struct CacheFile;
 struct Camera;
@@ -231,6 +232,7 @@ struct DepsgraphRelationBuilder
 	                                     OperationDepsNode *operation_from,
 	                                     ListBase *strips);
 	void build_animdata_drivers(ID *id);
+	void build_action(bAction *action);
 	void build_driver(ID *id, FCurve *fcurve);
 	void build_driver_data(ID *id, FCurve *fcurve);
 	void build_driver_variables(ID *id, FCurve *fcurve);



More information about the Bf-blender-cvs mailing list