Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
| Show First 20 Lines • Show All 1,687 Lines • ▼ Show 20 Lines | DRIVER_TARGETS_USED_LOOPER_BEGIN (dvar) { | ||||
| if (RNA_pointer_is_null(&variable_exit_key.ptr)) { | if (RNA_pointer_is_null(&variable_exit_key.ptr)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| if (is_same_bone_dependency(variable_exit_key, self_key) || | if (is_same_bone_dependency(variable_exit_key, self_key) || | ||||
| is_same_nodetree_node_dependency(variable_exit_key, self_key)) { | is_same_nodetree_node_dependency(variable_exit_key, self_key)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| add_relation(variable_exit_key, driver_key, "RNA Target -> Driver"); | add_relation(variable_exit_key, driver_key, "RNA Target -> Driver"); | ||||
| /* The RNA getter for `object.data` can write to the mesh datablock due | |||||
| * to the call to `BKE_mesh_wrapper_ensure_subdivision()`. This relation | |||||
| * ensures it is safe to call when the driver is evaluated. | |||||
| * | |||||
| * For the sake of making the code more generic/defensive, the relation | |||||
| * is added for any geometry type. | |||||
| * | |||||
| * See T96289 for more info. */ | |||||
| if (object != nullptr && OB_TYPE_IS_GEOMETRY(object->type)) { | |||||
| StringRef rna_path(dtar->rna_path); | |||||
| if (rna_path == "data" || rna_path.startswith("data.")) { | |||||
| ComponentKey ob_key(target_id, NodeType::GEOMETRY); | |||||
| add_relation(ob_key, driver_key, "ID -> Driver"); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| else { | else { | ||||
| /* If rna_path is nullptr, and DTAR_FLAG_STRUCT_REF isn't set, this | /* If rna_path is nullptr, and DTAR_FLAG_STRUCT_REF isn't set, this | ||||
| * is an incomplete target reference, so nothing to do here. */ | * is an incomplete target reference, so nothing to do here. */ | ||||
| } | } | ||||
| } | } | ||||
| DRIVER_TARGETS_LOOPER_END; | DRIVER_TARGETS_LOOPER_END; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,382 Lines • Show Last 20 Lines | |||||