Depsgraph: Cleanup, deduplicate as much as possible in build_driver
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 4 Dec 2017 17:08:29 +0000 (18:08 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 6 Dec 2017 09:21:33 +0000 (10:21 +0100)
source/blender/depsgraph/intern/builder/deg_builder_relations.cc

index 1f6d0f4ff567a61f66dd2f5550a69f620bf55cc3..df69c64f9aab68194f6becc3ee57fbf760c2df81 100644 (file)
@@ -966,18 +966,12 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu)
        /* Driver -> data components (for interleaved evaluation
         * bones/constraints/modifiers).
         */
-       // XXX: this probably should probably be moved out into a separate function.
-       if (strstr(rna_path, "pose.bones[") != NULL) {
-               RNAPathKey target_key(id, rna_path);
-               add_relation(driver_key, target_key, "Driver -> Target");
-       }
-       else if (GS(id->name) == ID_AR && strstr(rna_path, "bones[")) {
+       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.
                 */
                IDDepsNode *arm_node = graph_->find_id_node(id);
                char *bone_name = BLI_str_quoted_substrN(rna_path, "bones[");
-
                if (arm_node && bone_name) {
                        /* Find objects which use this, and make their eval callbacks
                         * depend on this.
@@ -1011,18 +1005,6 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu)
                                rna_path);
                }
        }
-       else if (GS(id->name) == ID_OB && strstr(rna_path, "modifiers[")) {
-               RNAPathKey target_key(id, rna_path);
-               add_relation(driver_key, target_key, "Driver -> Target");
-       }
-       else if (GS(id->name) == ID_KE && strstr(rna_path, "key_blocks[")) {
-               RNAPathKey target_key(id, rna_path);
-               add_relation(driver_key, target_key, "Driver -> Target");
-       }
-       else if (strstr(rna_path, "key_blocks[")) {
-               RNAPathKey target_key(id, rna_path);
-               add_relation(driver_key, target_key, "Driver -> Target");
-       }
        else {
                RNAPathKey target_key(id, rna_path);
                add_relation(driver_key, target_key, "Driver -> Target");