From c3a34d766592bf9905642f04a32eada758a6cbb5 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Fri, 1 Dec 2023 13:21:44 +0100 Subject: [PATCH] Fix #115276: Vertex group canvas picker errors with no active group While in weight paint mode, `ob.vertex_groups.active` can be None. This happens when selecting a non-deforming bone, or a deforming bone that doesn't have a group yet. Now check for this. --- scripts/startup/bl_ui/space_view3d_toolbar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/startup/bl_ui/space_view3d_toolbar.py b/scripts/startup/bl_ui/space_view3d_toolbar.py index cbfc7a43643..e25bb7d60cb 100644 --- a/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -679,8 +679,9 @@ class VIEW3D_PT_slots_vertex_groups(Panel): def draw_header(self, context): ob = context.object + groups = ob.vertex_groups self.bl_label = ( - iface_("%s") % (ob.vertex_groups.active.name) if ob.vertex_groups else + iface_("%s") % (groups.active.name) if groups and groups.active else iface_("Vertex Groups") ) -- 2.30.2