From 224ae234439727628ec5c260d1fd4e22e6566e29 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 18 Jan 2017 16:43:17 +1300 Subject: GP Interpolate: Move settings from "gp_sculpt" to a new toolsettings struct - "gp_interpolate" The "gp_sculpt" settings should be strictly for stroke sculpting, and not abused by other tools. (Similarly, if other general GP tools need one-off options, those should go into the normal toolsettings->gpencil_flag) Furthermore, this paves the way for introducing new settings for controlling the way that GP interpolation takes place (e.g. with easing equations, or a custom curvemap) --- .../bl_ui/properties_grease_pencil_common.py | 36 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'release/scripts/startup/bl_ui/properties_grease_pencil_common.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 f8ee7c9a851..c43f56acb37 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -227,12 +227,7 @@ class GreasePencilStrokeEditPanel: 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) @@ -249,6 +244,35 @@ class GreasePencilStrokeEditPanel: layout.separator() layout.operator("gpencil.reproject") +class GreasePencilInterpolatePanel: + # subclass must set + bl_space_type = 'VIEW_3D' + bl_label = "Interpolate..." + bl_category = "Grease Pencil" + bl_region_type = 'TOOLS' + bl_options = {'DEFAULT_CLOSED'} + + @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.operator("gpencil.interpolate", text="Interpolate") + col.operator("gpencil.interpolate_sequence", text="Sequence") + col.prop(settings, "interpolate_all_layers") + col.prop(settings, "interpolate_selected_only") + class GreasePencilBrushPanel: # subclass must set -- cgit v1.2.3