From 43fab448f31b910409f03e1d9c1a2d74135a2b16 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 29 Jan 2015 17:34:05 +0100 Subject: Followup for previous commit: fix mismatches between menu entry and shortcut properties. For now, did most of the changes in menu entries (i.e. py space UI scripts). Note we do not get 100% same results as previously, but current situation is globally better than previous one, though the whole system to retrieve shortcuts remains a bit weak... --- source/blender/editors/object/object_relations.c | 12 +++++------- source/blender/editors/space_view3d/view3d_edit.c | 3 ++- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 67b5c8061cd..430994aed60 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -973,7 +973,7 @@ void OBJECT_OT_parent_set(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", prop_make_parent_types, 0, "Type", ""); + ot->prop = RNA_def_enum(ot->srna, "type", prop_make_parent_types, 0, "Type", ""); RNA_def_boolean(ot->srna, "xmirror", false, "X Mirror", "Apply weights symmetrically along X axis, for Envelope/Automatic vertex groups creation"); RNA_def_boolean(ot->srna, "keep_transform", false, "Keep Transform", @@ -2344,10 +2344,8 @@ void OBJECT_OT_make_local(wmOperatorType *ot) } enum { - /* Be careful with those values, they are used as bitflags in some cases, in others as bool... - * See single_object_users, single_obdata_users, single_object_action_users, etc.< */ - MAKE_SINGLE_USER_ALL = 0, - MAKE_SINGLE_USER_SELECTED = SELECT, + MAKE_SINGLE_USER_ALL = 1, + MAKE_SINGLE_USER_SELECTED = 2, }; static int make_single_user_exec(bContext *C, wmOperator *op) @@ -2355,7 +2353,7 @@ static int make_single_user_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); /* ok if this is NULL */ - const int flag = RNA_enum_get(op->ptr, "type"); + const int flag = (RNA_enum_get(op->ptr, "type") == MAKE_SINGLE_USER_SELECTED) ? SELECT : 0; const bool copy_groups = false; bool update_deps = false; @@ -2421,7 +2419,7 @@ void OBJECT_OT_make_single_user(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - ot->prop = RNA_def_enum(ot->srna, "type", type_items, SELECT, "Type", ""); + ot->prop = RNA_def_enum(ot->srna, "type", type_items, MAKE_SINGLE_USER_SELECTED, "Type", ""); RNA_def_boolean(ot->srna, "object", 0, "Object", "Make single user objects"); RNA_def_boolean(ot->srna, "obdata", 0, "Object Data", "Make single user object data"); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index aab307babe8..4b1d99b6165 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -3373,7 +3373,8 @@ void VIEW3D_OT_render_border(wmOperatorType *ot) /* rna */ WM_operator_properties_border(ot); - prop = RNA_def_boolean(ot->srna, "camera_only", 0, "Camera Only", "Set render border for camera view and final render only"); + prop = RNA_def_boolean(ot->srna, "camera_only", false, "Camera Only", + "Set render border for camera view and final render only"); RNA_def_property_flag(prop, PROP_HIDDEN); } -- cgit v1.2.3