UI: enable the depend-on-cursor flag for some operators
- Bend (Transform). - Extrude to Cursor. - Lasso Select (related operators such as node-cut links, mask.. etc). - Rip Mesh / UV's. - Vertex/Edge Slide.
This commit is contained in:
@@ -269,7 +269,7 @@ void ARMATURE_OT_click_extrude(wmOperatorType *ot)
|
||||
ot->poll = ED_operator_editarmature;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* props */
|
||||
}
|
||||
|
||||
@@ -5630,7 +5630,7 @@ void CURVE_OT_vertex_add(wmOperatorType *ot)
|
||||
ot->poll = ED_operator_editcurve;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
RNA_def_float_vector_xyz(ot->srna,
|
||||
|
||||
@@ -5243,7 +5243,7 @@ void GPENCIL_OT_stroke_cutter(wmOperatorType *ot)
|
||||
ot->cancel = WM_gesture_lasso_cancel;
|
||||
|
||||
/* flag */
|
||||
ot->flag = OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
WM_operator_properties_gesture_lasso(ot);
|
||||
|
||||
@@ -2347,7 +2347,7 @@ void GPENCIL_OT_select_lasso(wmOperatorType *ot)
|
||||
ot->cancel = WM_gesture_lasso_cancel;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
WM_operator_properties_select_operation(ot);
|
||||
|
||||
@@ -629,7 +629,7 @@ void MASK_OT_select_lasso(wmOperatorType *ot)
|
||||
ot->cancel = WM_gesture_lasso_cancel;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
WM_operator_properties_gesture_lasso(ot);
|
||||
|
||||
@@ -935,7 +935,7 @@ void MESH_OT_dupli_extrude_cursor(wmOperatorType *ot)
|
||||
ot->poll = ED_operator_editmesh_region_view3d;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
RNA_def_boolean(ot->srna,
|
||||
"rotate_source",
|
||||
|
||||
@@ -1124,7 +1124,7 @@ void MESH_OT_rip(wmOperatorType *ot)
|
||||
ot->poll = EDBM_view3d_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* to give to transform */
|
||||
Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR_DUMMY);
|
||||
|
||||
@@ -249,7 +249,7 @@ void MESH_OT_rip_edge(wmOperatorType *ot)
|
||||
ot->poll = EDBM_view3d_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* to give to transform */
|
||||
Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR_DUMMY);
|
||||
|
||||
@@ -4323,7 +4323,7 @@ void MESH_OT_knife_cut(wmOperatorType *ot)
|
||||
ot->poll = EDBM_view3d_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
PropertyRNA *prop;
|
||||
|
||||
@@ -1651,7 +1651,7 @@ void PAINT_OT_mask_lasso_gesture(wmOperatorType *ot)
|
||||
|
||||
ot->poll = SCULPT_mode_poll_view3d;
|
||||
|
||||
ot->flag = OPTYPE_REGISTER;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* Properties. */
|
||||
WM_operator_properties_gesture_lasso(ot);
|
||||
@@ -1714,6 +1714,8 @@ void SCULPT_OT_face_set_lasso_gesture(wmOperatorType *ot)
|
||||
|
||||
ot->poll = SCULPT_mode_poll_view3d;
|
||||
|
||||
ot->flag = OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* Properties. */
|
||||
WM_operator_properties_gesture_lasso(ot);
|
||||
sculpt_gesture_operator_properties(ot);
|
||||
@@ -1750,7 +1752,7 @@ void SCULPT_OT_trim_lasso_gesture(wmOperatorType *ot)
|
||||
|
||||
ot->poll = SCULPT_mode_poll_view3d;
|
||||
|
||||
ot->flag = OPTYPE_REGISTER;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* Properties. */
|
||||
WM_operator_properties_gesture_lasso(ot);
|
||||
|
||||
@@ -834,7 +834,7 @@ void ACTION_OT_select_lasso(wmOperatorType *ot)
|
||||
ot->cancel = WM_gesture_lasso_cancel;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
WM_operator_properties_gesture_lasso(ot);
|
||||
|
||||
@@ -721,7 +721,7 @@ void CLIP_OT_select_lasso(wmOperatorType *ot)
|
||||
ot->cancel = WM_gesture_lasso_cancel;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
WM_operator_properties_gesture_lasso(ot);
|
||||
|
||||
@@ -1006,7 +1006,7 @@ void GRAPH_OT_select_lasso(wmOperatorType *ot)
|
||||
ot->cancel = WM_gesture_lasso_cancel;
|
||||
|
||||
/* Flags. */
|
||||
ot->flag = OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* Properties. */
|
||||
WM_operator_properties_gesture_lasso(ot);
|
||||
|
||||
@@ -312,7 +312,7 @@ void NODE_OT_add_reroute(wmOperatorType *ot)
|
||||
ot->poll = ED_operator_node_editable;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
PropertyRNA *prop;
|
||||
|
||||
@@ -1427,7 +1427,7 @@ void NODE_OT_links_cut(wmOperatorType *ot)
|
||||
ot->poll = ED_operator_node_editable;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
PropertyRNA *prop;
|
||||
@@ -1533,7 +1533,7 @@ void NODE_OT_links_mute(wmOperatorType *ot)
|
||||
ot->poll = ED_operator_node_editable;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
PropertyRNA *prop;
|
||||
|
||||
@@ -923,7 +923,7 @@ void NODE_OT_select_lasso(wmOperatorType *ot)
|
||||
ot->cancel = WM_gesture_lasso_cancel;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
RNA_def_boolean(ot->srna,
|
||||
|
||||
@@ -1438,7 +1438,7 @@ void VIEW3D_OT_select_lasso(wmOperatorType *ot)
|
||||
ot->cancel = WM_gesture_lasso_cancel;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
WM_operator_properties_gesture_lasso(ot);
|
||||
|
||||
@@ -911,7 +911,8 @@ static void TRANSFORM_OT_bend(struct wmOperatorType *ot)
|
||||
ot->name = "Bend";
|
||||
ot->description = "Bend selected items between the 3D cursor and the mouse";
|
||||
ot->idname = OP_BEND;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
|
||||
/* Depend on cursor location because the cursor location is used to define the region to bend. */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* api callbacks */
|
||||
ot->invoke = transform_invoke;
|
||||
@@ -1091,7 +1092,7 @@ static void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot)
|
||||
ot->name = "Edge Slide";
|
||||
ot->description = "Slide an edge loop along a mesh";
|
||||
ot->idname = OP_EDGE_SLIDE;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* api callbacks */
|
||||
ot->invoke = transform_invoke;
|
||||
@@ -1129,7 +1130,7 @@ static void TRANSFORM_OT_vert_slide(struct wmOperatorType *ot)
|
||||
ot->name = "Vertex Slide";
|
||||
ot->description = "Slide a vertex along a mesh";
|
||||
ot->idname = OP_VERT_SLIDE;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* api callbacks */
|
||||
ot->invoke = transform_invoke;
|
||||
|
||||
@@ -953,7 +953,7 @@ void UV_OT_rip(wmOperatorType *ot)
|
||||
ot->name = "UV Rip";
|
||||
ot->description = "Rip selected vertices or a selected region";
|
||||
ot->idname = "UV_OT_rip";
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = uv_rip_exec;
|
||||
|
||||
@@ -3450,7 +3450,7 @@ void UV_OT_select_lasso(wmOperatorType *ot)
|
||||
ot->cancel = WM_gesture_lasso_cancel;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_UNDO;
|
||||
ot->flag = OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
/* properties */
|
||||
WM_operator_properties_gesture_lasso(ot);
|
||||
|
||||
@@ -818,6 +818,8 @@ void WM_OT_lasso_gesture(wmOperatorType *ot)
|
||||
|
||||
ot->poll = WM_operator_winactive;
|
||||
|
||||
ot->flag = OPTYPE_DEPENDS_ON_CURSOR;
|
||||
|
||||
prop = RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_struct_runtime(ot->srna, prop, &RNA_OperatorMousePath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user