diff options
author | Lucio Rossi <lucio.rossi75@gmail.com> | 2017-05-14 19:30:06 +0300 |
---|---|---|
committer | Lucio Rossi <lucio.rossi75@gmail.com> | 2017-05-14 19:30:06 +0300 |
commit | f36789d8bc728bc7ec3c9738f1ca76e8f017ce7a (patch) | |
tree | b21bf3b259ee87b4eafb1503936b15bee38be1ca /rigify/ui.py | |
parent | 8e68bf2879d81780e51dbdc3481bb486e7430e74 (diff) |
Rigify 0.5 with legacy mode
Diffstat (limited to 'rigify/ui.py')
-rw-r--r-- | rigify/ui.py | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/rigify/ui.py b/rigify/ui.py index dec5b73c..68991105 100644 --- a/rigify/ui.py +++ b/rigify/ui.py @@ -36,13 +36,7 @@ class DATA_PT_rigify_buttons(bpy.types.Panel): @classmethod def poll(cls, context): - if not context.armature: - return False - #obj = context.object - #if obj: - # return (obj.mode in {'POSE', 'OBJECT', 'EDIT'}) - #return False - return True + return context.object.type == 'ARMATURE' def draw(self, context): C = context @@ -52,6 +46,21 @@ class DATA_PT_rigify_buttons(bpy.types.Panel): if obj.mode in {'POSE', 'OBJECT'}: layout.operator("pose.rigify_generate", text="Generate") + WARNING = "Warning: Some features may change after generation" + show_warning = False + + check_props = ['IK_follow', 'root/parent', 'FK_limb_follow', 'IK_Stretch'] + for obj in bpy.data.objects: + if type(obj.data) != bpy.types.Armature: + continue + for bone in obj.pose.bones: + if bone.bone.layers[30] and (list(set(bone.keys()) & set(check_props))): + show_warning = True + break + + if show_warning: + layout.label(text=WARNING, icon='ERROR') + elif obj.mode == 'EDIT': # Build types list collection_name = str(id_store.rigify_collection).replace(" ", "") @@ -92,9 +101,7 @@ class DATA_PT_rigify_layer_names(bpy.types.Panel): @classmethod def poll(cls, context): - if not context.armature: - return False - return True + return context.object.type == 'ARMATURE' def draw(self, context): layout = self.layout @@ -161,6 +168,9 @@ class BONE_PT_rigify_buttons(bpy.types.Panel): id_store.rigify_types.remove(0) for r in rig_lists.rig_list: + rig = get_rig_type(r) + if hasattr(rig, 'IMPLEMENTATION') and rig.IMPLEMENTATION: + continue # collection = r.split('.')[0] # UNUSED if collection_name == "All": a = id_store.rigify_types.add() @@ -204,10 +214,6 @@ class VIEW3D_PT_tools_rigify_dev(bpy.types.Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'TOOLS' - @classmethod - def poll(cls, context): - return context.active_object is not None and context.mode in {'EDIT_ARMATURE','EDIT_MESH'} - def draw(self, context): obj = context.active_object if obj is not None: |