[Bf-blender-cvs] [ca6588d5da5] greasepencil-object: Delete with Border select in paint mode

Antonio Vazquez noreply at git.blender.org
Fri Dec 15 12:35:18 CET 2017


Commit: ca6588d5da53f7ec7b5d485a772784d11ff18eb3
Author: Antonio Vazquez
Date:   Fri Dec 15 12:34:31 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rBca6588d5da53f7ec7b5d485a772784d11ff18eb3

Delete with Border select in paint mode

This commit is similar to Lasso, but for border select.

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index fcfb485e586..402406fa21d 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -947,16 +947,11 @@ void GPENCIL_OT_select_circle(wmOperatorType *ot)
 static int gpencil_border_select_exec(bContext *C, wmOperator *op)
 {
 	bGPdata *gpd = ED_gpencil_data_get_active(C);
-	/* if not edit/sculpt mode, the event is catched but not processed */
-	if (GPENCIL_NONE_EDIT_MODE(gpd)) {
-		return OPERATOR_CANCELLED;
-	}
-
 	ScrArea *sa = CTX_wm_area(C);
 	
 	const bool select = !RNA_boolean_get(op->ptr, "deselect");
-	const bool extend = RNA_boolean_get(op->ptr, "extend");
-	
+	const bool extend = RNA_boolean_get(op->ptr, "extend") && ((gpd->flag & GP_DATA_STROKE_PAINTMODE) == 0);
+
 	GP_SpaceConversion gsc = {NULL};
 	rcti rect = {0};
 	
@@ -1025,6 +1020,13 @@ static int gpencil_border_select_exec(bContext *C, wmOperator *op)
 	}
 	GP_EDITABLE_STROKES_END;
 
+	/* if paint mode,delete selected points */
+	if (gpd->flag & GP_DATA_STROKE_PAINTMODE) {
+		gp_delete_selected_point_wrap(C);
+		changed = true;
+		BKE_gpencil_batch_cache_dirty(gpd);
+	}
+
 	/* updates */
 	if (changed) {
 		WM_event_add_notifier(C, NC_GPENCIL | NA_SELECTED, NULL);



More information about the Bf-blender-cvs mailing list