From 27127bf533428c71e81afbad9947aa232523b7a9 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 22 Nov 2019 09:38:59 +0100 Subject: 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. --- source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index db7c1e5ceae..3e0ab9684da 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -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) -- cgit v1.2.3