diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-10-29 20:07:51 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-10-29 21:22:42 +0300 |
commit | 7bf0682aa98ac020dc7c55e3298a5cdccc665509 (patch) | |
tree | e7c3a472971908bfe3959abcee6f2890592f3b57 | |
parent | d9b22b809484733ba36085f48d768ac6ded42715 (diff) |
GPencil: Add interpolate operators in Draw mode
Now the interpolate is available in draw mode (except the option of selected strokes).
Differential Revision: https://developer.blender.org/D9325
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 8 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_interpolate.c | 6 |
3 files changed, 10 insertions, 6 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index cb2ead39e2a..9aa825c5854 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -693,7 +693,7 @@ class VIEW3D_HT_header(Header): text="Multiframe", ) - if gpd.use_stroke_edit_mode: + if gpd.use_stroke_edit_mode or gpd.is_stroke_paint_mode: row = layout.row(align=True) row.popover( panel="VIEW3D_PT_tools_grease_pencil_interpolate", diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 701c98ce489..8c0103d10e6 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1683,7 +1683,8 @@ class VIEW3D_PT_tools_grease_pencil_interpolate(Panel): return False gpd = context.gpencil_data - return bool(context.editable_gpencil_strokes) and bool(gpd.use_stroke_edit_mode) + valid_mode = bool(gpd.use_stroke_edit_mode or gpd.is_stroke_paint_mode) + return bool(context.editable_gpencil_strokes) and valid_mode def draw(self, context): layout = self.layout @@ -1698,7 +1699,10 @@ class VIEW3D_PT_tools_grease_pencil_interpolate(Panel): col = layout.column(align=True) col.label(text="Options:") col.prop(settings, "interpolate_all_layers") - col.prop(settings, "interpolate_selected_only") + + gpd = context.gpencil_data + if gpd.use_stroke_edit_mode: + col.prop(settings, "interpolate_selected_only") col = layout.column(align=True) col.label(text="Sequence Options:") diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index 380dfd1a7a2..320357dc678 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -220,7 +220,7 @@ static bool gpencil_interpolate_check_todo(bContext *C, bGPdata *gpd) int fFrame; /* only selected */ - if ((flag & GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED) && + if ((GPENCIL_EDIT_MODE(gpd)) && (flag & GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED) && ((gps_from->flag & GP_STROKE_SELECT) == 0)) { continue; } @@ -300,7 +300,7 @@ static void gpencil_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi) bool valid = true; /* only selected */ - if ((tgpi->flag & GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED) && + if ((GPENCIL_EDIT_MODE(gpd)) && (tgpi->flag & GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED) && ((gps_from->flag & GP_STROKE_SELECT) == 0)) { valid = false; } @@ -1018,7 +1018,7 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op) for (gps_from = prevFrame->strokes.first; gps_from; gps_from = gps_from->next) { /* only selected */ - if ((flag & GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED) && + if ((GPENCIL_EDIT_MODE(gpd)) && (flag & GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED) && ((gps_from->flag & GP_STROKE_SELECT) == 0)) { continue; } |