Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2017-01-18 06:43:17 +0300
committerJoshua Leung <aligorith@gmail.com>2017-01-18 09:41:58 +0300
commit224ae234439727628ec5c260d1fd4e22e6566e29 (patch)
treea157004e6c6d7f273c09588d038a6d80f28f1dce /release/scripts/startup/bl_ui/properties_grease_pencil_common.py
parent4903a83235524d852dec52d189c6744d4794d613 (diff)
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)
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.py36
1 files changed, 30 insertions, 6 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 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