diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2022-01-04 14:28:37 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2022-01-06 16:43:18 +0300 |
commit | 7bcf21e66e2e46042b027b4481fa9866e64fe9a1 (patch) | |
tree | 5a17a9b8f75a5b1dafca849ddbb7b96c1ef7b480 /source/blender/depsgraph/intern/builder/deg_builder_rna.cc | |
parent | 08aa7861d6a4c2c9397833322f959fad4df4885f (diff) |
Depsgraph: fix spurious cycles with identically named idprops on bones.
If multiple bones have a custom property with the same name,
depsgraph didn't distinguish between them, potentially leading
to spurious cycles.
This patch moves ID_PROPERTY operation nodes for bone custom
properties from the parameters component to individual bone
components, thus decoupling them.
Differential Revision: https://developer.blender.org/D13729
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_rna.cc')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_rna.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc index 43d24125dc2..76a115a06c8 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc @@ -181,7 +181,15 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, node_identifier.operation_name_tag = -1; /* Handling of commonly known scenarios. */ if (rna_prop_affects_parameters_node(ptr, prop)) { - node_identifier.type = NodeType::PARAMETERS; + /* Custom properties of bones are placed in their components to improve granularity. */ + if (RNA_struct_is_a(ptr->type, &RNA_PoseBone)) { + const bPoseChannel *pchan = static_cast<const bPoseChannel *>(ptr->data); + node_identifier.type = NodeType::BONE; + node_identifier.component_name = pchan->name; + } + else { + node_identifier.type = NodeType::PARAMETERS; + } node_identifier.operation_code = OperationCode::ID_PROPERTY; node_identifier.operation_name = RNA_property_identifier( reinterpret_cast<const PropertyRNA *>(prop)); |