[Bf-blender-cvs] [946a4fe85a1] master: WM: Don't save mouse-paths to operator history

Campbell Barton noreply at git.blender.org
Mon Oct 16 07:14:44 CEST 2017


Commit: 946a4fe85a1717001230ab5f256cf5cf10f045cb
Author: Campbell Barton
Date:   Mon Oct 16 16:11:04 2017 +1100
Branches: master
https://developer.blender.org/rB946a4fe85a1717001230ab5f256cf5cf10f045cb

WM: Don't save mouse-paths to operator history

In preparation for modal operators storing their properties,
no need to keep mouse-paths around.

Also use generic function for lasso properties.

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

M	source/blender/editors/gpencil/gpencil_brush.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_select.c
M	source/blender/editors/mask/mask_select.c
M	source/blender/editors/mesh/editmesh_tools.c
M	source/blender/editors/physics/particle_edit.c
M	source/blender/editors/sculpt_paint/paint_mask.c
M	source/blender/editors/sculpt_paint/paint_utils.c
M	source/blender/editors/space_action/action_select.c
M	source/blender/editors/space_clip/tracking_select.c
M	source/blender/editors/space_graph/graph_select.c
M	source/blender/editors/space_logic/logic_buttons.c
M	source/blender/editors/space_node/node_add.c
M	source/blender/editors/space_node/node_relationships.c
M	source/blender/editors/space_node/node_select.c
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/editors/uvedit/uvedit_ops.c
M	source/blender/windowmanager/WM_api.h
M	source/blender/windowmanager/intern/wm_operator_props.c

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

diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index e5fb162a96c..bb3800941ab 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -1851,8 +1851,6 @@ static int gpsculpt_brush_modal(bContext *C, wmOperator *op, const wmEvent *even
 
 void GPENCIL_OT_brush_paint(wmOperatorType *ot)
 {
-	PropertyRNA *prop;
-	
 	/* identifiers */
 	ot->name = "Stroke Sculpt";
 	ot->idname = "GPENCIL_OT_brush_paint";
@@ -1869,7 +1867,9 @@ void GPENCIL_OT_brush_paint(wmOperatorType *ot)
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
 
 	/* properties */
-	RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
+	PropertyRNA *prop;
+	prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
+	RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
 	
 	prop = RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input",
 	                       "Enter a mini 'sculpt-mode' if enabled, otherwise, exit after drawing a single stroke");
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index eb49060b629..ea87364d67f 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -2761,8 +2761,10 @@ void GPENCIL_OT_draw(wmOperatorType *ot)
 	ot->flag = OPTYPE_UNDO | OPTYPE_BLOCKING;
 	
 	/* settings for drawing */
+	PropertyRNA *prop;
 	ot->prop = RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to interpret mouse movements");
-	RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
+	prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
+	RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
 	
 	/* NOTE: wait for input is enabled by default, so that all UI code can work properly without needing users to know about this */
 	RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", "Wait for first click instead of painting immediately");
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index 700a1dc9439..b552a1c99f8 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -1053,9 +1053,8 @@ void GPENCIL_OT_select_lasso(wmOperatorType *ot)
 	/* flags */
 	ot->flag = OPTYPE_UNDO;
 	
-	RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", "");
-	RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect rather than select items");
-	RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first");
+	/* properties */
+	WM_operator_properties_gesture_lasso(ot);
 }
 
 /* ********************************************** */
diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c
index 990b07066b1..a7215a4b653 100644
--- a/source/blender/editors/mask/mask_select.c
+++ b/source/blender/editors/mask/mask_select.c
@@ -580,9 +580,7 @@ void MASK_OT_select_lasso(wmOperatorType *ot)
 	ot->flag = OPTYPE_UNDO;
 
 	/* properties */
-	RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", "");
-	RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect rather than select items");
-	RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first");
+	WM_operator_properties_gesture_lasso(ot);
 }
 
 /********************** circle select operator *********************/
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index c513c49aa8e..b1af1837a74 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -2978,8 +2978,6 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
 
 void MESH_OT_knife_cut(wmOperatorType *ot)
 {
-	PropertyRNA *prop;
-	
 	ot->name = "Knife Cut";
 	ot->description = "Cut selected edges and faces into parts";
 	ot->idname = "MESH_OT_knife_cut";
@@ -2992,10 +2990,13 @@ void MESH_OT_knife_cut(wmOperatorType *ot)
 	
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-	
+
+	/* properties */
+	PropertyRNA *prop;
+	prop = RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", "");
+	RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
+
 	RNA_def_enum(ot->srna, "type", knife_items, KNIFE_EXACT, "Type", "");
-	prop = RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
-	RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
 	
 	/* internal */
 	RNA_def_int(ot->srna, "cursor", BC_KNIFECURSOR, 0, BC_NUMCURSORS, "Cursor", "", 0, BC_NUMCURSORS);
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 72c5a74aee9..615a0f9b74d 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -4066,7 +4066,9 @@ void PARTICLE_OT_brush_edit(wmOperatorType *ot)
 	ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
 
 	/* properties */
-	RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
+	PropertyRNA *prop;
+	prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
+	RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
 }
 
 /*********************** cut shape ***************************/
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c
index a4887c579ac..ed7030c01d1 100644
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@ -506,8 +506,6 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
 
 void PAINT_OT_mask_lasso_gesture(wmOperatorType *ot)
 {
-	PropertyRNA *prop;
-
 	ot->name = "Mask Lasso Gesture";
 	ot->idname = "PAINT_OT_mask_lasso_gesture";
 	ot->description = "Add mask within the lasso as you move the brush";
@@ -520,8 +518,8 @@ void PAINT_OT_mask_lasso_gesture(wmOperatorType *ot)
 
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-	prop = RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
-	RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
+	/* properties */
+	WM_operator_properties_gesture_lasso_ex(ot, false, false);
 
 	RNA_def_enum(ot->srna, "mode", mode_items, PAINT_MASK_FLOOD_VALUE, "Mode", NULL);
 	RNA_def_float(ot->srna, "value", 1.0, 0, 1.0, "Value",
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 7668b8ebd99..b02e547d0df 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -217,7 +217,10 @@ void paint_stroke_operator_properties(wmOperatorType *ot)
 		{0}
 	};
 
-	RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
+	PropertyRNA *prop;
+
+	prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
+	RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
 
 	RNA_def_enum(ot->srna, "mode", stroke_mode_items, BRUSH_STROKE_NORMAL, 
 	             "Stroke Mode",
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 6d785e1f7df..22b7b1da77f 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -572,9 +572,7 @@ void ACTION_OT_select_lasso(wmOperatorType *ot)
 	ot->flag = OPTYPE_UNDO;
 	
 	/* properties */
-	RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", "");
-	RNA_def_boolean(ot->srna, "deselect", false, "Deselect", "Deselect rather than select items");
-	RNA_def_boolean(ot->srna, "extend", true, "Extend", "Extend selection instead of deselecting everything first");
+	WM_operator_properties_gesture_lasso(ot);
 }
 
 /* ------------------- */
diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c
index 3cbf1cf4e0c..6077379d420 100644
--- a/source/blender/editors/space_clip/tracking_select.c
+++ b/source/blender/editors/space_clip/tracking_select.c
@@ -656,9 +656,7 @@ void CLIP_OT_select_lasso(wmOperatorType *ot)
 	ot->flag = OPTYPE_UNDO;
 
 	/* properties */
-	RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", "");
-	RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect rather than select items");
-	RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first");
+	WM_operator_properties_gesture_lasso(ot);
 }
 
 /********************** circle select operator *********************/
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index dd4449b77f7..2d60946a200 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -486,9 +486,7 @@ void GRAPH_OT_select_lasso(wmOperatorType *ot)
 	ot->flag = OPTYPE_UNDO;
 	
 	/* properties */
-	RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", "");
-	RNA_def_boolean(ot->srna, "deselect", false, "Deselect", "Deselect rather than select items");
-	RNA_def_boolean(ot->srna, "extend", true, "Extend", "Extend selection instead of deselecting everything first");
+	WM_operator_properties_gesture_lasso(ot);
 }
 
 /* ------------------- */
diff --git a/source/blender/editors/space_logic/logic_buttons.c b/source/blender/editors/space_logic/logic_buttons.c
index e5eee21ed08..54e6e217b77 100644
--- a/source/blender/editors/space_logic/logic_buttons.c
+++ b/source/blender/editors/space_logic/logic_buttons.c
@@ -142,8 +142,6 @@ static int cut_links_exec(bContext *C, wmOperator *op)
 
 void LOGIC_OT_links_cut(wmOperatorType *ot)
 {
-	PropertyRNA *prop;
-	
 	ot->name = "Cut Links";
 	ot->idname = "LOGIC_OT_link

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list