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
This commit is contained in:
2022-01-04 14:28:37 +03:00
parent 08aa7861d6
commit 7bcf21e66e
4 changed files with 52 additions and 5 deletions

View File

@@ -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));