[Bf-blender-cvs] [5f9b2ae2f00] greasepencil-object: Add option to disable fast drawing

Antonio Vazquez noreply at git.blender.org
Wed Sep 13 20:33:12 CEST 2017


Commit: 5f9b2ae2f00e420970e0738ae199283e23e76b11
Author: Antonio Vazquez
Date:   Wed Sep 13 20:32:57 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB5f9b2ae2f00e420970e0738ae199283e23e76b11

Add option to disable fast drawing

This option has been added to compare viewport speed while drawing, but maybe can be good to keep it.

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

M	release/scripts/startup/bl_ui/properties_scene.py
M	source/blender/draw/engines/gpencil/gpencil_engine.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_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index 98cc1a2c58e..cf1b4024aff 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -476,6 +476,9 @@ class SCENE_PT_gp_simplify(SceneButtonsPanel, Panel):
         col.prop(ts, "gpencil_simplify_render_modifier", text="Modifiers")
         col.prop(ts, "gpencil_simplify_render_vfx", text="VFX")
 
+        row = layout.row()
+        row.prop(ts, "gpencil_disable_fast_drawing")
+
 
 class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel):
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 856dd1687a0..ee8badaff56 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -258,7 +258,8 @@ static void GPENCIL_cache_init(void *vedata)
 		}
 		/* detect if painting session */
 		if ((obact) && (obact->gpd) && (obact->gpd->flag & GP_DATA_STROKE_PAINTMODE) 
-			&& (stl->storage->playing == 0)) 
+			&& (stl->storage->playing == 0) && 
+			((ts->gpencil_simplify & GP_TOOL_FLAG_DISABLE_FAST_DRAWING) == 0))
 		{
 			if (((obact->gpd->sbuffer_sflag & GP_STROKE_ERASER) == 0) && (obact->gpd->sbuffer_size > 0)) {
 				stl->g_data->session_flag = GP_DRW_PAINT_PAINTING;
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index f7b6926dfc3..f27421066bc 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -2269,6 +2269,8 @@ typedef enum eGPencil_SimplifyFlags {
 	GP_TOOL_FLAG_SIMPLIFY_RENDER_VFX = (1 << 7),
 	/* Remove fill external line */
 	GP_TOOL_FLAG_SIMPLIFY_REMOVE_LINE = (1 << 8),
+	/* Disable fast drawing */
+	GP_TOOL_FLAG_DISABLE_FAST_DRAWING = (1 << 9),
 } eGPencil_SimplifyFlags;
 
 /* toolsettings->gpencil_src */
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index c440a78ff92..1dbb08c2eaa 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -3915,6 +3915,11 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
 	RNA_def_property_ui_text(prop, "Fill", "Do not apply VFX modifiers on render");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
 
+	prop = RNA_def_property(srna, "gpencil_disable_fast_drawing", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "gpencil_simplify", GP_TOOL_FLAG_DISABLE_FAST_DRAWING);
+	RNA_def_property_ui_text(prop, "Disable Fast Drawing", "Disable fast drawing while painting");
+	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
 	/* Auto Keying */
 	prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);



More information about the Bf-blender-cvs mailing list