moving textures up and down didnt move the material flag, made editmesh skin Ctrl+Alt+F

This commit is contained in:
2009-10-13 08:55:11 +00:00
parent 4063c230af
commit 8f25c0a799
2 changed files with 21 additions and 0 deletions

View File

@@ -258,6 +258,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
/* add/remove */
WM_keymap_add_item(keymap, "MESH_OT_edge_face_add", FKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "MESH_OT_skin", FKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); /* python */
WM_keymap_add_item(keymap, "MESH_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
kmi= WM_keymap_add_item(keymap, "WM_OT_call_menu", AKEY, KM_PRESS, KM_SHIFT, 0);

View File

@@ -697,6 +697,16 @@ static int texture_slot_move(bContext *C, wmOperator *op)
mtexswap = mtex_ar[act];
mtex_ar[act] = mtex_ar[act-1];
mtex_ar[act-1] = mtexswap;
if(GS(id->name)==ID_MA) {
Material *ma= (Material *)id;
int mtexuse = ma->septex & (1<<act);
ma->septex &= ~(1<<act);
ma->septex |= (ma->septex & (1<<(act-1))) << 1;
ma->septex &= ~(1<<(act-1));
ma->septex |= mtexuse >> 1;
}
set_active_mtex(id, act-1);
}
}
@@ -705,6 +715,16 @@ static int texture_slot_move(bContext *C, wmOperator *op)
mtexswap = mtex_ar[act];
mtex_ar[act] = mtex_ar[act+1];
mtex_ar[act+1] = mtexswap;
if(GS(id->name)==ID_MA) {
Material *ma= (Material *)id;
int mtexuse = ma->septex & (1<<act);
ma->septex &= ~(1<<act);
ma->septex |= (ma->septex & (1<<(act+1))) >> 1;
ma->septex &= ~(1<<(act+1));
ma->septex |= mtexuse << 1;
}
set_active_mtex(id, act+1);
}
}