From 8eaa8a07631f617037b36fbab0b58dfaff95a031 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Sun, 6 Jun 2010 15:38:50 +0000 Subject: 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. --- source/blender/editors/animation/keyframing.c | 19 ++++++++++++----- source/blender/editors/gpencil/gpencil_paint.c | 6 +++++- source/blender/editors/object/object_add.c | 5 ++++- source/blender/editors/transform/transform_ops.c | 27 +++++++++++++++++------- 4 files changed, 42 insertions(+), 15 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index e7689df9535..98fcf04a5c1 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -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 ------------------------ */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index c4df1bde1c2..e06722c1af1 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -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", ""); } diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 140a22c3c99..73fbc8e2795 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -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 ************* */ diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 4571cc0ace9..9f21662398a 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -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) -- cgit v1.2.3