Commit: 9cd1c5eddef6cb1f2329c6d262630a49e598ee78
Author: Antonio Vazquez
Date:   Wed Nov 27 08:18:32 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB9cd1c5eddef6cb1f2329c6d262630a49e598ee78

GPencil: Delete unknow brushes when Reset All

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

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 a6df2f2e952..41eb43da237 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1645,21 +1645,23 @@ static void gp_bruh_delete_mode_brushes(Main *bmain, 
const enum eContextObjectMo
 
     short preset = brush->gpencil_settings->preset_type;
 
-    /* Verify to delete only the brushes of the current mode. */
-    if ((mode == CTX_MODE_PAINT_GPENCIL) &&
-        ((preset < GP_BRUSH_PRESET_AIRBRUSH) || (preset > 
GP_BRUSH_PRESET_TINT))) {
-      continue;
-    }
-    if ((mode == CTX_MODE_SCULPT_GPENCIL) &&
-        ((preset < GP_BRUSH_PRESET_SMOOTH_STROKE) || (preset > 
GP_BRUSH_PRESET_CLONE_STROKE))) {
-      continue;
-    }
-    if ((mode == CTX_MODE_WEIGHT_GPENCIL) && (preset != 
GP_BRUSH_PRESET_DRAW_WEIGHT)) {
-      continue;
-    }
-    if ((mode == CTX_MODE_VERTEX_GPENCIL) &&
-        ((preset < GP_BRUSH_PRESET_VERTEX_DRAW) || (preset > 
GP_BRUSH_PRESET_VERTEX_REPLACE))) {
-      continue;
+    if (preset != GP_BRUSH_PRESET_UNKNOWN) {
+      /* Verify to delete only the brushes of the current mode. */
+      if ((mode == CTX_MODE_PAINT_GPENCIL) &&
+          ((preset < GP_BRUSH_PRESET_AIRBRUSH) || (preset > 
GP_BRUSH_PRESET_TINT))) {
+        continue;
+      }
+      if ((mode == CTX_MODE_SCULPT_GPENCIL) &&
+          ((preset < GP_BRUSH_PRESET_SMOOTH_STROKE) || (preset > 
GP_BRUSH_PRESET_CLONE_STROKE))) {
+        continue;
+      }
+      if ((mode == CTX_MODE_WEIGHT_GPENCIL) && (preset != 
GP_BRUSH_PRESET_DRAW_WEIGHT)) {
+        continue;
+      }
+      if ((mode == CTX_MODE_VERTEX_GPENCIL) &&
+          ((preset < GP_BRUSH_PRESET_VERTEX_DRAW) || (preset > 
GP_BRUSH_PRESET_VERTEX_REPLACE))) {
+        continue;
+      }
     }
 
     /* Before delete, unpinn any material of the brush. */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to