[Bf-blender-cvs] [7bf0682aa98] master: GPencil: Add interpolate operators in Draw mode

Antonio Vazquez noreply at git.blender.org
Thu Oct 29 19:29:23 CET 2020


Commit: 7bf0682aa98ac020dc7c55e3298a5cdccc665509
Author: Antonio Vazquez
Date:   Thu Oct 29 18:07:51 2020 +0100
Branches: master
https://developer.blender.org/rB7bf0682aa98ac020dc7c55e3298a5cdccc665509

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

===================================================================

M	release/scripts/startup/bl_ui/space_view3d.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/editors/gpencil/gpencil_interpolate.c

===================================================================

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;
         }



More information about the Bf-blender-cvs mailing list