[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23804] trunk/blender/source/blender/ editors: moving textures up and down didnt move the material flag, made editmesh skin Ctrl+Alt+F

Campbell Barton ideasman42 at gmail.com
Tue Oct 13 10:55:12 CEST 2009


Revision: 23804
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23804
Author:   campbellbarton
Date:     2009-10-13 10:55:11 +0200 (Tue, 13 Oct 2009)

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

Modified Paths:
--------------
    trunk/blender/source/blender/editors/mesh/mesh_ops.c
    trunk/blender/source/blender/editors/render/render_shading.c

Modified: trunk/blender/source/blender/editors/mesh/mesh_ops.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/mesh_ops.c	2009-10-13 07:39:08 UTC (rev 23803)
+++ trunk/blender/source/blender/editors/mesh/mesh_ops.c	2009-10-13 08:55:11 UTC (rev 23804)
@@ -258,6 +258,7 @@
 
 	/* 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);

Modified: trunk/blender/source/blender/editors/render/render_shading.c
===================================================================
--- trunk/blender/source/blender/editors/render/render_shading.c	2009-10-13 07:39:08 UTC (rev 23803)
+++ trunk/blender/source/blender/editors/render/render_shading.c	2009-10-13 08:55:11 UTC (rev 23804)
@@ -697,6 +697,16 @@
 				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 @@
 				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);
 			}
 		}





More information about the Bf-blender-cvs mailing list