[Bf-blender-cvs] [2f39d6b0026] temp-gpencil-bezier-stroke-type: GPencil: change material curves operator

Falk David noreply at git.blender.org
Mon Mar 15 00:36:26 CET 2021


Commit: 2f39d6b00263e687226a5afd7692dc2a36136871
Author: Falk David
Date:   Sun Mar 14 19:49:57 2021 +0100
Branches: temp-gpencil-bezier-stroke-type
https://developer.blender.org/rB2f39d6b00263e687226a5afd7692dc2a36136871

GPencil: change material curves operator

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

M	source/blender/editors/gpencil/gpencil_data.c

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

diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 50a8c5a74d5..009690ef966 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1606,7 +1606,6 @@ static int gpencil_stroke_arrange_exec(bContext *C, wmOperator *op)
           }
         }
 
-        
         if (gpf_lock) {
           continue;
         }
@@ -1745,21 +1744,26 @@ static int gpencil_stroke_change_color_exec(bContext *C, wmOperator *op)
 
         LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
           /* only if selected */
-          if (gps->flag & GP_STROKE_SELECT) {
-            /* skip strokes that are invalid for current view */
-            if (ED_gpencil_stroke_can_use(C, gps) == false) {
-              continue;
-            }
-            /* check if the color is editable */
-            if (ED_gpencil_stroke_material_editable(ob, gpl, gps) == false) {
-              continue;
-            }
-
-            /* assign new color */
-            gps->mat_nr = idx;
+          bool is_stroke_selected = GPENCIL_STROKE_TYPE_BEZIER(gps) ?
+                                        (bool)(gps->editcurve->flag & GP_CURVE_SELECT) :
+                                        (bool)(gps->flag & GP_STROKE_SELECT);
+          if (!is_stroke_selected) {
+            continue;
+          }
 
-            changed = true;
+          /* skip strokes that are invalid for current view */
+          if (ED_gpencil_stroke_can_use(C, gps) == false) {
+            continue;
           }
+          /* check if the color is editable */
+          if (ED_gpencil_stroke_material_editable(ob, gpl, gps) == false) {
+            continue;
+          }
+
+          /* assign new color */
+          gps->mat_nr = idx;
+
+          changed = true;
         }
       }
       /* if not multiedit, exit loop*/



More information about the Bf-blender-cvs mailing list