[Bf-extensions-cvs] [bfb29776] blender2.8: Rigify: Update for 2.8 API

Dalai Felinto noreply at git.blender.org
Mon Oct 22 15:43:07 CEST 2018


Commit: bfb29776393325f2195177fe2edffdcd3668c143
Author: Dalai Felinto
Date:   Mon Oct 22 13:39:01 2018 +0000
Branches: blender2.8
https://developer.blender.org/rBAbfb29776393325f2195177fe2edffdcd3668c143

Rigify: Update for 2.8 API

The UI is still using the toolshelf. So I did not bump the version to 2.80.
It seems to be working as far as the UI and the quat/euler operators is concerned.

===================================================================

M	rigify/__init__.py
M	rigify/legacy/ui.py
M	rigify/metarig_menu.py
M	rigify/rot_mode.py
M	rigify/ui.py

===================================================================

diff --git a/rigify/__init__.py b/rigify/__init__.py
index f0a332f8..f4504c79 100644
--- a/rigify/__init__.py
+++ b/rigify/__init__.py
@@ -150,18 +150,18 @@ class RigifyPreferences(AddonPreferences):
         op = sub.operator('wm.context_toggle', text='', icon=icon,
                           emboss=False)
         op.data_path = 'addon_prefs.show_expanded'
-        sub.label('{}: {}'.format('Rigify', 'Enable Legacy Mode'))
+        sub.label(text='{}: {}'.format('Rigify', 'Enable Legacy Mode'))
         sub = row.row()
         sub.alignment = 'RIGHT'
         sub.prop(self, 'legacy_mode')
 
         if expand:
-            split = col.row().split(percentage=0.15)
-            split.label('Description:')
+            split = col.row().split(factor=0.15)
+            split.label(text='Description:')
             split.label(text='When enabled the add-on will run in legacy mode using the old 2.76b feature set.')
 
         row = layout.row()
-        row.label("End of Rigify Preferences")
+        row.label(text="End of Rigify Preferences")
 
 
 class RigifyName(bpy.types.PropertyGroup):
diff --git a/rigify/legacy/ui.py b/rigify/legacy/ui.py
index 30018d85..2671108b 100644
--- a/rigify/legacy/ui.py
+++ b/rigify/legacy/ui.py
@@ -124,7 +124,7 @@ class DATA_PT_rigify_layer_names(bpy.types.Panel):
                 col = layout.column(align=True)
             row = col.row()
             row.prop(arm, "layers", index=i, text="", toggle=True)
-            split = row.split(percentage=0.8)
+            split = row.split(factor=0.8)
             split.prop(rigify_layer, "name",  text="Layer %d" % (i + 1))
             split.prop(rigify_layer, "row",   text="")
 
diff --git a/rigify/metarig_menu.py b/rigify/metarig_menu.py
index c1610553..102d366d 100644
--- a/rigify/metarig_menu.py
+++ b/rigify/metarig_menu.py
@@ -31,7 +31,7 @@ class ArmatureSubMenu(bpy.types.Menu):
 
     def draw(self, context):
         layout = self.layout
-        layout.label(self.bl_label)
+        layout.label(text=self.bl_label)
         for op, name in self.operators:
             text = capwords(name.replace("_", " ")) + " (Meta-Rig)"
             layout.operator(op, icon='OUTLINER_OB_ARMATURE', text=text)
diff --git a/rigify/rot_mode.py b/rigify/rot_mode.py
index f486db6b..8129040b 100644
--- a/rigify/rot_mode.py
+++ b/rigify/rot_mode.py
@@ -43,8 +43,6 @@ from bpy.props import (
     EnumProperty,
 )
 
-order_list = ['QUATERNION', 'XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX']
-
 
 class convert():
     def get_or_create_fcurve(self, action, data_path, array_index=-1, group=None):
@@ -223,28 +221,6 @@ class convert():
 convert = convert()
 
 
-# def initSceneProperties(scn):
-#
-# 	bpy.types.Scene.order_list = bpy.props.EnumProperty(
-# 	items = [('QUATERNION', 'QUATERNION', 'QUATERNION' ),
-# 	('XYZ', 'XYZ', 'XYZ' ),
-# 	('XZY', 'XZY', 'XZY' ),
-# 	('YXZ', 'YXZ', 'YXZ' ),
-# 	('YZX', 'YZX', 'YZX' ),
-# 	('ZXY', 'ZXY', 'ZXY' ),
-# 	('ZYX', 'ZYX', 'ZYX' ) ],
-# 	name = "Order",
-# 	description = "The target rotation mode")
-#
-# 	scn['order_list'] = 0
-#
-# 	return
-#
-# initSceneProperties(bpy.context.scene)
-
-
-# GUI (Panel)
-#
 class ToolsPanel(bpy.types.Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'TOOLS'
@@ -294,7 +270,7 @@ class CONVERT_OT_quat2eu_current_action(bpy.types.Operator):
         obj = bpy.context.active_object
         pose_bones = bpy.context.selected_pose_bones
         action = obj.animation_data.action
-        order = order_list[bpy.context.scene['order_list']]
+        order = bpy.context.scene.order_list
         id_store = context.window_manager
 
         if id_store.rigify_convert_only_selected:
@@ -319,7 +295,7 @@ class CONVERT_OT_quat2eu_all_actions(bpy.types.Operator):
     def execute(op, context):
         obj = bpy.context.active_object
         pose_bones = bpy.context.selected_pose_bones
-        order = order_list[bpy.context.scene['order_list']]
+        order = bpy.context.scene.order_list
         id_store = context.window_manager
 
         if id_store.rigify_convert_only_selected:
diff --git a/rigify/ui.py b/rigify/ui.py
index c8a7e98a..249512f9 100644
--- a/rigify/ui.py
+++ b/rigify/ui.py
@@ -95,7 +95,7 @@ class DATA_PT_rigify_buttons(bpy.types.Panel):
             if show_update_metarig:
 
                 layout.label(text="This metarig contains old rig-types that can be automatically upgraded to benefit of rigify's new features.", icon='ERROR')
-                layout.label(text= "To use it as-is you need to enable legacy mode.",)
+                layout.label(text="To use it as-is you need to enable legacy mode.",)
                 layout.operator("pose.rigify_upgrade_types", text="Upgrade Metarig")
 
             row = layout.row()
@@ -117,7 +117,7 @@ class DATA_PT_rigify_buttons(bpy.types.Panel):
                 row = col.row(align=True)
                 row.prop(id_store, "rigify_generate_mode", expand=True)
 
-                main_row = col.row(align=True).split(percentage=0.3)
+                main_row = col.row(align=True).split(factor=0.3)
                 col1 = main_row.column()
                 col2 = main_row.column()
                 col1.label(text="Rig Name")
@@ -221,7 +221,7 @@ class DATA_PT_rigify_layer_names(bpy.types.Panel):
         for i in range(32):
             if i == 16 or i == 29:
                 col1.label()
-            col1.label(str(i+1) + '.')
+            col1.label(text=str(i+1) + '.')
 
         for i, rigify_layer in enumerate(arm.rigify_layers):
             # note: rigify_layer == arm.rigify_layers[i]
@@ -499,9 +499,9 @@ class DATA_OT_rigify_bone_group_remove_all(bpy.types.Operator):
 class DATA_UL_rigify_bone_groups(bpy.types.UIList):
     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
         row = layout.row(align=True)
-        row = row.split(percentage=0.1)
+        row = row.split(factor=0.1)
         row.label(text=str(index+1))
-        row = row.split(percentage=0.7)
+        row = row.split(factor=0.7)
         row.prop(item, "name", text='', emboss=False)
         row = row.row(align=True)
         icon = 'LOCKED' if item.standard_colors_lock else 'UNLOCKED'



More information about the Bf-extensions-cvs mailing list