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:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-02-20 13:32:22 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-02-20 13:32:22 +0300
commite6bdc950d25ca9f57effaebe0d4505038901a610 (patch)
tree1a43f506293deadf1cb2edd28d1bcdef3778db1c
parentc57f1f3d2786ede19946ef77cd4d10e2b676dc0d (diff)
Fix T61689: Crash when having image and regular animation
Was caused by ambiguity in entry/exit operation for animation channel. Made those explicit now,
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.cc21
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc13
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_operation.cc4
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_operation.h4
4 files changed, 33 insertions, 9 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 47574902b0d..b88d90ca2d8 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -845,10 +845,21 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
(void) add_id_node(id);
ID *id_cow = get_cow_id(id);
if (adt->action != NULL || !BLI_listbase_is_empty(&adt->nla_tracks)) {
- add_operation_node(id, NodeType::ANIMATION,
- OperationCode::ANIMATION,
- function_bind(BKE_animsys_eval_animdata, _1, id_cow),
- id->name);
+ OperationNode *operation_node;
+ /* Explicit entry operation. */
+ operation_node = add_operation_node(
+ id, NodeType::ANIMATION, OperationCode::ANIMATION_ENTRY);
+ operation_node->set_as_entry();
+ /* All the evaluation nodes. */
+ add_operation_node(
+ id,
+ NodeType::ANIMATION,
+ OperationCode::ANIMATION_EVAL,
+ function_bind(BKE_animsys_eval_animdata, _1, id_cow));
+ /* Explicit exit operation. */
+ operation_node = add_operation_node(
+ id, NodeType::ANIMATION, OperationCode::ANIMATION_EXIT);
+ operation_node->set_as_exit();
}
/* NLA strips contain actions. */
LISTBASE_FOREACH (NlaTrack *, nlt, &adt->nla_tracks) {
@@ -894,7 +905,7 @@ void DepsgraphNodeBuilder::build_action(bAction *action)
return;
}
add_operation_node(
- &action->id, NodeType::ANIMATION, OperationCode::ANIMATION);
+ &action->id, NodeType::ANIMATION, OperationCode::ANIMATION_EVAL);
}
/**
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 9efa4d6bf16..b5ad391424b 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1217,10 +1217,19 @@ void DepsgraphRelationBuilder::build_animdata_curves(ID *id)
if (adt->action != NULL) {
build_action(adt->action);
}
- if (adt->action == NULL && adt->nla_tracks.first == NULL) {
+ if (adt->action == NULL && BLI_listbase_is_empty(&adt->nla_tracks)) {
return;
}
- /* Wire up dependency to time source. */
+ /* Ensure evaluation order from entry to exit. */
+ OperationKey animation_entry_key(
+ id, NodeType::ANIMATION, OperationCode::ANIMATION_ENTRY);
+ OperationKey animation_eval_key(
+ id, NodeType::ANIMATION, OperationCode::ANIMATION_EVAL);
+ OperationKey animation_exit_key(
+ id, NodeType::ANIMATION, OperationCode::ANIMATION_EXIT);
+ add_relation(animation_entry_key, animation_eval_key, "Init -> Eval");
+ add_relation(animation_eval_key, animation_exit_key, "Eval -> Exit");
+ /* Wire up dependency from action. */
ComponentKey adt_key(id, NodeType::ANIMATION);
/* Relation from action itself. */
if (adt->action != NULL) {
diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.cc b/source/blender/depsgraph/intern/node/deg_node_operation.cc
index 0d3ec70d22c..f852a32450d 100644
--- a/source/blender/depsgraph/intern/node/deg_node_operation.cc
+++ b/source/blender/depsgraph/intern/node/deg_node_operation.cc
@@ -43,7 +43,9 @@ const char *operationCodeAsString(OperationCode opcode)
case OperationCode::ID_PROPERTY: return "ID_PROPERTY";
case OperationCode::PARAMETERS_EVAL: return "PARAMETERS_EVAL";
/* Animation, Drivers, etc. */
- case OperationCode::ANIMATION: return "ANIMATION";
+ case OperationCode::ANIMATION_ENTRY: return "ANIMATION_ENTRY";
+ case OperationCode::ANIMATION_EVAL: return "ANIMATION_EVAL";
+ case OperationCode::ANIMATION_EXIT: return "ANIMATION_EXIT";
case OperationCode::DRIVER: return "DRIVER";
/* Scene related. */
case OperationCode::SCENE_EVAL: return "SCENE_EVAL";
diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.h b/source/blender/depsgraph/intern/node/deg_node_operation.h
index da823595705..8ec71d1829f 100644
--- a/source/blender/depsgraph/intern/node/deg_node_operation.h
+++ b/source/blender/depsgraph/intern/node/deg_node_operation.h
@@ -51,7 +51,9 @@ enum class OperationCode {
/* Animation, Drivers, etc. --------------------------------------------- */
/* NLA + Action */
- ANIMATION,
+ ANIMATION_ENTRY,
+ ANIMATION_EVAL,
+ ANIMATION_EXIT,
/* Driver */
DRIVER,