[Bf-blender-cvs] [6c13ef9f942] greasepencil-object: GP UI - 2D/3D Split: Move all 3D toolbar only panel code to space_view3d_toolbar.py

Joshua Leung noreply at git.blender.org
Wed Feb 7 03:14:20 CET 2018


Commit: 6c13ef9f94259a004fddec33d21d0d1ded1d5bd5
Author: Joshua Leung
Date:   Wed Feb 7 15:14:00 2018 +1300
Branches: greasepencil-object
https://developer.blender.org/rB6c13ef9f94259a004fddec33d21d0d1ded1d5bd5

GP UI - 2D/3D Split: Move all 3D toolbar only panel code to space_view3d_toolbar.py

* All toolbar panels that are only used in the 3D view have now been
  moved out of properties_gpencil_common.py, as they are *only* used
  in that editor.

* Sculpt, Edit, and Eraser panel definiitions remain in the common file
  for now, as it's still possible for these to be used in other editors
  (at least in theory - there may be some new limitations I haven't found yet)

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py

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

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 0a8104e7a4c..56f934cb5f6 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -40,7 +40,7 @@ def gpencil_stroke_placement_settings(context, layout):
     if context.space_data.type != 'VIEW_3D':
         col.label(text="Stroke Placement:")
         row = col.row(align=True)
-        row.prop_enum(ts, propname, 'VIEW')
+        #row.prop_enum(ts, propname, 'VIEW')  # XXX: Now removed!
         row.prop_enum(ts, propname, 'CURSOR', text="Cursor")
 
 
@@ -75,24 +75,6 @@ def gpencil_active_brush_settings_simple(context, layout):
     row.prop(brush, "angle_factor", text="Factor", slider=True)
 
 
-class GreasePencilCreateShapesPanel:
-    bl_label = "Shapes"
-    bl_category = "Create"
-    bl_region_type = 'TOOLS'
-
-    @classmethod
-    def poll(cls, context):
-        return (context.space_data.type == 'VIEW_3D')
-
-    @staticmethod
-    def draw(self, context):
-        layout = self.layout
-
-        col = layout.column(align=True)
-        col.operator("gpencil.primitive", text="Rectangle", icon='UV_FACESEL').type = 'BOX'
-        col.operator("gpencil.primitive", text="Circle", icon='ANTIALIASED').type = 'CIRCLE'
-
-
 class GreasePencilDrawingToolsPanel:
     # subclass must set
     # bl_space_type = 'IMAGE_EDITOR'
@@ -156,7 +138,6 @@ class GreasePencilDrawingToolsPanel:
             col.prop(gpd, "use_stroke_edit_mode", text="Enable Editing", icon='EDIT', toggle=True)
 
 
-
 class GreasePencilStrokeEditPanel:
     # subclass must set
     # bl_space_type = 'IMAGE_EDITOR'
@@ -255,234 +236,6 @@ class GreasePencilStrokeEditPanel:
             col.operator_menu_enum("gpencil.frame_clean_fill", text="Clean Boundary Strokes...", property="mode")
 
 
-class GreasePencilAnimationPanel:
-    bl_space_type = 'VIEW_3D'
-    bl_label = "Animation"
-    bl_category = "Animation"
-    bl_region_type = 'TOOLS'
-
-    @classmethod
-    def poll(cls, context):
-        if context.gpencil_data is None:
-            return False
-        elif context.space_data.type != 'VIEW_3D':
-            return False
-        elif context.object.mode == 'OBJECT':
-            return False
-
-        return True
-
-    @staticmethod
-    def draw(self, context):
-        layout = self.layout
-
-        col = layout.column(align=True)
-        col.operator("gpencil.blank_frame_add", icon='NEW')
-        col.operator("gpencil.active_frames_delete_all", icon='X', text="Delete Frame(s)")
-
-        col.separator()
-        col.operator("gpencil.frame_duplicate", text="Duplicate Active Frame")
-        col.operator("gpencil.frame_duplicate", text="Duplicate All Layers").mode = 'ALL'
-
-        col.separator()
-        col.prop(context.tool_settings, "use_gpencil_additive_drawing", text="Additive Drawing")
-
-
-class GreasePencilInterpolatePanel:
-    bl_space_type = 'VIEW_3D'
-    bl_label = "Interpolate Strokes"
-    bl_category = "Animation"
-    bl_region_type = 'TOOLS'
-
-    @classmethod
-    def poll(cls, context):
-        if context.gpencil_data is None:
-            return False
-        elif context.space_data.type != 'VIEW_3D':
-            return False
-
-        gpd = context.gpencil_data
-
-        return bool(context.editable_gpencil_strokes) and bool(gpd.use_stroke_edit_mode)
-
-    @staticmethod
-    def draw(self, context):
-        layout = self.layout
-        settings = context.tool_settings.gpencil_interpolate
-
-        col = layout.column(align=True)
-        col.label("Interpolate Strokes")
-        col.operator("gpencil.interpolate", text="Interpolate")
-        col.operator("gpencil.interpolate_sequence", text="Sequence")
-        col.operator("gpencil.interpolate_reverse", text="Remove Breakdowns")
-
-        col = layout.column(align=True)
-        col.label(text="Options:")
-        col.prop(settings, "interpolate_all_layers")
-        col.prop(settings, "interpolate_selected_only")
-
-        col = layout.column(align=True)
-        col.label(text="Sequence Options:")
-        col.prop(settings, "type")
-        if settings.type == 'CUSTOM':
-            box = layout.box()
-            # TODO: Options for loading/saving curve presets?
-            box.template_curve_mapping(settings, "interpolation_curve", brush=True)
-        elif settings.type != 'LINEAR':
-            col.prop(settings, "easing")
-
-            if settings.type == 'BACK':
-                layout.prop(settings, "back")
-            elif setting.type == 'ELASTIC':
-                sub = layout.column(align=True)
-                sub.prop(settings, "amplitude")
-                sub.prop(settings, "period")
-
-
-class GreasePencilBrushPanel:
-    # subclass must set
-    # bl_space_type = 'IMAGE_EDITOR'
-    bl_label = "Drawing Brushes"
-    bl_category = "Tools"
-    bl_region_type = 'TOOLS'
-
-    @classmethod
-    def poll(cls, context):
-        is_3d_view = context.space_data.type == 'VIEW_3D'
-        if is_3d_view:
-            if context.gpencil_data is None:
-                return False
-
-            gpd = context.gpencil_data
-            return bool(gpd.is_stroke_paint_mode)
-        else:
-            return True
-
-    @staticmethod
-    def draw(self, context):
-        layout = self.layout
-        row = layout.row()
-        col = row.column()
-
-        ts = context.scene.tool_settings
-        col.template_icon_view(ts, "gpencil_brushes_enum", show_labels=True)
-
-        col = row.column()
-        sub = col.column(align=True)
-        sub.operator("gpencil.brush_add", icon='ZOOMIN', text="")
-        sub.operator("gpencil.brush_remove", icon='ZOOMOUT', text="")
-        sub.menu("GPENCIL_MT_brush_specials", icon='DOWNARROW_HLT', text="")
-        brush = context.active_gpencil_brush
-        if brush:
-            if len(ts.gpencil_brushes) > 1:
-                col.separator()
-                sub = col.column(align=True)
-                sub.operator("gpencil.brush_move", icon='TRIA_UP', text="").type = 'UP'
-                sub.operator("gpencil.brush_move", icon='TRIA_DOWN', text="").type = 'DOWN'
-
-        # Brush details
-        if brush is not None:
-            row = layout.row(align=False)
-            row.prop(brush, "name", text="")
-            row = layout.row(align=False)
-            row.prop(brush, "fill_only", text="Fill Brush")
-            if brush.fill_only is False:
-                row = layout.row(align=True)
-                row.prop(brush, "use_random_pressure", text="", icon='RNDCURVE')
-                row.prop(brush, "line_width", text="Radius")
-                row.prop(brush, "use_pressure", text="", icon='STYLUS_PRESSURE')
-                row = layout.row(align=True)
-                row.prop(brush, "use_random_strength", text="", icon='RNDCURVE')
-                row.prop(brush, "strength", slider=True)
-                row.prop(brush, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
-
-            if brush.fill_only is True:
-                row = layout.row(align=True)
-                row.prop(brush, "fill_leak", text="Leak Size")
-                row = layout.row(align=True)
-                row.prop(brush, "line_width", text="Thickness")
-                row = layout.row(align=True)
-                row.prop(brush, "fill_simplyfy_lvl", text="Simplify")
-
-                row = layout.row(align=True)
-                row.prop(brush, "fill_draw_mode", text="Mode")
-                row.prop(brush, "fill_show_boundary", text="", icon='GRID')
-
-                row = layout.row(align=True)
-                row.enabled = brush.fill_draw_mode != "STROKE"
-                row.prop(brush, "fill_hide", text="Hide Transparent Lines")
-                row = layout.row(align=True)
-                row.enabled = brush.fill_hide
-                row.prop(brush, "fill_threshold", text="Threshold")
-
-            row = layout.row(align=False)
-            row.prop(context.tool_settings, "use_gpencil_draw_onback", text="Draw on Back")
-
-
-class GreasePencilBrushOptionsPanel:
-    # subclass must set
-    # bl_space_type = 'IMAGE_EDITOR'
-    bl_label = "Strokes"
-    bl_category = "Tools"
-    bl_region_type = 'TOOLS'
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(cls, context):
-        is_3d_view = context.space_data.type == 'VIEW_3D'
-        if is_3d_view:
-            if context.gpencil_data is None:
-                return False
-
-            gpd = context.gpencil_data
-            return bool(gpd.is_stroke_paint_mode)
-        else:
-            return True
-
-    @staticmethod
-    def draw(self, context):
-        layout = self.layout
-        brush = context.active_gpencil_brush
-        if brush is not None:
-
-            row = layout.row(align=True)
-            col = row.column(align=True)
-            col.label(text="Stroke Quality:")
-            col.prop(brush, "pen_smooth_factor")
-            col.prop(brush, "pen_smooth_steps")
-
-            row = layout.row(align=True)
-            col = row.column(align=True)
-            col.prop(brush, "pen_thick_smooth_factor")
-            col.prop(brush, "pen_thick_smooth_steps")
-
-            col.separator()
-            row = col.row(align=False)
-            row.prop(brush, "pen_subdivision_steps")
-            row.prop(brush, "random_subdiv", text="Randomness", slider=True)
-
-            col = layout.column(align=True)
-            col.label(text="Settings:")
-            col.prop(brush, "random_press", slider=True)
-
-            row = layout.row(align=True)
-            row.prop(brush, "jitter", slider=True)
-            row.prop(brush, "use_jitter_pressure", text="", icon='STYLUS_PRESSURE')
-            row = layout.row()
-            row.prop(brush, "angle", slider=True)
-            row.prop(brush, "angle_factor", text="Factor", slider=True)
-
-            if brush.fill_only is False:
-                row.separator()
-                row = layout.row(align=True)
-                row.prop(brush, "use_stabilizer", text="Stabilizer")
-                if brush.use_stabilizer:
-           

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list