Fix T59734: cyclic dependency with drivers on PoseBone.bbone_*.
authorAlexander Gavrilov <angavrilov@gmail.com>
Fri, 21 Dec 2018 19:35:19 +0000 (22:35 +0300)
committerAlexander Gavrilov <angavrilov@gmail.com>
Fri, 21 Dec 2018 20:10:16 +0000 (23:10 +0300)
Allow more flexible use of drivers on B-Bone properties by
connecting the dependencies to the actual operation node that
uses the values, instead of the whole component.

source/blender/depsgraph/intern/depsgraph.cc

index f3f4d788da2c7b0f356b5728f70e1d1e7b9c4735..006e246e2875f7aa0969e645ee6a784f5ae1f33a 100644 (file)
@@ -150,6 +150,11 @@ static bool pointer_to_component_node_criteria(
                        /* Bone - generally, we just want the bone component. */
                        *type = DEG_NODE_TYPE_BONE;
                        *subdata = pchan->name;
+                       /* But B-Bone properties should connect to the actual operation. */
+                       if (!ELEM(NULL, pchan->bone, prop) && pchan->bone->segments > 1 &&
+                           STRPREFIX(RNA_property_identifier(prop), "bbone_")) {
+                               *operation_code = DEG_OPCODE_BONE_SEGMENTS;
+                       }
                }
                return true;
        }