diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-20 13:18:38 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-20 13:18:38 +0300 |
commit | c57f1f3d2786ede19946ef77cd4d10e2b676dc0d (patch) | |
tree | 94178ac842fc6bd1815aa32f2318aa92ae289d3b /source/blender/depsgraph | |
parent | db5db0bfc26b9c28d8606ff76448a413f9bb132b (diff) |
Depsgraph: Simplify creation of animation nodes
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 54 |
1 files changed, 20 insertions, 34 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 68e01536aba..47574902b0d 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -831,8 +831,9 @@ void DepsgraphNodeBuilder::build_object_pointcache(Object *object) */ void DepsgraphNodeBuilder::build_animdata(ID *id) { + /* Special handling for animated images/sequences. */ build_animation_images(id); - + /* Regular animation. */ AnimData *adt = BKE_animdata_from_id(id); if (adt == NULL) { return; @@ -840,39 +841,24 @@ void DepsgraphNodeBuilder::build_animdata(ID *id) if (adt->action != NULL) { build_action(adt->action); } - /* animation */ - if (adt->action || adt->nla_tracks.first || adt->drivers.first) { - (void) add_id_node(id); - ID *id_cow = get_cow_id(id); - - // XXX: Hook up specific update callbacks for special properties which - // may need it... - - /* actions and NLA - as a single unit for now, as it gets complicated to - * schedule otherwise. */ - if ((adt->action) || (adt->nla_tracks.first)) { - /* create the node */ - add_operation_node( - id, NodeType::ANIMATION, - OperationCode::ANIMATION, - function_bind(BKE_animsys_eval_animdata, _1, id_cow), - id->name); - /* TODO: for each channel affected, we might also want to add some - * support for running RNA update callbacks on them - * (which will be needed for proper handling of drivers later) */ - } - - /* 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) { - /* create driver */ - build_driver(id, fcu, driver_index++); - } + /* Make sure ID node exists. */ + (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); + } + /* 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) { + /* create driver */ + build_driver(id, fcu, driver_index++); } } |