diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-04 20:11:43 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-06 12:21:33 +0300 |
commit | b5a8d0acaf86f3767b2ec9e6e9ccc7d859dc67b9 (patch) | |
tree | b83af32833ea5520a2a2204f6f3c01d796dbd2cf /source/blender | |
parent | 3e9cd536872c76c291774470addeb12a4e564a34 (diff) |
Depsgraph: Cleanup, split driver builder function
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 38 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.h | 1 |
2 files changed, 25 insertions, 14 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index df69c64f9aa..522ed9956ca 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -961,11 +961,33 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) DEG_OPCODE_DRIVER, fcu->rna_path ? fcu->rna_path : "", fcu->array_index); - const char *rna_path = fcu->rna_path ? fcu->rna_path : ""; - const RNAPathKey self_key(id, rna_path); /* Driver -> data components (for interleaved evaluation * bones/constraints/modifiers). */ + build_driver_data(id, fcu); + /* Loop over variables to get the target relationships. */ + build_driver_variables(id, fcu); + /* It's quite tricky to detect if the driver actually depends on time or + * not, so for now we'll be quite conservative here about optimization and + * consider all python drivers to be depending on time. + */ + if ((driver->type == DRIVER_TYPE_PYTHON) && + python_driver_depends_on_time(driver)) + { + TimeSourceKey time_src_key; + add_relation(time_src_key, driver_key, "TimeSrc -> Driver"); + } +} + +void DepsgraphRelationBuilder::build_driver_data(ID *id, FCurve *fcu) +{ + OperationKey driver_key(id, + DEG_NODE_TYPE_PARAMETERS, + DEG_OPCODE_DRIVER, + fcu->rna_path ? fcu->rna_path : "", + fcu->array_index); + const char *rna_path = fcu->rna_path ? fcu->rna_path : ""; + const RNAPathKey self_key(id, rna_path); if (GS(id->name) == ID_AR && strstr(rna_path, "bones[")) { /* Drivers on armature-level bone settings (i.e. bbone stuff), * which will affect the evaluation of corresponding pose bones. @@ -1009,18 +1031,6 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu) RNAPathKey target_key(id, rna_path); add_relation(driver_key, target_key, "Driver -> Target"); } - /* Loop over variables to get the target relationships. */ - build_driver_variables(id, fcu); - /* It's quite tricky to detect if the driver actually depends on time or - * not, so for now we'll be quite conservative here about optimization and - * consider all python drivers to be depending on time. - */ - if ((driver->type == DRIVER_TYPE_PYTHON) && - python_driver_depends_on_time(driver)) - { - TimeSourceKey time_src_key; - add_relation(time_src_key, driver_key, "TimeSrc -> Driver"); - } } void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu) diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index 7aadf197c7b..1cf2f9847e2 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -198,6 +198,7 @@ struct DepsgraphRelationBuilder RootPChanMap *root_map); void build_animdata(ID *id); void build_driver(ID *id, FCurve *fcurve); + void build_driver_data(ID *id, FCurve *fcurve); void build_driver_variables(ID *id, FCurve *fcurve); void build_world(World *world); void build_rigidbody(Scene *scene); |