Commit: 8e4b87e9a52074875df26958150941e051b36d67
Author: Joshua Leung
Date:   Thu Jun 21 23:42:00 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rB8e4b87e9a52074875df26958150941e051b36d67

Cleanup: Move some GP Object specific types to their respective files

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

M       release/scripts/startup/bl_ui/properties_data_gpencil.py
M       release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M       release/scripts/startup/bl_ui/properties_material_gpencil.py

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

diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py 
b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index 06ae0c205be..008acf52b2a 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -18,7 +18,7 @@
 
 # <pep8 compliant>
 import bpy
-from bpy.types import Panel, UIList
+from bpy.types import Menu, Panel, UIList
 from rna_prop_ui import PropertyPanel
 from .properties_grease_pencil_common import (
         GreasePencilDataPanel,
@@ -200,6 +200,32 @@ class DATA_PT_gpencil_onionpanel(Panel):
         GreasePencilOnionPanel.draw_settings(layout, gpd)
 
 
+class GPENCIL_MT_gpencil_vertex_group(Menu):
+    bl_label = "GP Vertex Groups"
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.operator_context = 'EXEC_AREA'
+        layout.operator("object.vertex_group_add")
+
+        ob = context.active_object
+        if ob.vertex_groups.active:
+            layout.separator()
+
+            layout.operator("gpencil.vertex_group_assign", text="Assign to 
Active Group")
+            layout.operator("gpencil.vertex_group_remove_from", text="Remove 
from Active Group")
+
+            layout.separator()
+            layout.operator_menu_enum("object.vertex_group_set_active", 
"group", text="Set Active Group")
+            layout.operator("object.vertex_group_remove", text="Remove Active 
Group").all = False
+            layout.operator("object.vertex_group_remove", text="Remove All 
Groups").all = True
+
+            layout.separator()
+            layout.operator("gpencil.vertex_group_select", text="Select 
Points")
+            layout.operator("gpencil.vertex_group_deselect", text="Deselect 
Points")
+
+
 class GPENCIL_UL_vgroups(UIList):
     def draw_item(self, context, layout, data, item, icon, active_data, 
active_propname, index):
         vgroup = item
@@ -296,6 +322,8 @@ classes = (
     DATA_PT_custom_props_gpencil,
 
     GPENCIL_UL_vgroups,
+    
+    GPENCIL_MT_gpencil_vertex_group,
 )
 
 if __name__ == "__main__":  # only for live edit.
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py 
b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 15af74dfda5..e46f6b310ea 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -706,32 +706,6 @@ class GPENCIL_MT_gpencil_draw_specials(Menu):
         layout.operator("gpencil.colorpick", text="Colors", icon="GROUP_VCOL")
 
 
-class GPENCIL_MT_gpencil_vertex_group(Menu):
-    bl_label = "GP Vertex Groups"
-
-    def draw(self, context):
-        layout = self.layout
-
-        layout.operator_context = 'EXEC_AREA'
-        layout.operator("object.vertex_group_add")
-
-        ob = context.active_object
-        if ob.vertex_groups.active:
-            layout.separator()
-
-            layout.operator("gpencil.vertex_group_assign", text="Assign to 
Active Group")
-            layout.operator("gpencil.vertex_group_remove_from", text="Remove 
from Active Group")
-
-            layout.separator()
-            layout.operator_menu_enum("object.vertex_group_set_active", 
"group", text="Set Active Group")
-            layout.operator("object.vertex_group_remove", text="Remove Active 
Group").all = False
-            layout.operator("object.vertex_group_remove", text="Remove All 
Groups").all = True
-
-            layout.separator()
-            layout.operator("gpencil.vertex_group_select", text="Select 
Points")
-            layout.operator("gpencil.vertex_group_deselect", text="Deselect 
Points")
-
-
 class GPENCIL_UL_layer(UIList):
     def draw_item(self, context, layout, data, item, icon, active_data, 
active_propname, index):
         # assert(isinstance(item, bpy.types.GPencilLayer)
@@ -799,26 +773,6 @@ class GPENCIL_MT_brush_specials(Menu):
         layout.operator("gpencil.brush_presets_create", icon='HELP', 
text="Create a Set of Predefined Brushes")
 
 
-class GPENCIL_MT_color_specials(Menu):
-    bl_label = "Layer"
-
-    def draw(self, context):
-        layout = self.layout
-
-        layout.operator("gpencil.color_reveal", icon='RESTRICT_VIEW_OFF', 
text="Show All")
-        layout.operator("gpencil.color_hide", icon='RESTRICT_VIEW_ON', 
text="Hide Others").unselected = True
-
-        layout.separator()
-
-        layout.operator("gpencil.color_lock_all", icon='LOCKED', text="Lock 
All")
-        layout.operator("gpencil.color_unlock_all", icon='UNLOCKED', 
text="UnLock All")
-
-        layout.separator()
-
-        layout.operator("gpencil.stroke_lock_color", icon='BORDER_RECT', 
text="Lock Unselected")
-        layout.operator("gpencil.lock_layer", icon='COLOR', text="Lock Unused")
-
-
 class GreasePencilDataPanel:
     bl_label = "Annotations"
     bl_region_type = 'UI'
@@ -998,11 +952,9 @@ classes = (
     GPENCIL_MT_gpencil_edit_specials,
     GPENCIL_MT_gpencil_sculpt_specials,
     GPENCIL_MT_gpencil_draw_specials,
-    GPENCIL_MT_gpencil_vertex_group,
     GPENCIL_UL_layer,
     GPENCIL_MT_layer_specials,
     GPENCIL_MT_brush_specials,
-    GPENCIL_MT_color_specials,
 )
 
 if __name__ == "__main__":  # only for live edit.
diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py 
b/release/scripts/startup/bl_ui/properties_material_gpencil.py
index ee8c3132b39..b68e5a5c609 100644
--- a/release/scripts/startup/bl_ui/properties_material_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py
@@ -18,7 +18,27 @@
 
 # <pep8 compliant>
 import bpy
-from bpy.types import Panel, UIList
+from bpy.types import Menu, Panel, UIList
+
+
+class GPENCIL_MT_color_specials(Menu):
+    bl_label = "Layer"
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.operator("gpencil.color_reveal", icon='RESTRICT_VIEW_OFF', 
text="Show All")
+        layout.operator("gpencil.color_hide", icon='RESTRICT_VIEW_ON', 
text="Hide Others").unselected = True
+
+        layout.separator()
+
+        layout.operator("gpencil.color_lock_all", icon='LOCKED', text="Lock 
All")
+        layout.operator("gpencil.color_unlock_all", icon='UNLOCKED', 
text="UnLock All")
+
+        layout.separator()
+
+        layout.operator("gpencil.stroke_lock_color", icon='BORDER_RECT', 
text="Lock Unselected")
+        layout.operator("gpencil.lock_layer", icon='COLOR', text="Lock Unused")
 
 
 class GPENCIL_UL_matslots(UIList):
@@ -137,6 +157,8 @@ class MATERIAL_PT_gpencil_slots(Panel):
             split.template_ID(space, "pin_id")
             split.separator()
 
+
+# XXX: Why is this panel here? Remove?
 class MATERIAL_PT_gpencil_surface(GPMaterialButtonsPanel, Panel):
     bl_label = "Surface"
 
@@ -272,6 +294,7 @@ class MATERIAL_PT_gpencil_options(GPMaterialButtonsPanel, 
Panel):
 
 classes = (
     GPENCIL_UL_matslots,
+    GPENCIL_MT_color_specials,
     MATERIAL_PT_gpencil_slots,
     MATERIAL_PT_gpencil_surface,
     MATERIAL_PT_gpencil_strokecolor,

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to