[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12147] trunk/blender/source/blender: re-arranged buttons from matts suggestions.

Campbell Barton cbarton at metavr.com
Wed Sep 26 08:46:08 CEST 2007


Revision: 12147
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12147
Author:   campbellbarton
Date:     2007-09-26 08:46:08 +0200 (Wed, 26 Sep 2007)

Log Message:
-----------
re-arranged buttons from matts suggestions. removed some unused vars and added some constants to replaced magick numbers for draw types.

Modified Paths:
--------------
    trunk/blender/source/blender/makesdna/DNA_space_types.h
    trunk/blender/source/blender/src/drawimage.c
    trunk/blender/source/blender/src/header_image.c
    trunk/blender/source/blender/src/transform_snap.c

Modified: trunk/blender/source/blender/makesdna/DNA_space_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_space_types.h	2007-09-25 14:39:04 UTC (rev 12146)
+++ trunk/blender/source/blender/makesdna/DNA_space_types.h	2007-09-26 06:46:08 UTC (rev 12147)
@@ -466,6 +466,11 @@
 #define SI_TEXTURE		0
 #define SI_SHOW			1
 
+#define SI_UVDT_DASH	0
+#define SI_UVDT_BLACK	1
+#define SI_UVDT_WHITE	2
+#define SI_UVDT_OUTLINE	3
+
 /* SpaceImage->flag */
 #define SI_BE_SQUARE	1<<0
 #define SI_EDITTILE		1<<1

Modified: trunk/blender/source/blender/src/drawimage.c
===================================================================
--- trunk/blender/source/blender/src/drawimage.c	2007-09-25 14:39:04 UTC (rev 12146)
+++ trunk/blender/source/blender/src/drawimage.c	2007-09-26 06:46:08 UTC (rev 12147)
@@ -583,8 +583,16 @@
 		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 	}
 
+
+#define SI_UVDT_DASH	0
+#define SI_UVDT_BLACK	1
+#define SI_UVDT_WHITE	2
+#define SI_UVDT_OUTLINE	3
+
+	
+	
 	switch (G.sima->dt_uv) {
-	case 0:
+	case SI_UVDT_DASH:
 		for (efa= em->faces.first; efa; efa= efa->next) {
 //			tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
 //			if (SIMA_FACEDRAW_CHECK(efa, tface)) {
@@ -622,8 +630,8 @@
 			}
 		}
 		break;
-	case 1: /* black/white */
-	case 2: 
+	case SI_UVDT_BLACK: /* black/white */
+	case SI_UVDT_WHITE: 
 		cpack((G.sima->dt_uv==1) ? 0x0 : 0xFFFFFF);
 		for (efa= em->faces.first; efa; efa= efa->next) {
 //			tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
@@ -641,7 +649,7 @@
 			}
 		}
 		break;
-	case 3:
+	case SI_UVDT_OUTLINE:
 		glLineWidth(3);
 		cpack(0x0);
 		
@@ -685,43 +693,7 @@
 		glDisable( GL_LINE_SMOOTH);
 		glDisable(GL_BLEND);
 	}
-	
-	
-	/* draw active face edges */
-	
-	if (activetface) {
-		
-		
-		
-		
-		
-		
-		
-		
-		
-		
-		
-		
-		
-		
-		
 
-		
-		
-		
-		
-		
-		
-		
-		
-		
-		
-		
-		
-		
-		
-	}
-
     /* unselected uv's */
 	BIF_ThemeColor(TH_VERTEX);
 	pointsize = BIF_GetThemeValuef(TH_VERTEX_SIZE);
@@ -1200,10 +1172,10 @@
 	if (EM_texFaceCheck()) {
 		uiDefBut(block, LABEL, B_NOP, "Draw Type:",		10, 20,120,19, 0, 0, 0, 0, 0, "");
 		uiBlockBeginAlign(block);
-		uiDefButC(block,  ROW, B_REDR, "Dash",			10, 0,58,19, &G.sima->dt_uv, 0.0, 0.0, 0, 0, "Dashed Wire UV drawtype");
-		uiDefButC(block,  ROW, B_REDR, "Black",			68, 0,58,19, &G.sima->dt_uv, 0.0, 1.0, 0, 0, "Black Wire UV drawtype");
-		uiDefButC(block,  ROW, B_REDR, "White",			126,0,58,19, &G.sima->dt_uv, 0.0, 2.0, 0, 0, "White Wire UV drawtype");
-		uiDefButC(block,  ROW, B_REDR, "Outline",		184,0,58,19, &G.sima->dt_uv, 0.0, 3.0, 0, 0, "Outline Wire UV drawtype");
+		uiDefButC(block,  ROW, B_REDR, "Dash",			10, 0,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_DASH, 0, 0, "Dashed Wire UV drawtype");
+		uiDefButC(block,  ROW, B_REDR, "Black",			68, 0,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_WHITE, 0, 0, "Black Wire UV drawtype");
+		uiDefButC(block,  ROW, B_REDR, "White",			126,0,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_BLACK, 0, 0, "White Wire UV drawtype");
+		uiDefButC(block,  ROW, B_REDR, "Outline",		184,0,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_OUTLINE, 0, 0, "Outline Wire UV drawtype");
 		uiBlockBeginAlign(block);
 		uiDefButBitI(block, TOG, SI_SMOOTH_UV, B_REDR, "Smooth",	250,0,60,19,  &G.sima->flag, 0, 0, 0, 0, "Display smooth lines in the UV view");
 	}

Modified: trunk/blender/source/blender/src/header_image.c
===================================================================
--- trunk/blender/source/blender/src/header_image.c	2007-09-25 14:39:04 UTC (rev 12146)
+++ trunk/blender/source/blender/src/header_image.c	2007-09-26 06:46:08 UTC (rev 12147)
@@ -1159,13 +1159,25 @@
 	if (is_render)
 		allow_pin = 0;
 	
-	xco= std_libbuttons(block, xco, 0, allow_pin, &G.sima->pin, B_SIMABROWSE, ID_IM, 0, (ID *)ima, 0, &(G.sima->imanr), 0, 0, B_IMAGEDELETE, 0, 0);
+	xco= 8 + std_libbuttons(block, xco, 0, allow_pin, &G.sima->pin, B_SIMABROWSE, ID_IM, 0, (ID *)ima, 0, &(G.sima->imanr), 0, 0, B_IMAGEDELETE, 0, 0);
+	
+	if( ima && !ELEM3(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE, IMA_SRC_VIEWER) && ima->ok) {
 
+		if (ima->packedfile) {
+			headerbuttons_packdummy = 1;
+		}
+		if (ima->packedfile && ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
+			uiDefIconButBitI(block, TOG, 1, B_SIMA_REPACK, ICON_UGLYPACKAGE,	xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Re-Pack this image as PNG");
+		else
+			uiDefIconButBitI(block, TOG, 1, B_SIMAPACKIMA, ICON_PACKAGE,	xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Pack/Unpack this image");
+			
+		xco+= XIC+8;
+	}
+	
 	/* UV EditMode buttons, not painting or rencering or compositing */
 	if ( EM_texFaceCheck() && (G.sima->flag & SI_DRAWTOOL)==0 && !is_render) {
 		uiBut *ubut;
 		int layercount;
-		xco+=10;
 		
 		uiDefIconTextButS(block, ICONTEXTROW, B_NOP, ICON_ROTATE,
 				"Pivot: %t|Bounding Box Center %x0|Median Point %x3|2D Cursor %x1",
@@ -1174,7 +1186,7 @@
 		xco+= XIC + 18;
 		
 		uiBlockBeginAlign(block);
-		uiDefIconButBitI(block, TOG, SI_SYNC_UVSEL, B_REDR, ICON_MESH_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Sync Mesh Selection (vert & face selection mode override sticky)");
+		uiDefIconButBitI(block, TOGN, SI_SYNC_UVSEL, B_REDR, ICON_NO_GO_LEFT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Mesh independant selection");
 		xco+= XIC;
 		if ((G.sima->flag & SI_SYNC_UVSEL)==0) {
 			ubut = uiDefIconTextButC(block, ICONTEXTROW, B_REDR, ICON_STICKY_UVS_LOC,
@@ -1217,11 +1229,11 @@
 			str_pt = str_menu;
 			str_pt[0]='\0';
 			mesh_layers_menu_concat(&G.editMesh->fdata, CD_MTFACE, str_pt);
-			ubut = uiDefButI(block, MENU, B_NOP, str_menu ,xco,0,115,YIC, &act, 0, 0, 0, 0, "Active UV Layer for editing");
+			ubut = uiDefButI(block, MENU, B_NOP, str_menu ,xco,0,85,YIC, &act, 0, 0, 0, 0, "Active UV Layer for editing");
 			uiButSetFunc(ubut, do_image_buttons_set_uvlayer_callback, &act, NULL);
 			
 			/*MEM_freeN(str);*/
-			xco+= 120;
+			xco+= 90;
 		}
 	}
 	
@@ -1236,19 +1248,6 @@
 			uiBlockEndAlign(block);
 			xco+= 166;
 		}
-		if( !ELEM3(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE, IMA_SRC_VIEWER) && ima->ok) {
-
-			if (ima->packedfile) {
-				headerbuttons_packdummy = 1;
-			}
-			if (ima->packedfile && ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
-				uiDefIconButBitI(block, TOG, 1, B_SIMA_REPACK, ICON_UGLYPACKAGE,	xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Re-Pack this image as PNG");
-			else
-				uiDefIconButBitI(block, TOG, 1, B_SIMAPACKIMA, ICON_PACKAGE,	xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Pack/Unpack this image");
-				
-			xco+= XIC+8;
-		}
-		
 		uiDefIconButBitI(block, TOG, SI_DRAWTOOL, B_SIMAGEPAINTTOOL, ICON_TPAINT_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Enables painting textures on the image with left mouse button");
 		
 		xco+= XIC+8;

Modified: trunk/blender/source/blender/src/transform_snap.c
===================================================================
--- trunk/blender/source/blender/src/transform_snap.c	2007-09-25 14:39:04 UTC (rev 12146)
+++ trunk/blender/source/blender/src/transform_snap.c	2007-09-26 06:46:08 UTC (rev 12147)
@@ -400,17 +400,10 @@
 			}
 		}
 		else if (t->spacetype == SPACE_IMAGE)
-		{
-			
+		{	/* same as above but for UV's */
 			MTFace *nearesttf=NULL;
-			unsigned int face_corner;
+			int face_corner;
 			
-			float vec[3];
-			int found = 0;
-			int dist = 40; // Use a user defined value here
-			
-			// use findnearestverts in vert mode, others in other modes
-			//nearest = findnearestvert(&dist, SELECT, 1);
 			find_nearest_uv(&nearesttf, NULL, NULL, &face_corner);
 			
 			if (nearesttf != NULL)
@@ -424,8 +417,6 @@
 			{
 				t->tsnap.status &= ~POINT_INIT;
 			}
-			
-			
 		}
 		
 		





More information about the Bf-blender-cvs mailing list