diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-01 13:21:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-01 13:21:45 +0400 |
commit | 75494ea5b4dd6554699a563027b73248188b06dc (patch) | |
tree | 8a156d2a035ca2756ad24728e153172e116a35da | |
parent | 76d4c75881bf88357033abd685724d1a6a481332 (diff) |
- remove UV_OT_select_inverse, instead use invert option for UV_OT_select_all.
- fixed INVERT option for UV_OT_select_all.
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 2 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 62 |
2 files changed, 3 insertions, 61 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index bd8d9db2cd5..da6318ed39e 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -91,7 +91,7 @@ class IMAGE_MT_select(bpy.types.Menu): layout.separator() layout.operator("uv.select_all") - layout.operator("uv.select_inverse") + layout.operator("uv.select_all", text="Inverse").action = 'INVERT' layout.operator("uv.unlink_selected") layout.separator() diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 494cf7dee83..eee7a3d7f69 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -1308,59 +1308,6 @@ static void UV_OT_stitch(wmOperatorType *ot) /* ******************** (de)select all operator **************** */ -static int select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) -{ - Scene *scene; - ToolSettings *ts; - Object *obedit; - EditMesh *em; - EditFace *efa; - Image *ima; - MTFace *tf; - - scene= CTX_data_scene(C); - ts= CTX_data_tool_settings(C); - obedit= CTX_data_edit_object(C); - em= BKE_mesh_get_editmesh((Mesh*)obedit->data); - ima= CTX_data_edit_image(C); - - if(ts->uv_flag & UV_SYNC_SELECTION) { - EM_select_swap(em); - } - else { - for(efa= em->faces.first; efa; efa= efa->next) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - - if(uvedit_face_visible(scene, ima, efa, tf)) { - tf->flag ^= TF_SEL1; - tf->flag ^= TF_SEL2; - tf->flag ^= TF_SEL3; - if(efa->v4) tf->flag ^= TF_SEL4; - } - } - } - - WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); - - BKE_mesh_end_editmesh(obedit->data, em); - return OPERATOR_FINISHED; -} - -static void UV_OT_select_inverse(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Select Inverse"; - ot->description= "Select inverse of (un)selected UV vertices"; - ot->idname= "UV_OT_select_inverse"; - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* api callbacks */ - ot->exec= select_inverse_exec; - ot->poll= ED_operator_uvedit; -} - -/* ******************** (de)select all operator **************** */ - static int select_all_exec(bContext *C, wmOperator *op) { Scene *scene; @@ -1425,11 +1372,7 @@ static int select_all_exec(bContext *C, wmOperator *op) tf->flag &= ~select_flag; break; case SEL_INVERT: - if ((tf->flag & select_flag) == select_flag) { - tf->flag &= ~select_flag; - } else { - tf->flag &= ~select_flag; - } + tf->flag ^= select_flag; break; } } @@ -3196,7 +3139,6 @@ static void UV_OT_tile_set(wmOperatorType *ot) void ED_operatortypes_uvedit(void) { WM_operatortype_append(UV_OT_select_all); - WM_operatortype_append(UV_OT_select_inverse); WM_operatortype_append(UV_OT_select); WM_operatortype_append(UV_OT_select_loop); WM_operatortype_append(UV_OT_select_linked); @@ -3258,7 +3200,7 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "UV_OT_unlink_selected", LKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "UV_OT_select_all", AKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "UV_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(WM_keymap_add_item(keymap, "UV_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "action", SEL_INVERT); WM_keymap_add_item(keymap, "UV_OT_select_pinned", PKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_menu(keymap, "IMAGE_MT_uvs_weldalign", WKEY, KM_PRESS, 0, 0); |