diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-09-14 09:19:39 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-09-14 09:30:01 +0300 |
commit | d43b2ca4a9f31a9a3f988473a65de2095c9cfcc8 (patch) | |
tree | e31bbcb7dad24555af5992c448b9171dcba22258 /rigify/ui.py | |
parent | 8b1df843703fdb51ffa5758625c117c4f10bc6dd (diff) |
Rigify: only show the Rigify Animation Tools panel for old rigs.
New rigs provide the same buttons in their generated script UI,
and aren't compatible with the old panel code. To distinguish
rigs, remove old snap operators from the script.
Differential Revision: https://developer.blender.org/D4624
Diffstat (limited to 'rigify/ui.py')
-rw-r--r-- | rigify/ui.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/rigify/ui.py b/rigify/ui.py index c0b827b1..2f858925 100644 --- a/rigify/ui.py +++ b/rigify/ui.py @@ -670,8 +670,15 @@ class VIEW3D_PT_rigify_animation_tools(bpy.types.Panel): @classmethod def poll(cls, context): - return context.object and context.object.type == 'ARMATURE'\ - and context.active_object.data.get("rig_id") is not None + obj = context.active_object + if obj and obj.type == 'ARMATURE': + rig_id = obj.data.get("rig_id") + if rig_id is not None: + has_arm = hasattr(bpy.types, 'POSE_OT_rigify_arm_ik2fk_' + rig_id) + has_leg = hasattr(bpy.types, 'POSE_OT_rigify_leg_ik2fk_' + rig_id) + return has_arm or has_leg + + return False def draw(self, context): obj = context.active_object |