[Bf-blender-cvs] [2d943d616f7] greasepencil-refactor: Back again Simplify Modifiers option

Antonio Vazquez noreply at git.blender.org
Sat Jan 18 11:54:46 CET 2020


Commit: 2d943d616f7dcb6b05eaef75931d6ea6c5842b5d
Author: Antonio Vazquez
Date:   Tue Jan 14 17:49:25 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB2d943d616f7dcb6b05eaef75931d6ea6c5842b5d

Back again Simplify Modifiers option

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/blenkernel/BKE_gpencil.h
M	source/blender/blenkernel/intern/gpencil_modifier.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 7640945e451..f0858ed49d8 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -733,6 +733,7 @@ class GreasePencilSimplifyPanel:
         col = layout.column()
         col.prop(rd, "simplify_gpencil_onplay")
         col.prop(rd, "simplify_gpencil_view_fill")
+        col.prop(rd, "simplify_gpencil_modifier")
         col.prop(rd, "simplify_gpencil_shader_fx")
         col.prop(rd, "simplify_gpencil_tint")
         col.prop(rd, "simplify_gpencil_antialiasing")
diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index ed505f0bb8d..f22c43d2002 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -52,6 +52,8 @@ struct MDeformVert;
 #define GPENCIL_SIMPLIFY_FILL(scene, playing) \
   ((GPENCIL_SIMPLIFY_ONPLAY(playing) && (GPENCIL_SIMPLIFY(scene)) && \
     (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FILL)))
+#define GPENCIL_SIMPLIFY_MODIF(scene) \
+  ((GPENCIL_SIMPLIFY(scene) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_MODIFIER)))
 #define GPENCIL_SIMPLIFY_FX(scene, playing) \
   ((GPENCIL_SIMPLIFY_ONPLAY(playing) && (GPENCIL_SIMPLIFY(scene)) && \
     (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FX)))
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c
index ba76119a89e..c8671696c7f 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -864,7 +864,8 @@ void BKE_gpencil_prepare_eval_data(Depsgraph *depsgraph, Scene *scene, Object *o
 {
   bGPdata *gpd_eval = (bGPdata *)ob->data;
   const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_eval);
-  const bool do_modifiers = (bool)((!is_multiedit) && (ob->greasepencil_modifiers.first != NULL));
+  const bool do_modifiers = (bool)((!is_multiedit) && (ob->greasepencil_modifiers.first != NULL) &&
+                                   (!GPENCIL_SIMPLIFY_MODIF(scene)));
 
   if (!do_modifiers) {
     return;
@@ -932,8 +933,8 @@ void BKE_gpencil_modifiers_calc(Depsgraph *depsgraph, Scene *scene, Object *ob)
   bGPdata *gpd = (bGPdata *)ob->data;
   const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
   const bool is_render = (bool)(DEG_get_mode(depsgraph) == DAG_EVAL_RENDER);
-  const bool do_modifiers = (bool)((!is_multiedit) && (ob->greasepencil_modifiers.first != NULL));
-
+  const bool do_modifiers = (bool)((!is_multiedit) && (ob->greasepencil_modifiers.first != NULL) &&
+                                   (!GPENCIL_SIMPLIFY_MODIF(scene)));
   if (!do_modifiers) {
     return;
   }
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 23ceb63ae94..257fd7c57fb 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -2274,6 +2274,8 @@ typedef enum eGPencil_SimplifyFlags {
   SIMPLIFY_GPENCIL_ON_PLAY = (1 << 1),
   /* Simplify fill on viewport */
   SIMPLIFY_GPENCIL_FILL = (1 << 2),
+  /* Simplify modifier on viewport */
+  SIMPLIFY_GPENCIL_MODIFIER = (1 << 3),
   /* Simplify Shader FX */
   SIMPLIFY_GPENCIL_FX = (1 << 5),
   /* Simplify layer tint */
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index ddf84889dc7..f24497b1120 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -6308,6 +6308,12 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Fill", "Display fill strokes in the viewport");
   RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
 
+  prop = RNA_def_property(srna, "simplify_gpencil_modifier", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(
+      prop, NULL, "simplify_gpencil", SIMPLIFY_GPENCIL_MODIFIER);
+  RNA_def_property_ui_text(prop, "Modifiers", "Display modifiers");
+  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
   prop = RNA_def_property(srna, "simplify_gpencil_shader_fx", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_negative_sdna(prop, NULL, "simplify_gpencil", SIMPLIFY_GPENCIL_FX);
   RNA_def_property_ui_text(prop, "ShadersFX", "Display Shader FX");



More information about the Bf-blender-cvs mailing list