Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-11-07 18:14:00 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-11-07 18:17:30 +0300
commit921cad194da34fac7c30c9d5d84ef93b020e6ff9 (patch)
tree5e4ab51a38a4ae23ae3859727a3db93a1d571e4c
parentb82eac89861ee9e67df27dc2fa396352dbb6918d (diff)
Depsgraph: add proper handling of actions contained in NLA strips.
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.cc17
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.h1
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc5
3 files changed, 23 insertions, 0 deletions
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);