diff options
author | Falk David <falkdavid@gmx.de> | 2020-11-13 23:43:00 +0300 |
---|---|---|
committer | Falk David <falkdavid@gmx.de> | 2020-11-13 23:43:00 +0300 |
commit | 0be88c7d15d2ad1af284c6283370173647ae74eb (patch) | |
tree | 5fff573c512e284547ebe0c921ecffdae2c377c4 /release/scripts/startup/bl_ui | |
parent | 9d28353b525ecfbcca1501be72e4276dfb2bbc2a (diff) |
GPencil: Merge GSoC curve edit mode
Differential Revision: https://developer.blender.org/D8660
This patch is the result of the GSoC 2020 "Editing Grease Pencil Strokes
Using Curves" project. It adds a submode to greasepencil edit mode that
allows for the transformation of greasepencil strokes using bezier
curves. More information about the project can be found
here: https://wiki.blender.org/wiki/User:Filedescriptor/GSoC_2020.
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_gpencil.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 45 |
2 files changed, 45 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py index affdba6f693..398bf60c493 100644 --- a/release/scripts/startup/bl_ui/properties_data_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py @@ -369,6 +369,8 @@ class DATA_PT_gpencil_strokes(DataButtonsPanel, Panel): sub.active = gpd.stroke_thickness_space == 'WORLDSPACE' sub.prop(gpd, "pixel_factor", text="Thickness Scale") + col.prop(gpd, "edit_curve_resolution") + class DATA_PT_gpencil_display(DataButtonsPanel, Panel): bl_label = "Viewport Display" diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 1b5a7da61b0..9dbb56e7e45 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -661,7 +661,23 @@ class VIEW3D_HT_header(Header): # Select mode for Editing if gpd.use_stroke_edit_mode: row = layout.row(align=True) - row.prop(tool_settings, "gpencil_selectmode_edit", text="", expand=True) + row.prop_enum(tool_settings, "gpencil_selectmode_edit", text="", value='POINT') + row.prop_enum(tool_settings, "gpencil_selectmode_edit", text="", value='STROKE') + + subrow = row.row(align=True) + subrow.enabled = not gpd.use_curve_edit + subrow.prop_enum(tool_settings, "gpencil_selectmode_edit", text="", value='SEGMENT') + + # Curve edit submode + row = layout.row(align=True) + row.prop(gpd, "use_curve_edit", text="", + icon='IPO_BEZIER') + sub = row.row(align=True) + sub.active = gpd.use_curve_edit + sub.popover( + panel="VIEW3D_PT_gpencil_curve_edit", + text="Curve Editing", + ) # Select mode for Sculpt if gpd.is_stroke_sculpt_mode: @@ -687,7 +703,7 @@ class VIEW3D_HT_header(Header): row.prop(gpd, "use_multiedit", text="", icon='GP_MULTIFRAME_EDITING') sub = row.row(align=True) - sub.active = gpd.use_multiedit + sub.enabled = gpd.use_multiedit sub.popover( panel="VIEW3D_PT_gpencil_multi_frame", text="Multiframe", @@ -6802,6 +6818,12 @@ class VIEW3D_PT_overlay_gpencil_options(Panel): layout.prop(overlay, "vertex_opacity", text="Vertex Opacity", slider=True) + # Handles for Curve Edit + if context.object.mode == 'EDIT_GPENCIL': + gpd = context.object.data + if gpd.use_curve_edit: + layout.prop(overlay, "display_handle", text="Handles") + if context.object.mode in {'PAINT_GPENCIL', 'VERTEX_GPENCIL'}: layout.label(text="Vertex Paint") row = layout.row() @@ -6965,6 +6987,24 @@ class VIEW3D_PT_gpencil_multi_frame(Panel): layout.template_curve_mapping(settings, "multiframe_falloff_curve", brush=True) +# Grease Pencil Object - Curve Editing tools +class VIEW3D_PT_gpencil_curve_edit(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'HEADER' + bl_label = "Curve Editing" + + def draw(self, context): + gpd = context.gpencil_data + settings = context.tool_settings.gpencil_sculpt + + layout = self.layout + col = layout.column(align=True) + col.prop(gpd, "edit_curve_resolution") + col.prop(gpd, "curve_edit_threshold") + col.prop(gpd, "curve_edit_corner_angle") + col.prop(gpd, "use_adaptive_curve_resolution") + + class VIEW3D_MT_gpencil_edit_context_menu(Menu): bl_label = "" @@ -7606,6 +7646,7 @@ classes = ( VIEW3D_PT_grease_pencil, VIEW3D_PT_annotation_onion, VIEW3D_PT_gpencil_multi_frame, + VIEW3D_PT_gpencil_curve_edit, VIEW3D_PT_quad_view, VIEW3D_PT_view3d_stereo, VIEW3D_PT_shading, |