Fix T89734: incorrect dependency cycle with id property on modifier

Differential Revision: https://developer.blender.org/D11851
This commit is contained in:
Jacques Lucke 2021-07-14 11:25:15 +02:00
parent 271f34f77e
commit 192f0c9e17
4 changed files with 15 additions and 5 deletions

View File

@ -114,6 +114,7 @@
#include "SEQ_iterator.h"
#include "intern/builder/deg_builder.h"
#include "intern/builder/deg_builder_rna.h"
#include "intern/depsgraph.h"
#include "intern/depsgraph_tag.h"
#include "intern/depsgraph_type.h"
@ -1199,7 +1200,7 @@ void DepsgraphNodeBuilder::build_driver_id_property(ID *id, const char *rna_path
if (prop == nullptr) {
return;
}
if (!RNA_property_is_idprop(prop)) {
if (!rna_prop_affects_parameters_node(&ptr, prop)) {
return;
}
const char *prop_identifier = RNA_property_identifier((PropertyRNA *)prop);

View File

@ -1611,7 +1611,7 @@ void DepsgraphRelationBuilder::build_driver_data(ID *id, FCurve *fcu)
}
}
}
if (property_entry_key.prop != nullptr && RNA_property_is_idprop(property_entry_key.prop)) {
if (rna_prop_affects_parameters_node(&property_entry_key.ptr, property_entry_key.prop)) {
RNAPathKey property_exit_key(property_entry_key.id,
property_entry_key.ptr,
property_entry_key.prop,
@ -1714,7 +1714,7 @@ void DepsgraphRelationBuilder::build_driver_id_property(ID *id, const char *rna_
if (prop == nullptr) {
return;
}
if (!RNA_property_is_idprop(prop)) {
if (!rna_prop_affects_parameters_node(&ptr, prop)) {
return;
}
const char *prop_identifier = RNA_property_identifier((PropertyRNA *)prop);

View File

@ -180,8 +180,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr,
node_identifier.operation_name = "";
node_identifier.operation_name_tag = -1;
/* Handling of commonly known scenarios. */
if (prop != nullptr && RNA_property_is_idprop(prop) &&
!RNA_struct_is_a(ptr->type, &RNA_Modifier)) {
if (rna_prop_affects_parameters_node(ptr, prop)) {
node_identifier.type = NodeType::PARAMETERS;
node_identifier.operation_code = OperationCode::ID_PROPERTY;
node_identifier.operation_name = RNA_property_identifier(
@ -398,4 +397,12 @@ RNANodeQueryIDData *RNANodeQuery::ensure_id_data(const ID *id)
return id_data.get();
}
bool rna_prop_affects_parameters_node(const PointerRNA *ptr, const PropertyRNA *prop)
{
return prop != nullptr && RNA_property_is_idprop(prop) &&
/* ID properties in the geometry nodes modifier don't affect that parameters node. Instead
they affect the modifier and therefore the geometry node directly. */
!RNA_struct_is_a(ptr->type, &RNA_NodesModifier);
}
} // namespace blender::deg

View File

@ -108,5 +108,7 @@ class RNANodeQuery {
static bool contains(const char *prop_identifier, const char *rna_path_component);
};
bool rna_prop_affects_parameters_node(const PointerRNA *ptr, const PropertyRNA *prop);
} // namespace deg
} // namespace blender