[Bf-blender-cvs] [91f7ba14f22] greasepencil-object: Remove "Continuous Drawing" flag/mode

Joshua Leung noreply at git.blender.org
Thu Jun 28 11:37:55 CEST 2018


Commit: 91f7ba14f22b2bd44c06e44a03e5dc7b84867381
Author: Joshua Leung
Date:   Thu Jun 28 21:25:49 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rB91f7ba14f22b2bd44c06e44a03e5dc7b84867381

Remove "Continuous Drawing" flag/mode

* GP Object doesn't need this as it has a proper "Draw Mode"

* For Annotations, it just got in the way and was a confusing
  modal+blocking nuissance that randomly activates when you just
  want to draw a quick line

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

M	source/blender/editors/gpencil/annotate_paint.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 6210f50d43e..42744826ddf 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -1682,9 +1682,7 @@ static void gpencil_draw_status_indicators(bContext *C, tGPsdata *p)
 	/* header prints */
 	switch (p->status) {
 		case GP_STATUS_PAINTING:
-			/* only print this for paint-sessions, otherwise it gets annoying */
-			if (GPENCIL_SKETCH_SESSIONS_ON(p->scene))
-				ED_workspace_status_text(C, IFACE_("Grease Pencil: Drawing/erasing stroke... Release to end stroke"));
+			// TODO: Indicate how to use Poly mode
 			break;
 
 		case GP_STATUS_IDLING:
@@ -2139,14 +2137,10 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
 			 *   is essential for ensuring that they can quickly return to that view
 			 */
 		}
-		else if ((ELEM(event->type, p->keymodifier)) && (event->val == KM_RELEASE)) {
-			/* enable continuous if release D key in mid drawing */
-			p->scene->toolsettings->gpencil_flags |= GP_TOOL_FLAG_PAINTSESSIONS_ON;
-		}
 		else if ((event->type == BKEY) && (event->val == KM_RELEASE)) {
 			/* Add Blank Frame
 			 * - Since this operator is non-modal, we can just call it here, and keep going...
-	         * - This operator is especially useful when animating
+			 * - This operator is especially useful when animating
 			 */
 			WM_operator_name_call(C, "GPENCIL_OT_blank_frame_add", WM_OP_EXEC_DEFAULT, NULL);
 			estate = OPERATOR_RUNNING_MODAL;
@@ -2188,10 +2182,8 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
 			int sketch = 0;
 
 			/* basically, this should be mouse-button up = end stroke
-			 * BUT what happens next depends on whether we 'painting sessions' is enabled
+			 * BUT, polyline drawing is an exception -- all knots should be added during one session
 			 */
-			sketch |= GPENCIL_SKETCH_SESSIONS_ON(p->scene);
-			/* polyline drawing is also 'sketching' -- all knots should be added during one session */
 			sketch |= (p->paintmode == GP_PAINTMODE_DRAW_POLY);
 
 			if (sketch) {
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index eb44a251743..dc56f5c10db 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -2339,9 +2339,7 @@ static void gpencil_draw_status_indicators(bContext *C, tGPsdata *p)
 	/* header prints */
 	switch (p->status) {
 		case GP_STATUS_PAINTING:
-			/* only print this for paint-sessions, otherwise it gets annoying */
-			if (GPENCIL_SKETCH_SESSIONS_ON(p->scene))
-				ED_workspace_status_text(C, IFACE_("Grease Pencil: Drawing/erasing stroke... Release to end stroke"));
+			// TODO: Indicate how to use "Poly" mode
 			break;
 
 		case GP_STATUS_IDLING:
@@ -2938,12 +2936,6 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
 			 *   is essential for ensuring that they can quickly return to that view
 			 */
 		}
-		else if ((ELEM(event->type, p->keymodifier)) && (event->val == KM_RELEASE)) {
-			/* enable continuous if release D key in mid drawing */
-			if (p->sa->spacetype != SPACE_VIEW3D) {
-				p->scene->toolsettings->gpencil_flags |= GP_TOOL_FLAG_PAINTSESSIONS_ON;
-			}
-		}
 		else if ((event->type == BKEY) && (event->val == KM_RELEASE)) {
 			/* Add Blank Frame
 			 * - Since this operator is non-modal, we can just call it here, and keep going...
@@ -2992,10 +2984,8 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
 			int sketch = 0;
 
 			/* basically, this should be mouse-button up = end stroke
-			 * BUT what happens next depends on whether we 'painting sessions' is enabled
+			 * BUT, polyline drawing is an exception -- all knots should be added during one session
 			 */
-			sketch |= GPENCIL_SKETCH_SESSIONS_ON(p->scene);
-			/* polyline drawing is also 'sketching' -- all knots should be added during one session */
 			sketch |= (p->paintmode == GP_PAINTMODE_DRAW_POLY);
 
 			if (sketch) {
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 32798e56f49..0bfb74389ae 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -452,9 +452,6 @@ typedef enum eGP_DepthOrdering {
 /* ***************************************** */
 /* Mode Checking Macros */
 
-/* Check if 'sketching sessions' are enabled */
-#define GPENCIL_SKETCH_SESSIONS_ON(scene) ((scene)->toolsettings->gpencil_flags & GP_TOOL_FLAG_PAINTSESSIONS_ON)
-
 /* Check if 'multiedit sessions' is enabled */
 #define GPENCIL_MULTIEDIT_SESSIONS_ON(gpd) \
 	((gpd) && (gpd->flag & \
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 9850aee4951..da070175bfd 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -2041,8 +2041,6 @@ typedef enum eImagePaintMode {
 
 /* ToolSettings.gpencil_flags */
 typedef enum eGPencil_Flags {
-	/* "Continuous Drawing" - The drawing operator enters a mode where multiple strokes can be drawn */
-	GP_TOOL_FLAG_PAINTSESSIONS_ON       = (1 << 0),
 	/* When creating new frames, the last frame gets used as the basis for the new one */
 	GP_TOOL_FLAG_RETAIN_LAST            = (1 << 1),
 	/* Add the strokes below all strokes in the layer */
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 2223da10710..ef1a064c44b 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2397,12 +2397,6 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
 	RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ToolSettings_manipulator_flag_update");
 
 	/* Grease Pencil */
-	prop = RNA_def_property(srna, "use_gpencil_continuous_drawing", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINTSESSIONS_ON);
-	RNA_def_property_ui_text(prop, "Use Continuous Drawing",
-	                         "Allow drawing multiple strokes at a time with Grease Pencil");
-	RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* xxx: need toolbar to be redrawn... */
-
 	prop = RNA_def_property(srna, "use_gpencil_additive_drawing", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_RETAIN_LAST);
 	RNA_def_property_ui_text(prop, "Use Additive Drawing",



More information about the Bf-blender-cvs mailing list