diff options
author | Antonioya <blendergit@gmail.com> | 2019-08-08 17:12:13 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-08-08 17:43:54 +0300 |
commit | 179e886ab3d6f8b762ff66c5bb2cb203a4adcb62 (patch) | |
tree | 3586e7f51fe1b28156604f4f6b20ee86c81f95e6 /release/scripts | |
parent | 5ca3bc7a145f8ac1740cbf46e4701fee3a245b14 (diff) |
GPencil: New Simplify modifier mode Sample and operator
This mode simplify the stroke doing a resampling of the points and generate new geometry at the distance defined.
Sample function developed by @NicksBest
New Resample Stroke operator
This operator recreates the stroke geometry with a predefined length between points.
The operator uses the same code used in Simplify modifier.
Reviewers: @mendio
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 12 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 66e96199b08..5595408f1da 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -1785,13 +1785,13 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): col = split.column() col.label(text="Settings:") - row = col.row(align=True) - row.enabled = md.mode == 'FIXED' - row.prop(md, "step") - row = col.row(align=True) - row.enabled = not md.mode == 'FIXED' - row.prop(md, "factor") + if md.mode == 'FIXED': + col.prop(md, "step") + elif md.mode == 'ADAPTIVE': + col.prop(md, "factor") + elif md.mode == 'SAMPLE': + col.prop(md, "length") col = layout.column() col.separator() diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 2eeb13310fa..c7fc79aa8e8 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -4447,6 +4447,7 @@ class VIEW3D_MT_gpencil_simplify(Menu): layout = self.layout layout.operator("gpencil.stroke_simplify_fixed", text="Fixed") layout.operator("gpencil.stroke_simplify", text="Adaptive") + layout.operator("gpencil.stroke_sample", text="Sample") class VIEW3D_MT_paint_gpencil(Menu): @@ -6322,8 +6323,7 @@ class VIEW3D_MT_gpencil_edit_context_menu(Menu): if is_3d_view: layout.menu("GPENCIL_MT_cleanup") - layout.operator("gpencil.stroke_simplify_fixed", text="Simplify") - layout.operator("gpencil.stroke_simplify", text="Simplify Adaptive") + layout.menu("VIEW3D_MT_gpencil_simplify") layout.operator("gpencil.stroke_merge", text="Merge") layout.menu("VIEW3D_MT_edit_gpencil_delete") |