diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2016-09-08 13:16:41 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2016-09-08 13:16:41 +0300 |
commit | 788c75ed879fb25a35c0a0e9245df7aeaae2f4ab (patch) | |
tree | 3b1c315078e257e0401904860f9ec90fe60390ee /release/scripts/startup/bl_ui/properties_grease_pencil_common.py | |
parent | 1ffd9714b930dbef8059403d69650476f625f554 (diff) | |
parent | 45f833c21dcfad4d1d7045987bb8b69d6aab05be (diff) |
Merge branch 'master' into viewport_bvh_selectviewport_bvh_select
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_grease_pencil_common.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_grease_pencil_common.py | 92 |
1 files changed, 61 insertions, 31 deletions
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 677c7b9960e..4299cf6035d 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -20,6 +20,7 @@ from bpy.types import Menu, UIList +from bpy.app.translations import pgettext_iface as iface_ def gpencil_stroke_placement_settings(context, layout): @@ -52,6 +53,34 @@ def gpencil_stroke_placement_settings(context, layout): row.prop(ts, "use_gpencil_stroke_endpoints") +def gpencil_active_brush_settings_simple(context, layout): + brush = context.active_gpencil_brush + + col = layout.column() + col.label("Active Brush: ") + + row = col.row(align=True) + row.operator_context = 'EXEC_REGION_WIN' + row.operator_menu_enum("gpencil.brush_change", "brush", text="", icon='BRUSH_DATA') + row.prop(brush, "name", text="") + + col.prop(brush, "line_width", slider=True) + row = col.row(align=True) + row.prop(brush, "use_random_pressure", text='', icon='RNDCURVE') + row.prop(brush, "pen_sensitivity_factor", slider=True) + row.prop(brush, "use_pressure", text='', icon='STYLUS_PRESSURE') + row = col.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') + row = col.row(align=True) + row.prop(brush, "jitter", slider=True) + row.prop(brush, "use_jitter_pressure", text='', icon='STYLUS_PRESSURE') + row = col.row() + row.prop(brush, "angle", slider=True) + row.prop(brush, "angle_factor", text="Factor", slider=True) + + class GreasePencilDrawingToolsPanel: # subclass must set # bl_space_type = 'IMAGE_EDITOR' @@ -187,6 +216,15 @@ class GreasePencilStrokeEditPanel: col.operator_menu_enum("gpencil.stroke_arrange", text="Arrange Strokes...", property="direction") col.operator("gpencil.stroke_change_color", text="Move to Color") + if is_3d_view: + layout.separator() + col = layout.column(align=True) + col.operator("gpencil.interpolate", text="Interpolate") + col.operator("gpencil.interpolate_sequence", text="Sequence") + settings = context.tool_settings.gpencil_sculpt + col.prop(settings, "interpolate_all_layers") + col.prop(settings, "interpolate_selected_only") + layout.separator() col = layout.column(align=True) col.operator("gpencil.stroke_join", text="Join").type = 'JOIN' @@ -197,6 +235,10 @@ class GreasePencilStrokeEditPanel: if gpd: col.prop(gpd, "show_stroke_direction", text="Show Directions") + if is_3d_view: + layout.separator() + layout.operator("gpencil.reproject") + class GreasePencilBrushPanel: # subclass must set @@ -460,29 +502,7 @@ class GPENCIL_PIE_settings_palette(Menu): col.prop(palcolor, "fill_alpha", text="", slider=True) # S Brush settings - col = pie.column() - col.label("Active Brush: ") - - row = col.row() - row.operator_context = 'EXEC_REGION_WIN' - row.operator_menu_enum("gpencil.brush_change", "brush", text="", icon='BRUSH_DATA') - row.prop(brush, "name", text="") - - col.prop(brush, "line_width", slider=True) - row = col.row(align=True) - row.prop(brush, "use_random_pressure", text='', icon='RNDCURVE') - row.prop(brush, "pen_sensitivity_factor", slider=True) - row.prop(brush, "use_pressure", text='', icon='STYLUS_PRESSURE') - row = col.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') - row = col.row(align=True) - row.prop(brush, "jitter", slider=True) - row.prop(brush, "use_jitter_pressure", text='', icon='STYLUS_PRESSURE') - row = col.row() - row.prop(brush, "angle", slider=True) - row.prop(brush, "angle_factor", text="Factor", slider=True) + gpencil_active_brush_settings_simple(context, pie) # N - Active Layer col = pie.column() @@ -752,6 +772,7 @@ class GPENCIL_MT_palettecolor_specials(Menu): layout.separator() layout.operator("gpencil.palettecolor_select", icon='COLOR', text="Select Strokes") + layout.operator("gpencil.stroke_change_color", icon='MAN_TRANS', text="Move to Color") class GreasePencilDataPanel: @@ -834,7 +855,10 @@ class GreasePencilDataPanel: split.prop(gpl, "show_points") # Offsets + Parenting (where available) - split = layout.split(percentage=0.5) + if context.space_data.type == 'VIEW_3D': + split = layout.split(percentage=0.5) + else: + split = layout.column() # parenting is not available in 2D editors... split.active = not gpl.lock # Offsets - Color Tint @@ -868,10 +892,10 @@ class GreasePencilDataPanel: row.active = not gpl.lock if gpl.active_frame: - lock_status = "Locked" if gpl.lock_frame else "Unlocked" - lock_label = "Frame: %d (%s)" % (gpl.active_frame.frame_number, lock_status) + lock_status = iface_("Locked") if gpl.lock_frame else iface_("Unlocked") + lock_label = iface_("Frame: %d (%s)") % (gpl.active_frame.frame_number, lock_status) else: - lock_label = "Lock Frame" + lock_label = iface_("Lock Frame") row.prop(gpl, "lock_frame", text=lock_label, icon='UNLOCKED') row.operator("gpencil.active_frame_delete", text="", icon='X') @@ -956,10 +980,13 @@ class GreasePencilPaletteColorPanel: sub.operator("gpencil.palettecolor_move", icon='TRIA_UP', text="").direction = 'UP' sub.operator("gpencil.palettecolor_move", icon='TRIA_DOWN', text="").direction = 'DOWN' - col.separator() - sub = col.column(align=True) + row = layout.row() + sub = row.row(align=True) + sub.label(text="Isolate:") # based on active color only sub.operator("gpencil.palettecolor_isolate", icon='LOCKED', text="").affect_visibility = False sub.operator("gpencil.palettecolor_isolate", icon='RESTRICT_VIEW_OFF', text="").affect_visibility = True + sub = row.row(align=True) + sub.label(text="Lock:") # based on other stuff... sub.operator("gpencil.stroke_lock_color", icon='BORDER_RECT', text="") sub.operator("gpencil.palette_lock_layer", icon='COLOR', text="") @@ -967,9 +994,7 @@ class GreasePencilPaletteColorPanel: if pcolor: self.draw_palettecolors(layout, pcolor) - # ---------------------------------------------- # Draw palette colors - # ---------------------------------------------- def draw_palettecolors(self, layout, pcolor): # color settings split = layout.split(percentage=0.5) @@ -1002,6 +1027,7 @@ class GreasePencilPaletteColorPanel: class GreasePencilToolsPanel: + # For use in "2D" Editors without their own toolbar # subclass must set # bl_space_type = 'IMAGE_EDITOR' # bl_options = {'DEFAULT_CLOSED'} @@ -1031,4 +1057,8 @@ class GreasePencilToolsPanel: layout.separator() layout.separator() + gpencil_active_brush_settings_simple(context, layout) + + layout.separator() + gpencil_stroke_placement_settings(context, layout) |