[Bf-blender-cvs] [2297161] GPencil_EditStrokes: Revert "All editable GPencil stroke points are now shown when editing is enabled"

Joshua Leung noreply at git.blender.org
Fri Nov 7 13:40:27 CET 2014


Commit: 22971615c293489d937136ce0aa9aa26c905c6ed
Author: Joshua Leung
Date:   Sat Nov 8 01:40:10 2014 +1300
Branches: GPencil_EditStrokes
https://developer.blender.org/rB22971615c293489d937136ce0aa9aa26c905c6ed

Revert "All editable GPencil stroke points are now shown when editing is enabled"

This reverts commit 9686e48bab7340a172b0c9b8aea1f685b531d29c.

In response to feedback, I've decided to revert this since it didn't really work
that great at all when you have dense drawings. At times, this would make it
almost impossible to see what you were doing.

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

M	source/blender/editors/gpencil/drawgpencil.c

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

diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 34e87b3..9098b3a 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -780,6 +780,13 @@ static void gp_draw_strokes_edit(bGPDframe *gpf, int offsx, int offsy, int winx,
 		if (gp_can_draw_stroke(gps, dflag) == false)
 			continue;
 		
+		/* Optimisation: only draw points for selected strokes
+		 * We assume that selected points can only occur in
+		 * strokes that are selected too.
+		 */
+		if ((gps->flag & GP_STROKE_SELECT) == 0)
+			continue;
+			
 		/* Get size of verts:
 		 * - The selected state needs to be larger than the unselected state so that
 		 *   they stand out more.
@@ -995,13 +1002,12 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy,
 		/* draw the strokes already in active frame */
 		gp_draw_strokes(gpf, offsx, offsy, winx, winy, dflag, debug, lthick, gpl->color, gpl->fill);
 		
-		/* Draw verts of strokes 
-		 *  - all points (in editable layers) are drawn, to make it clearer that
-		 *    edit mode is enabled
+		/* Draw verts of selected strokes 
 		 * 	- locked layers can't be edited, so there's no point showing these verts
 		 *    as they will have no bearings on what gets edited
 		 */
-		if ((gpd->flag & GP_DATA_STROKE_EDITMODE) && (gpl->flag & GP_LAYER_LOCKED) == 0) {
+		/* XXX: perhaps we don't want to show these when users are drawing... */
+		if ((gpl->flag & GP_LAYER_LOCKED) == 0) {
 			gp_draw_strokes_edit(gpf, offsx, offsy, winx, winy, dflag, 
 			                     (gpl->color[3] < 0.95f) ? gpl->color : NULL);
 		}




More information about the Bf-blender-cvs mailing list