diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2022-05-16 19:17:37 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-05-16 19:17:37 +0300 |
commit | 4be79da9a73627b8f8666503e1610090b28b96a8 (patch) | |
tree | 650cfe337b736e70f3c72982ba608e342aca714e | |
parent | b8c30fb80a24ba87a7443364a1737ae636fbf6bf (diff) | |
parent | a2dacefb46363cac5abd7d0d5dcbf9ff2764bef7 (diff) |
Merge remote-tracking branch 'origin/blender-v3.2-release'
-rw-r--r-- | release/scripts/startup/bl_ui/space_node.py | 29 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 16 |
2 files changed, 32 insertions, 13 deletions
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index e105b07ec53..813a799db24 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -727,7 +727,20 @@ class NODE_UL_interface_sockets(bpy.types.UIList): layout.template_node_socket(color=color) -class NodeTreeInterfacePanel: +class NodeTreeInterfacePanel(Panel): + + @classmethod + def poll(cls, context): + snode = context.space_data + if snode is None: + return False + tree = snode.edit_tree + if tree is None: + return False + if tree.is_embedded_data: + return False + return True + def draw_socket_list(self, context, in_out, sockets_propname, active_socket_propname): layout = self.layout @@ -804,32 +817,22 @@ class NodeTreeInterfacePanel: active_socket.draw(context, layout) -class NODE_PT_node_tree_interface_inputs(NodeTreeInterfacePanel, Panel): +class NODE_PT_node_tree_interface_inputs(NodeTreeInterfacePanel): bl_space_type = 'NODE_EDITOR' bl_region_type = 'UI' bl_category = "Group" bl_label = "Inputs" - @classmethod - def poll(cls, context): - snode = context.space_data - return snode.edit_tree is not None - def draw(self, context): self.draw_socket_list(context, "IN", "inputs", "active_input") -class NODE_PT_node_tree_interface_outputs(NodeTreeInterfacePanel, Panel): +class NODE_PT_node_tree_interface_outputs(NodeTreeInterfacePanel): bl_space_type = 'NODE_EDITOR' bl_region_type = 'UI' bl_category = "Group" bl_label = "Outputs" - @classmethod - def poll(cls, context): - snode = context.space_data - return snode.edit_tree is not None - def draw(self, context): self.draw_socket_list(context, "OUT", "outputs", "active_output") diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 23147b63e27..5eccb5a4eb2 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1693,6 +1693,22 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu) continue; } 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 { /* If rna_path is nullptr, and DTAR_FLAG_STRUCT_REF isn't set, this |