From 2186d58d1c2711f722a811e6c2885045e485efa9 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 25 Oct 2022 11:51:04 +0200 Subject: Fix T102045: Properties Editor Attribute panels errors when pinning mesh When pinning a Mesh, we cannot rely on the context object. Instead, use the context mesh now. For vertexgroups names [which are still on the object API wise], this means name collisions cannot be checked when pinning a Mesh (so print this as a warning in that case) Maniphest Tasks: T102045 Differential Revision: https://developer.blender.org/D16333 --- release/scripts/startup/bl_ui/properties_data_mesh.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index a775a3cfa1b..a6b97fbdc85 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -586,7 +586,7 @@ class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel): def draw_attribute_warnings(self, context, layout): ob = context.object - mesh = ob.data + mesh = context.mesh unique_names = set() colliding_names = [] @@ -595,8 +595,11 @@ class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel): {"position": None, "shade_smooth": None, "normal": None, "crease": None}, mesh.attributes, mesh.uv_layers, - ob.vertex_groups, + None if ob is None else ob.vertex_groups, ): + if collection is None: + colliding_names.append("Cannot check for object vertex groups when pinning mesh") + continue for name in collection.keys(): unique_names_len = len(unique_names) unique_names.add(name) -- cgit v1.2.3