WM: hide internal operator settings

These are set in the interface and aren't useful to show to users.

Other minor changes

- Rename 'Ruler/Protractor' -> 'Ruler'
- Rename Subdivide 'Quad/Tri Mode' -> 'Create N-Gons' (and invert).
This commit is contained in:
Campbell Barton 2018-06-12 22:00:22 +02:00
parent 94e0abda75
commit 98e0bd90f4
7 changed files with 24 additions and 16 deletions

View File

@ -108,7 +108,7 @@ class _defs_view3d_generic:
@ToolDef.from_fn
def ruler():
return dict(
text="Ruler/Protractor",
text="Ruler",
icon="ops.view3d.ruler",
widget="VIEW3D_WGT_ruler",
keymap=(

View File

@ -5803,7 +5803,7 @@ void CURVE_OT_delete(wmOperatorType *ot)
/* properties */
prop = RNA_def_enum(ot->srna, "type", curve_delete_type_items, 0, "Type", "Which elements to delete");
RNA_def_enum_funcs(prop, rna_curve_delete_type_itemf);
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
ot->prop = prop;
}

View File

@ -98,13 +98,13 @@ static int edbm_subdivide_exec(bContext *C, wmOperator *op)
const float fractal = RNA_float_get(op->ptr, "fractal") / 2.5f;
const float along_normal = RNA_float_get(op->ptr, "fractal_along_normal");
if (RNA_boolean_get(op->ptr, "quadtri") &&
if (RNA_boolean_get(op->ptr, "ngon") &&
RNA_enum_get(op->ptr, "quadcorner") == SUBD_CORNER_STRAIGHT_CUT)
{
RNA_enum_set(op->ptr, "quadcorner", SUBD_CORNER_INNERVERT);
}
const int quad_corner_type = RNA_enum_get(op->ptr, "quadcorner");
const bool use_quad_tri = RNA_boolean_get(op->ptr, "quadtri");
const bool use_quad_tri = !RNA_boolean_get(op->ptr, "ngon");
const int seed = RNA_int_get(op->ptr, "seed");
ViewLayer *view_layer = CTX_data_view_layer(C);
@ -170,7 +170,7 @@ void MESH_OT_subdivide(wmOperatorType *ot)
WM_operatortype_props_advanced_begin(ot);
RNA_def_boolean(ot->srna, "quadtri", 0, "Quad/Tri Mode", "Tries to prevent ngons");
RNA_def_boolean(ot->srna, "ngon", true, "Create N-Gons", "When disabled, newly created faces are limited to 3-4 sided faces");
RNA_def_enum(ot->srna, "quadcorner", prop_mesh_cornervert_types, SUBD_CORNER_STRAIGHT_CUT,
"Quad Corner Type", "How to subdivide quad corners (anything other than Straight Cut will prevent ngons)");
@ -512,6 +512,7 @@ void MESH_OT_delete(wmOperatorType *ot)
/* props */
ot->prop = RNA_def_enum(ot->srna, "type", prop_mesh_delete_types, MESH_DELETE_VERT,
"Type", "Method used for deleting mesh data");
RNA_def_property_flag(ot->prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
/** \} */
@ -1030,7 +1031,7 @@ void MESH_OT_mark_seam(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
prop = RNA_def_boolean(ot->srna, "clear", 0, "Clear", "");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
WM_operatortype_props_advanced_begin(ot);
}
@ -1103,7 +1104,7 @@ void MESH_OT_mark_sharp(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
prop = RNA_def_boolean(ot->srna, "clear", false, "Clear", "");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
prop = RNA_def_boolean(ot->srna, "use_verts", false, "Vertices",
"Consider vertices instead of edges to select which edges to (un)tag as sharp");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
@ -6829,7 +6830,7 @@ void MESH_OT_mark_freestyle_edge(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
prop = RNA_def_boolean(ot->srna, "clear", false, "Clear", "");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
/** \} */
@ -6912,7 +6913,7 @@ void MESH_OT_mark_freestyle_face(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
prop = RNA_def_boolean(ot->srna, "clear", false, "Clear", "");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
/** \} */

View File

@ -2252,7 +2252,7 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event)
case MOUSEMOVE:
{
const float aspect = BLI_rctf_size_x(&rmd->ar->v2d.cur) / (BLI_rcti_size_x(&rmd->ar->v2d.mask) + 1);
const int snap_size_threshold = (U.widget_unit * 3) / aspect;
const int snap_size_threshold = (U.widget_unit * 2) / aspect;
if (rmd->edge == AE_LEFT_TO_TOPRIGHT || rmd->edge == AE_RIGHT_TO_TOPLEFT) {
delta = event->x - rmd->origx;
if (rmd->edge == AE_LEFT_TO_TOPRIGHT) delta = -delta;

View File

@ -2071,7 +2071,9 @@ void TEXT_OT_delete(wmOperatorType *ot)
ot->flag = OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "type", delete_type_items, DEL_NEXT_CHAR, "Type", "Which part of the text to delete");
PropertyRNA *prop;
prop = RNA_def_enum(ot->srna, "type", delete_type_items, DEL_NEXT_CHAR, "Type", "Which part of the text to delete");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
/******************* toggle overwrite operator **********************/

View File

@ -560,17 +560,20 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
}
if (flags & P_GPENCIL_EDIT) {
RNA_def_boolean(ot->srna, "gpencil_strokes", 0, "Edit Grease Pencil", "Edit selected Grease Pencil strokes");
prop = RNA_def_boolean(ot->srna, "gpencil_strokes", 0, "Edit Grease Pencil", "Edit selected Grease Pencil strokes");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
if (flags & P_CURSOR_EDIT) {
RNA_def_boolean(ot->srna, "cursor_transform", 0, "Transform Cursor", "");
prop = RNA_def_boolean(ot->srna, "cursor_transform", 0, "Transform Cursor", "");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
if ((flags & P_OPTIONS) && !(flags & P_NO_TEXSPACE)) {
RNA_def_boolean(ot->srna, "texture_space", 0, "Edit Texture Space", "Edit Object data texture space");
prop = RNA_def_boolean(ot->srna, "texture_space", 0, "Edit Texture Space", "Edit Object data texture space");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
prop = RNA_def_boolean(ot->srna, "remove_on_cancel", 0, "Remove on Cancel", "Remove elements on cancel");
RNA_def_property_flag(prop, PROP_HIDDEN);
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
if (flags & P_CORRECT_UV) {

View File

@ -130,7 +130,9 @@ void WM_operator_properties_filesel(
static void wm_operator_properties_select_action_ex(wmOperatorType *ot, int default_action,
const EnumPropertyItem *select_actions)
{
RNA_def_enum(ot->srna, "action", select_actions, default_action, "Action", "Selection action to execute");
PropertyRNA *prop;
prop = RNA_def_enum(ot->srna, "action", select_actions, default_action, "Action", "Selection action to execute");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
void WM_operator_properties_select_action(wmOperatorType *ot, int default_action)