[Bf-blender-cvs] [921cad194da] blender2.8: Depsgraph: add proper handling of actions contained in NLA strips.

Alexander Gavrilov noreply at git.blender.org
Wed Nov 7 16:28:58 CET 2018


Commit: 921cad194da34fac7c30c9d5d84ef93b020e6ff9
Author: Alexander Gavrilov
Date:   Wed Nov 7 18:14:00 2018 +0300
Branches: blender2.8
https://developer.blender.org/rB921cad194da34fac7c30c9d5d84ef93b020e6ff9

Depsgraph: add proper handling of actions contained in NLA strips.

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

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

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

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 9ae32eeb7de..f1af27ed11d 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -859,6 +859,11 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
 			 */
 		}
 
+		/* NLA strips contain actions */
+		LISTBASE_FOREACH (NlaTrack *, nlt, &adt->nla_tracks) {
+			build_animdata_nlastrip_targets(&nlt->strips);
+		}
+
 		/* drivers */
 		int driver_index = 0;
 		LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
@@ -868,6 +873,18 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
 	}
 }
 
+void DepsgraphNodeBuilder::build_animdata_nlastrip_targets(ListBase *strips)
+{
+	LISTBASE_FOREACH (NlaStrip *, strip, strips) {
+		if (strip->act != NULL) {
+			build_action(strip->act);
+		}
+		else if (strip->strips.first != NULL) {
+			build_animdata_nlastrip_targets(&strip->strips);
+		}
+	}
+}
+
 void DepsgraphNodeBuilder::build_action(bAction *action)
 {
 	if (built_map_.checkIsBuiltAndTag(action)) {
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
index 47324968776..b826a2979cc 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
@@ -192,6 +192,7 @@ struct DepsgraphNodeBuilder {
 	void build_particle_settings(ParticleSettings *part);
 	void build_cloth(Object *object);
 	void build_animdata(ID *id);
+	void build_animdata_nlastrip_targets(ListBase *strips);
 	void build_action(bAction *action);
 	void build_driver(ID *id, FCurve *fcurve, int driver_index);
 	void build_driver_variables(ID *id, FCurve *fcurve);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 31c16f013f9..0c17aa1f58d 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1192,6 +1192,11 @@ void DepsgraphRelationBuilder::build_animdata_nlastrip_targets(
 {
 	LISTBASE_FOREACH(NlaStrip *, strip, strips) {
 		if (strip->act != NULL) {
+			build_action(strip->act);
+
+			ComponentKey action_key(&strip->act->id, DEG_NODE_TYPE_ANIMATION);
+			add_relation(action_key, adt_key, "Action -> Animation");
+
 			build_animdata_curves_targets(id, adt_key,
 			                              operation_from,
 			                              &strip->act->curves);



More information about the Bf-blender-cvs mailing list