[Bf-extensions-cvs] [2315351d] blender2.8: View3D pie menus: Updates to recent API changes and renames

Sergey Sharybin noreply at git.blender.org
Fri Sep 7 11:16:38 CEST 2018


Commit: 2315351d2ebf06987ccb194ebe1ea8fb06e671cd
Author: Sergey Sharybin
Date:   Fri Sep 7 11:16:07 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBA2315351d2ebf06987ccb194ebe1ea8fb06e671cd

View3D pie menus: Updates to recent API changes and renames

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

M	space_view3d_pie_menus/__init__.py
M	space_view3d_pie_menus/pie_align_menu.py
M	space_view3d_pie_menus/pie_apply_transform_menu.py
M	space_view3d_pie_menus/pie_editor_switch_menu.py
M	space_view3d_pie_menus/pie_manipulator_menu.py
M	space_view3d_pie_menus/pie_modes_menu.py
M	space_view3d_pie_menus/pie_orientation_menu.py
M	space_view3d_pie_menus/pie_snap_menu.py

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

diff --git a/space_view3d_pie_menus/__init__.py b/space_view3d_pie_menus/__init__.py
index 0e50cbcd..e725995f 100644
--- a/space_view3d_pie_menus/__init__.py
+++ b/space_view3d_pie_menus/__init__.py
@@ -164,17 +164,17 @@ class PieToolsPreferences(AddonPreferences):
 
     def draw(self, context):
         layout = self.layout
-        split = layout.split(percentage=0.5, align=True)
+        split = layout.split(factor=0.5, align=True)
         row = split.row()
         row.alignment = "LEFT"
         sub_box = row.box()
         sub_box.prop(self, "enable_all", emboss=False,
                     icon="VISIBLE_IPO_ON", icon_only=True)
-        row.label("Enable All")
+        row.label(text="Enable All")
 
         row = split.row()
         row.alignment = "RIGHT"
-        row.label("Disable All")
+        row.label(text="Disable All")
         sub_box = row.box()
         sub_box.prop(self, "disable_all", emboss=False,
                     icon="VISIBLE_IPO_OFF", icon_only=True)
@@ -195,42 +195,42 @@ class PieToolsPreferences(AddonPreferences):
             op = sub.operator('wm.context_toggle', text='', icon=icon,
                               emboss=False)
             op.data_path = 'addon_prefs.show_expanded_' + mod_name
-            sub.label('{}: {}'.format(info['category'], info['name']))
+            sub.label(text='{}: {}'.format(info['category'], info['name']))
             sub = row.row()
             sub.alignment = 'RIGHT'
             if info.get('warning'):
-                sub.label('', icon='ERROR')
+                sub.label(text='', icon='ERROR')
             sub.prop(self, 'use_' + mod_name, text='')
 
             # The second stage
             if expand:
                 if info.get('description'):
-                    split = col.row().split(percentage=0.15)
-                    split.label('Description:')
-                    split.label(info['description'])
+                    split = col.row().split(factor=0.15)
+                    split.label(text='Description:')
+                    split.label(text=info['description'])
                 if info.get('location'):
-                    split = col.row().split(percentage=0.15)
-                    split.label('Location:')
-                    split.label(info['location'])
+                    split = col.row().split(factor=0.15)
+                    split.label(text='Location:')
+                    split.label(text=info['location'])
                 """
                 if info.get('author'):
-                    split = col.row().split(percentage=0.15)
-                    split.label('Author:')
+                    split = col.row().split(factor=0.15)
+                    split.label(text='Author:')
                     split.label(info['author'])
                 """
                 if info.get('version'):
-                    split = col.row().split(percentage=0.15)
-                    split.label('Version:')
-                    split.label('.'.join(str(x) for x in info['version']),
+                    split = col.row().split(factor=0.15)
+                    split.label(text='Version:')
+                    split.label(text='.'.join(str(x) for x in info['version']),
                                 translate=False)
                 if info.get('warning'):
-                    split = col.row().split(percentage=0.15)
-                    split.label('Warning:')
-                    split.label('  ' + info['warning'], icon='ERROR')
+                    split = col.row().split(factor=0.15)
+                    split.label(text='Warning:')
+                    split.label(text='  ' + info['warning'], icon='ERROR')
 
                 tot_row = int(bool(info.get('wiki_url')))
                 if tot_row:
-                    split = col.row().split(percentage=0.15)
+                    split = col.row().split(factor=0.15)
                     split.label(text='Internet:')
                     if info.get('wiki_url'):
                         op = split.operator('wm.url_open',
diff --git a/space_view3d_pie_menus/pie_align_menu.py b/space_view3d_pie_menus/pie_align_menu.py
index c8ce2e15..39315137 100644
--- a/space_view3d_pie_menus/pie_align_menu.py
+++ b/space_view3d_pie_menus/pie_align_menu.py
@@ -102,7 +102,7 @@ class AlignSelectedXYZ(Operator):
     bl_description = "Align Selected Along the chosen axis"
     bl_options = {'REGISTER', 'UNDO'}
 
-    axis = EnumProperty(
+    axis: EnumProperty(
         name="Axis",
         items=[
             ('X', "X", "X Axis"),
@@ -147,7 +147,7 @@ class AlignToXYZ0(Operator):
     bl_description = "Align Active Object To a chosen X, Y or Z equals 0 Location"
     bl_options = {'REGISTER', 'UNDO'}
 
-    axis = EnumProperty(
+    axis: EnumProperty(
             name="Axis",
             items=[
                 ('0', "X", "X Axis"),
@@ -181,7 +181,7 @@ class AlignXYZAll(Operator):
     bl_description = "Align to a Front or Back along the chosen Axis"
     bl_options = {'REGISTER', 'UNDO'}
 
-    axis = EnumProperty(
+    axis: EnumProperty(
             name="Axis",
             items=[
                 ('0', "X", "X Axis"),
@@ -191,7 +191,7 @@ class AlignXYZAll(Operator):
             description="Choose an axis for alignment",
             default='0'
             )
-    side = EnumProperty(
+    side: EnumProperty(
             name="Side",
             items=[
                 ('POSITIVE', "Front", "Align on the positive chosen axis"),
diff --git a/space_view3d_pie_menus/pie_apply_transform_menu.py b/space_view3d_pie_menus/pie_apply_transform_menu.py
index 7eb0a3a9..362d9b1a 100644
--- a/space_view3d_pie_menus/pie_apply_transform_menu.py
+++ b/space_view3d_pie_menus/pie_apply_transform_menu.py
@@ -71,7 +71,7 @@ class ApplyTransLocRotPie(Operator):
     bl_description = "Apply Transform: Location, Rotation or Scale"
     bl_options = {'REGISTER', 'UNDO'}
 
-    option = EnumProperty(
+    option: EnumProperty(
             name="Type",
             items=[
                 ("LOC", "Location", "Apply Location"),
diff --git a/space_view3d_pie_menus/pie_editor_switch_menu.py b/space_view3d_pie_menus/pie_editor_switch_menu.py
index 5002fa7e..1e23bd49 100644
--- a/space_view3d_pie_menus/pie_editor_switch_menu.py
+++ b/space_view3d_pie_menus/pie_editor_switch_menu.py
@@ -114,7 +114,7 @@ class SetAreaType(Operator):
     bl_description = "Change Editor Type"
     bl_options = {'REGISTER'}
 
-    types = StringProperty(name="Area Type")
+    types: StringProperty(name="Area Type")
 
     def execute(self, context):
         context.area.type = self.types
diff --git a/space_view3d_pie_menus/pie_manipulator_menu.py b/space_view3d_pie_menus/pie_manipulator_menu.py
index bbd9b06f..200a87b4 100644
--- a/space_view3d_pie_menus/pie_manipulator_menu.py
+++ b/space_view3d_pie_menus/pie_manipulator_menu.py
@@ -63,7 +63,7 @@ class PieManipulator(Menu):
         layout = self.layout
         pie = layout.menu_pie()
         # 4 - LEFT
-        pie.operator("wm.tool_set_by_name", text="Translate", icon='MAN_TRANS').name = "Grab"
+        pie.operator("wm.tool_set_by_name", text="Move", icon='MAN_TRANS').name = "Move"
         # 6 - RIGHT
         pie.operator("wm.tool_set_by_name", text="Scale", icon='MAN_SCALE').name = "Scale"
         # 2 - BOTTOM
diff --git a/space_view3d_pie_menus/pie_modes_menu.py b/space_view3d_pie_menus/pie_modes_menu.py
index 87c1ee9e..74c0b79d 100644
--- a/space_view3d_pie_menus/pie_modes_menu.py
+++ b/space_view3d_pie_menus/pie_modes_menu.py
@@ -163,7 +163,7 @@ class SetObjectModePie(Operator):
     bl_description = "I set the interactive mode of object"
     bl_options = {'REGISTER'}
 
-    mode = bpy.props.StringProperty(name="Interactive mode", default="OBJECT")
+    mode: bpy.props.StringProperty(name="Interactive mode", default="OBJECT")
 
     def execute(self, context):
         if (context.active_object):
diff --git a/space_view3d_pie_menus/pie_orientation_menu.py b/space_view3d_pie_menus/pie_orientation_menu.py
index a9de9fa6..ea90862a 100644
--- a/space_view3d_pie_menus/pie_orientation_menu.py
+++ b/space_view3d_pie_menus/pie_orientation_menu.py
@@ -44,7 +44,7 @@ class OrientPoll(Operator):
     bl_label = "Orientation Poll"
     bl_options = {'INTERNAL'}
 
-    space = StringProperty()
+    space: StringProperty()
 
     @classmethod
     def poll(cls, context):
diff --git a/space_view3d_pie_menus/pie_snap_menu.py b/space_view3d_pie_menus/pie_snap_menu.py
index b5ca502c..19b4464f 100644
--- a/space_view3d_pie_menus/pie_snap_menu.py
+++ b/space_view3d_pie_menus/pie_snap_menu.py
@@ -185,7 +185,8 @@ class SnapTargetVariable(Operator):
     bl_idname = "object.snaptargetvariable"
     bl_label = "Snap Target Variable"
     bl_options = {'REGISTER', 'UNDO'}
-    variable = bpy.props.StringProperty()
+
+    variable: bpy.props.StringProperty()
 
     @classmethod
     def poll(cls, context):



More information about the Bf-extensions-cvs mailing list