[Bf-blender-cvs] [563e17091da] blender2.8: GP: Add Simplify Shader FX option

Antonioya noreply at git.blender.org
Mon Aug 6 17:01:58 CEST 2018


Commit: 563e17091daf9d8df236dfe50c6522d0f0933571
Author: Antonioya
Date:   Mon Aug 6 17:01:47 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB563e17091daf9d8df236dfe50c6522d0f0933571

GP: Add Simplify Shader FX option

This option was missing when old VFX modifers were backported as Shader FX.

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

M	release/scripts/startup/bl_ui/properties_scene.py
M	source/blender/draw/engines/gpencil/gpencil_engine.c
M	source/blender/draw/engines/gpencil/gpencil_engine.h
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_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index e324e7a9882..5d87b858da6 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -589,6 +589,7 @@ class SCENE_PT_simplify_greasepencil(SceneButtonsPanel, Panel):
         col = layout.column()
         col.prop(rd, "simplify_gpencil_onplay", text="Playback Only")
         col.prop(rd, "simplify_gpencil_view_modifier", text="Modifiers")
+        col.prop(rd, "simplify_gpencil_shader_fx", text="ShaderFX")
 
         col = layout.column(align=True)
         col.prop(rd, "simplify_gpencil_view_fill")
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 8b8da3f2065..ae1f853d87c 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -353,6 +353,7 @@ void GPENCIL_cache_init(void *vedata)
 		/* save simplify flags (can change while drawing, so it's better to save) */
 		stl->storage->simplify_fill = GP_SIMPLIFY_FILL(scene, stl->storage->playing);
 		stl->storage->simplify_modif = GP_SIMPLIFY_MODIF(scene, stl->storage->playing);
+		stl->storage->simplify_fx = GP_SIMPLIFY_FX(scene, stl->storage->playing);
 
 		/* save pixsize */
 		stl->storage->pixsize = DRW_viewport_pixelsize_get();
@@ -465,7 +466,9 @@ void GPENCIL_cache_init(void *vedata)
 		}
 
 		/* create effects passes */
-		GPENCIL_create_fx_passes(psl);
+		if (!stl->storage->simplify_fx) {
+			GPENCIL_create_fx_passes(psl);
+		}
 	}
 }
 
@@ -559,7 +562,7 @@ void GPENCIL_cache_finish(void *vedata)
 			}
 			/* FX passses */
 			tGPencilObjectCache *cache = &stl->g_data->gp_object_cache[i];
-			if (!is_multiedit) {
+			if ((!stl->storage->simplify_fx) && (!is_multiedit)) {
 				DRW_gpencil_fx_prepare(&e_data, vedata, cache);
 			}
 		}
@@ -720,7 +723,9 @@ void GPENCIL_draw_scene(void *ved)
 					DRW_draw_pass(psl->drawing_pass);
 				}
 				/* fx passes */
-				if (BKE_shaderfx_has_gpencil(ob)) {
+				if ((!stl->storage->simplify_fx) &&
+					(BKE_shaderfx_has_gpencil(ob)))
+				{
 					stl->storage->tonemapping = 0;
 					DRW_gpencil_fx_draw(&e_data, vedata, cache);
 				}
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index 5d276490663..96a82e91010 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -53,6 +53,7 @@ struct RenderLayer;
 #define GP_SIMPLIFY_ONPLAY(playing) (((playing == true) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY)) || ((scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY) == 0))
 #define GP_SIMPLIFY_FILL(scene, playing) ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(scene)) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FILL)))
 #define GP_SIMPLIFY_MODIF(scene, playing) ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(scene)) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_MODIFIER)))
+#define GP_SIMPLIFY_FX(scene, playing) ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(scene)) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FX)))
 
 #define GP_IS_CAMERAVIEW ((rv3d != NULL) && (rv3d->persp == RV3D_CAMOB && v3d->camera))
 
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 6629eeae3fa..5a5614b775e 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -2067,7 +2067,9 @@ typedef enum eGPencil_SimplifyFlags {
 	/* Simplify modifier on viewport */
 	SIMPLIFY_GPENCIL_MODIFIER         = (1 << 3),
 	/* Remove fill external line */
-	SIMPLIFY_GPENCIL_REMOVE_FILL_LINE = (1 << 4)
+	SIMPLIFY_GPENCIL_REMOVE_FILL_LINE = (1 << 4),
+	/* Simplify Shader FX */
+	SIMPLIFY_GPENCIL_FX               = (1 << 5)
 } eGPencil_SimplifyFlags;
 
 /* ToolSettings.gpencil_*_align - Stroke Placement mode flags */
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index c8f1d810b00..6e572b084d4 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -5211,6 +5211,11 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Disable Modifiers", "Do not apply modifiers in the viewport");
 	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_sdna(prop, NULL, "simplify_gpencil", SIMPLIFY_GPENCIL_FX);
+	RNA_def_property_ui_text(prop, "Simplify Shaders", "Do not apply shader fx");
+	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
 	/* persistent data */
 	prop = RNA_def_property(srna, "use_persistent_data", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "mode", R_PERSISTENT_DATA);



More information about the Bf-blender-cvs mailing list