Depsgraph: Ignore action time dependency if it's not needed

It is possible to have action which is not nullptr but which have no
f-curves in it (for example, animate cube's location, then delete all
f-curves).

Such situation should not add time dependency as it could slow down
scene evaluation on frame change.
This commit is contained in:
Sergey Sharybin 2019-11-22 09:38:59 +01:00
parent 2a38b857f7
commit 27127bf533
1 changed files with 5 additions and 3 deletions

View File

@ -1403,9 +1403,11 @@ void DepsgraphRelationBuilder::build_action(bAction *action)
if (built_map_.checkIsBuiltAndTag(action)) {
return;
}
TimeSourceKey time_src_key;
ComponentKey animation_key(&action->id, NodeType::ANIMATION);
add_relation(time_src_key, animation_key, "TimeSrc -> Animation");
if (!BLI_listbase_is_empty(&action->curves)) {
TimeSourceKey time_src_key;
ComponentKey animation_key(&action->id, NodeType::ANIMATION);
add_relation(time_src_key, animation_key, "TimeSrc -> Animation");
}
}
void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu)