Removed non working operator options from the 'redo' user interface.

This cleans up things like transform and duplicate a lot, which previously exposed lots of options that didn't work with tweaking.
This commit is contained in:
2010-06-06 15:38:50 +00:00
parent 640fb84bed
commit 8eaa8a0763
4 changed files with 42 additions and 15 deletions

View File

@@ -1104,6 +1104,8 @@ static int insert_key_exec (bContext *C, wmOperator *op)
void ANIM_OT_keyframe_insert (wmOperatorType *ot)
{
PropertyRNA *prop;
/* identifiers */
ot->name= "Insert Keyframe";
ot->idname= "ANIM_OT_keyframe_insert";
@@ -1119,11 +1121,13 @@ void ANIM_OT_keyframe_insert (wmOperatorType *ot)
/* keyingset to use
* - here the type is int not enum, since many of the indicies here are determined dynamically
*/
RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
prop= RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
RNA_def_property_flag(prop, PROP_HIDDEN);
/* confirm whether a keyframe was added by showing a popup
* - by default, this is enabled, since this operator is assumed to be called independently
*/
RNA_def_boolean(ot->srna, "confirm_success", 1, "Confirm Successful Insert", "Show a popup when the keyframes get successfully added");
prop= RNA_def_boolean(ot->srna, "confirm_success", 1, "Confirm Successful Insert", "Show a popup when the keyframes get successfully added");
RNA_def_property_flag(prop, PROP_HIDDEN);
}
/* Insert Key Operator (With Menu) ------------------------ */
@@ -1152,6 +1156,8 @@ static int insert_key_menu_invoke (bContext *C, wmOperator *op, wmEvent *event)
void ANIM_OT_keyframe_insert_menu (wmOperatorType *ot)
{
PropertyRNA *prop;
/* identifiers */
ot->name= "Insert Keyframe Menu";
ot->idname= "ANIM_OT_keyframe_insert_menu";
@@ -1167,17 +1173,20 @@ void ANIM_OT_keyframe_insert_menu (wmOperatorType *ot)
/* keyingset to use
* - here the type is int not enum, since many of the indicies here are determined dynamically
*/
RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
prop= RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
RNA_def_property_flag(prop, PROP_HIDDEN);
/* confirm whether a keyframe was added by showing a popup
* - by default, this is disabled so that if a menu is shown, this doesn't come up too
*/
// XXX should this just be always on?
RNA_def_boolean(ot->srna, "confirm_success", 0, "Confirm Successful Insert", "Show a popup when the keyframes get successfully added");
prop= RNA_def_boolean(ot->srna, "confirm_success", 0, "Confirm Successful Insert", "Show a popup when the keyframes get successfully added");
RNA_def_property_flag(prop, PROP_HIDDEN);
/* whether the menu should always be shown
* - by default, the menu should only be shown when there is no active Keying Set (2.5 behaviour),
* although in some cases it might be useful to always shown (pre 2.5 behaviour)
*/
RNA_def_boolean(ot->srna, "always_prompt", 0, "Always Show Menu", "");
prop= RNA_def_boolean(ot->srna, "always_prompt", 0, "Always Show Menu", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
}
/* Delete Key Operator ------------------------ */

View File

@@ -1515,6 +1515,8 @@ static EnumPropertyItem prop_gpencil_drawmodes[] = {
void GPENCIL_OT_draw (wmOperatorType *ot)
{
PropertyRNA *prop;
/* identifiers */
ot->name= "Grease Pencil Draw";
ot->idname= "GPENCIL_OT_draw";
@@ -1531,6 +1533,8 @@ void GPENCIL_OT_draw (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
/* settings for drawing */
RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements.");
prop= RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements.");
RNA_def_property_flag(prop, PROP_HIDDEN);
RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
}

View File

@@ -1675,6 +1675,8 @@ static int duplicate_exec(bContext *C, wmOperator *op)
void OBJECT_OT_duplicate(wmOperatorType *ot)
{
PropertyRNA *prop;
/* identifiers */
ot->name= "Duplicate";
ot->description = "Duplicate selected objects";
@@ -1689,7 +1691,8 @@ void OBJECT_OT_duplicate(wmOperatorType *ot)
/* to give to transform */
RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data.");
RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX);
prop= RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_HIDDEN);
}
/* **************** add named object, for dragdrop ************* */

View File

@@ -392,15 +392,21 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
{
prop= RNA_def_property(ot->srna, "axis", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_array(prop, 3);
RNA_def_property_flag(prop, PROP_HIDDEN);
RNA_def_property_ui_text(prop, "Axis", "The axis around which the transformation occurs");
}
if (flags & P_CONSTRAINT)
{
RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", "");
prop= RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
prop= RNA_def_property(ot->srna, "constraint_orientation", PROP_ENUM, PROP_NONE);
RNA_def_property_flag(prop, PROP_HIDDEN);
RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
RNA_def_enum_funcs(prop, rna_TransformOrientation_itemf);
}
if (flags & P_MIRROR)
@@ -418,22 +424,27 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
if (flags & P_SNAP)
{
RNA_def_boolean(ot->srna, "snap", 0, "Use Snapping Options", "");
prop= RNA_def_boolean(ot->srna, "snap", 0, "Use Snapping Options", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
if (flags & P_GEO_SNAP) {
RNA_def_enum(ot->srna, "snap_target", snap_target_items, 0, "Target", "");
RNA_def_float_vector(ot->srna, "snap_point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", "", -FLT_MAX, FLT_MAX);
prop= RNA_def_enum(ot->srna, "snap_target", snap_target_items, 0, "Target", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
prop= RNA_def_float_vector(ot->srna, "snap_point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", "", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(prop, PROP_HIDDEN);
if (flags & P_ALIGN_SNAP) {
RNA_def_boolean(ot->srna, "snap_align", 0, "Align with Point Normal", "");
RNA_def_float_vector(ot->srna, "snap_normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "", -FLT_MAX, FLT_MAX);
prop= RNA_def_boolean(ot->srna, "snap_align", 0, "Align with Point Normal", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
prop= RNA_def_float_vector(ot->srna, "snap_normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(prop, PROP_HIDDEN);
}
}
}
// Add confirm method all the time. At the end because it's not really that important and should be hidden
prop = RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "Always confirm operation when releasing button");
//RNA_def_property_flag(prop, PROP_HIDDEN);
RNA_def_property_flag(prop, PROP_HIDDEN);
}
void TRANSFORM_OT_translate(struct wmOperatorType *ot)