Skip to content

Commit 201bb9b

Browse files
committed
fix: poll functions on panels: Rigify buttons/boneGroups/Layers/Type for meta only. AnimTools for rigs only
1 parent 9622d37 commit 201bb9b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ui.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DATA_PT_rigify_buttons(bpy.types.Panel):
4242

4343
@classmethod
4444
def poll(cls, context):
45-
return context.object.type == 'ARMATURE'
45+
return context.object.type == 'ARMATURE' and context.active_object.data.get("rig_id") is None
4646

4747
def draw(self, context):
4848
C = context
@@ -132,7 +132,6 @@ def draw(self, context):
132132
layout.label(text="Some bones have old legacy rigify_type. Click to upgrade", icon='ERROR')
133133
layout.operator("pose.rigify_upgrade_types", text="Upgrade Metarig")
134134

135-
136135
elif obj.mode == 'EDIT':
137136
# Build types list
138137
collection_name = str(id_store.rigify_collection).replace(" ", "")
@@ -169,7 +168,7 @@ class DATA_PT_rigify_layer_names(bpy.types.Panel):
169168

170169
@classmethod
171170
def poll(cls, context):
172-
return context.object.type == 'ARMATURE'
171+
return context.object.type == 'ARMATURE' and context.active_object.data.get("rig_id") is None
173172

174173
def draw(self, context):
175174
layout = self.layout
@@ -504,7 +503,7 @@ class DATA_PT_rigify_bone_groups(bpy.types.Panel):
504503

505504
@classmethod
506505
def poll(cls, context):
507-
return context.object.type == 'ARMATURE'
506+
return context.object.type == 'ARMATURE' and context.active_object.data.get("rig_id") is None
508507

509508
def draw(self, context):
510509
obj = context.object
@@ -550,7 +549,7 @@ def poll(cls, context):
550549
return False
551550
obj = context.object
552551
if obj:
553-
return obj.mode == 'POSE'
552+
return obj.mode == 'POSE' and context.active_object.data.get("rig_id") is None
554553
return False
555554

556555
def draw(self, context):
@@ -635,6 +634,10 @@ class VIEW3D_PT_rigify_animation_tools(bpy.types.Panel):
635634
bl_space_type = 'VIEW_3D'
636635
bl_region_type = 'TOOLS'
637636

637+
@classmethod
638+
def poll(cls, context):
639+
return context.object.type == 'ARMATURE' and context.active_object.data.get("rig_id") is not None
640+
638641
def draw(self, context):
639642
obj = context.active_object
640643
id_store = context.window_manager
@@ -1278,6 +1281,7 @@ def register():
12781281

12791282
rot_mode.register()
12801283

1284+
12811285
def unregister():
12821286

12831287
bpy.utils.unregister_class(DATA_OT_rigify_add_bone_groups)

0 commit comments

Comments
 (0)