[Bf-blender-cvs] [2186d58d1c2] master: Fix T102045: Properties Editor Attribute panels errors when pinning mesh
Philipp Oeser
noreply at git.blender.org
Wed Oct 26 09:14:28 CEST 2022
Commit: 2186d58d1c2711f722a811e6c2885045e485efa9
Author: Philipp Oeser
Date: Tue Oct 25 11:51:04 2022 +0200
Branches: master
https://developer.blender.org/rB2186d58d1c2711f722a811e6c2885045e485efa9
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
===================================================================
M release/scripts/startup/bl_ui/properties_data_mesh.py
===================================================================
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)
More information about the Bf-blender-cvs
mailing list