Fix T61689: Crash when having image and regular animation

Was caused by ambiguity in entry/exit operation for animation channel.
Made those explicit now,
This commit is contained in:
Sergey Sharybin 2019-02-20 11:32:22 +01:00
parent c57f1f3d27
commit e6bdc950d2
Notes: blender-bot 2023-02-14 05:28:01 +01:00
Referenced by issue #61689, Blender 2.80 crashes when adding keyframe to Fac in compositing node editor
4 changed files with 33 additions and 9 deletions

View File

@ -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);
}
/**

View File

@ -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) {

View File

@ -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";

View File

@ -51,7 +51,9 @@ enum class OperationCode {
/* Animation, Drivers, etc. --------------------------------------------- */
/* NLA + Action */
ANIMATION,
ANIMATION_ENTRY,
ANIMATION_EVAL,
ANIMATION_EXIT,
/* Driver */
DRIVER,