[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11729] branches/imgbrowser-elubie/source/ blender/src/buttons_shading.c: Some more work on texture buttons.

Matt Ebb matt at mke3.net
Mon Aug 20 10:01:33 CEST 2007


Revision: 11729
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11729
Author:   broken
Date:     2007-08-20 10:01:33 +0200 (Mon, 20 Aug 2007)

Log Message:
-----------
Some more work on texture buttons. envmap panel is a bit screwy,
will get to it soon.

Modified Paths:
--------------
    branches/imgbrowser-elubie/source/blender/src/buttons_shading.c

Modified: branches/imgbrowser-elubie/source/blender/src/buttons_shading.c
===================================================================
--- branches/imgbrowser-elubie/source/blender/src/buttons_shading.c	2007-08-20 05:06:34 UTC (rev 11728)
+++ branches/imgbrowser-elubie/source/blender/src/buttons_shading.c	2007-08-20 08:01:33 UTC (rev 11729)
@@ -459,7 +459,7 @@
 	
 	block= uiNewBlock(&curarea->uiblocks, "texture_panel_noise", UI_EMBOSS, UI_HELV, curarea->win);
 	if(uiNewPanel(curarea, block, "Textre", "Texture", PANELX, PANELY, PANELW, PANELH)==0) return;
-	uiSetButLock(tex->id.lib!=0, "Can't edit library data");
+	uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
 
 	texture_type_menu(block, tex, yco);
 	yco -= BUTH+YSPACE;
@@ -478,7 +478,7 @@
 	
 	block= uiNewBlock(&curarea->uiblocks, "texture_panel_magic", UI_EMBOSS, UI_HELV, curarea->win);
 	if(uiNewPanel(curarea, block, "Textre", "Texture", PANELX, PANELY, PANELW, PANELH)==0) return;
-	uiSetButLock(tex->id.lib!=0, "Can't edit library data");
+	uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
 
 	texture_type_menu(block, tex, yco);
 	yco -= BUTH+YSPACE;
@@ -497,12 +497,17 @@
 	uiBlock *block;
 	VarStruct *varstr;
 	PluginTex *pit;
-	short xco, yco, a;
+	short xco, a;
+	short yco=PANEL_YMAX;
 	
 	block= uiNewBlock(&curarea->uiblocks, "texture_panel_plugin", UI_EMBOSS, UI_HELV, curarea->win);
-	if(uiNewPanel(curarea, block, "Plugin", "Texture", 640, 0, 318, 204)==0) return;
+	if(uiNewPanel(curarea, block, "Plugin", "Texture", PANELX, PANELY, PANELW, PANELH)==0) return;
 	uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
 
+	texture_type_menu(block, tex, yco);
+	
+	yco -= BUTH+YSPACE;
+	
 	if(tex->plugin && tex->plugin->doit) {
 		
 		pit= tex->plugin;
@@ -522,43 +527,48 @@
 		uiDefBut(block, TEX, B_NAMEPLUGIN, "",		0,180,318,24, pit->name, 0.0, 159.0, 0, 0, "");
 	}
 
-	uiDefBut(block, BUT, B_LOADPLUGIN, "Load Plugin", 0,204,137,24, 0, 0, 0, 0, 0, "");
+	uiDefBut(block, BUT, B_LOADPLUGIN, "Load Plugin",
+		X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, "");
 			
 }
 
-/*
-static void texture_panel_magic(Tex *tex)
-{
-	uiBlock *block;
-	
-	block= uiNewBlock(&curarea->uiblocks, "texture_panel_magic", UI_EMBOSS, UI_HELV, curarea->win);
-	if(uiNewPanel(curarea, block, "Magic", "Texture", 640, 0, 318, 204)==0) return;
-	uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
-	uiBlockBeginAlign(block);
-	uiDefButS(block, NUM, B_TEXPRV, "Depth:",		10, 90, 150, 19, &tex->noisedepth, 0.0, 10.0, 0, 0, "Sets the depth of the pattern");
-	uiDefButF(block, NUM, B_TEXPRV, "Turbulence:",	10, 70, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Sets the strength of the pattern");
-}*/
-
 static void texture_panel_blend(Tex *tex)
 {
 	uiBlock *block;
+	short yco=PANEL_YMAX;
 	
 	block= uiNewBlock(&curarea->uiblocks, "texture_panel_blend", UI_EMBOSS, UI_HELV, curarea->win);
-	if(uiNewPanel(curarea, block, "Blend", "Texture", 640, 0, 318, 204)==0) return;
+	if(uiNewPanel(curarea, block, "Blend", "Texture", PANELX, PANELY, PANELW, PANELH)==0) return;
 	uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
 
+	texture_type_menu(block, tex, yco);
+	yco -= BUTH+YSPACE;
+	
+	uiDefBut(block, LABEL, 0, "Blend type:",
+		X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0.0, 0.0, 0, 0, "");
+
 	uiBlockBeginAlign(block);
-	uiDefButS(block, ROW, B_TEXPRV, "Lin",		10, 180, 75, 19, &tex->stype, 2.0, (float)TEX_LIN, 0, 0, "Creates a linear progresion"); 
-	uiDefButS(block, ROW, B_TEXPRV, "Quad",		85, 180, 75, 19, &tex->stype, 2.0, (float)TEX_QUAD, 0, 0, "Creates a quadratic progression"); 
-	uiDefButS(block, ROW, B_TEXPRV, "Ease",		160, 180, 75, 19, &tex->stype, 2.0, (float)TEX_EASE, 0, 0, "Creates a progression easing from one step to the next"); 
-	uiDefButBitS(block, TOG, TEX_FLIPBLEND, B_TEXPRV, "Flip XY",	235, 180, 75, 19, &tex->flag, 0, 0, 0, 0, "Flips the direction of the progression 90 degrees");
-
-	uiDefButS(block, ROW, B_TEXPRV, "Diag",		10, 160, 75, 19, &tex->stype, 2.0, (float)TEX_DIAG, 0, 0, "Use a diagonal progression");
-	uiDefButS(block, ROW, B_TEXPRV, "Sphere",	85, 160, 75, 19, &tex->stype, 2.0, (float)TEX_SPHERE, 0, 0, "Use progression with the shape of a sphere");
-	uiDefButS(block, ROW, B_TEXPRV, "Halo",		160, 160, 75, 19, &tex->stype, 2.0, (float)TEX_HALO, 0, 0, "Use a quadratic progression with the shape of a sphere");
-	uiDefButS(block, ROW, B_TEXPRV, "Radial",	235, 160, 75, 19, &tex->stype, 2.0, (float)TEX_RAD, 0, 0, "Use a polar progression");
+	uiDefButS(block, ROW, B_TEXPRV, "Linear",
+		X3CLM1, yco-=BUTH, BUTW3, BUTH, &tex->stype, 2.0, (float)TEX_LIN, 0, 0, "Creates a linear progresion"); 
+	uiDefButS(block, ROW, B_TEXPRV, "Quadratic",
+		X3CLM2, yco, BUTW3, BUTH, &tex->stype, 2.0, (float)TEX_QUAD, 0, 0, "Creates a quadratic progression"); 
+	uiDefButS(block, ROW, B_TEXPRV, "Ease",
+		X3CLM3, yco, BUTW3, BUTH, &tex->stype, 2.0, (float)TEX_EASE, 0, 0, "Creates a progression easing from one step to the next"); 
 	
+	uiDefButS(block, ROW, B_TEXPRV, "Diagonal",
+		X4CLM1, yco-=BUTH, BUTW4+XSPACE, BUTH, &tex->stype, 2.0, (float)TEX_DIAG, 0, 0, "Use a diagonal progression");
+	uiDefButS(block, ROW, B_TEXPRV, "Sphere",
+		X4CLM2, yco, BUTW4, BUTH, &tex->stype, 2.0, (float)TEX_SPHERE, 0, 0, "Use progression with the shape of a sphere");
+	uiDefButS(block, ROW, B_TEXPRV, "Halo",
+		X4CLM3, yco, BUTW4, BUTH, &tex->stype, 2.0, (float)TEX_HALO, 0, 0, "Use a quadratic progression with the shape of a sphere");
+	uiDefButS(block, ROW, B_TEXPRV, "Radial",
+		X4CLM4, yco, BUTW4+XSPACE, BUTH, &tex->stype, 2.0, (float)TEX_RAD, 0, 0, "Use a polar progression");
+	uiBlockEndAlign(block);
+	
+	yco -= YSPACE;
+	
+	uiDefButBitS(block, TOG, TEX_FLIPBLEND, B_TEXPRV, "Rotate 90 degrees",
+		X2CLM1, yco-=BUTH, BUTW2, BUTH, &tex->flag, 0, 0, 0, 0, "Flips the direction of the progression 90 degrees");
 }
 
 /* newnoise: noisebasis menu string */
@@ -572,189 +582,367 @@
 static void texture_panel_wood(Tex *tex)
 {
 	uiBlock *block;
+	short yco=PANEL_YMAX;
 	
 	block= uiNewBlock(&curarea->uiblocks, "texture_panel_wood", UI_EMBOSS, UI_HELV, curarea->win);
-	if(uiNewPanel(curarea, block, "Wood", "Texture", 640, 0, 318, 204)==0) return;
+	if(uiNewPanel(curarea, block, "Wood", "Texture", PANELX, PANELY, PANELW, PANELH)==0) return;
 	uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
 	
+	texture_type_menu(block, tex, yco);
+	yco -= BUTH+YSPACE;
+	
 	uiBlockBeginAlign(block);
-	uiDefButS(block, ROW, B_TEXPRV, "Bands",		10, 180, 75, 18, &tex->stype, 2.0, (float)TEX_BAND, 0, 0, "Uses standard wood texture in bands"); 
-	uiDefButS(block, ROW, B_TEXPRV, "Rings",		85, 180, 75, 18, &tex->stype, 2.0, (float)TEX_RING, 0, 0, "Uses wood texture in rings"); 
-	uiDefButS(block, ROW, B_TEXPRV, "BandNoise",	160, 180, 75, 18, &tex->stype, 2.0, (float)TEX_BANDNOISE, 0, 0, "Adds noise to standard wood"); 
-	uiDefButS(block, ROW, B_TEXPRV, "RingNoise",	235, 180, 75, 18, &tex->stype, 2.0, (float)TEX_RINGNOISE, 0, 0, "Adds noise to rings");
+	uiDefButS(block, ROW, B_TEXPRV, "Bands",
+		X4CLM1, yco-=BUTH, BUTW4+XSPACE, BUTH, &tex->stype, 2.0, (float)TEX_BAND, 0, 0, "Uses standard wood texture in bands"); 
+	uiDefButS(block, ROW, B_TEXPRV, "Rings",
+		X4CLM2, yco, BUTW4, BUTH, &tex->stype, 2.0, (float)TEX_RING, 0, 0, "Uses wood texture in rings"); 
+	uiDefButS(block, ROW, B_TEXPRV, "BandNoise",
+		X4CLM3, yco, BUTW4, BUTH, &tex->stype, 2.0, (float)TEX_BANDNOISE, 0, 0, "Adds noise to standard wood"); 
+	uiDefButS(block, ROW, B_TEXPRV, "RingNoise",
+		X4CLM4, yco, BUTW4+XSPACE, BUTH, &tex->stype, 2.0, (float)TEX_RINGNOISE, 0, 0, "Adds noise to rings");
+	uiBlockEndAlign(block);
 	
-	uiDefButS(block, ROW, B_TEXPRV, "Sin",			10, 160, 50, 19, &tex->noisebasis2, 8.0, (float)TEX_SIN, 0, 0, "Uses a sine wave to produce bands"); 
-	uiDefButS(block, ROW, B_TEXPRV, "Saw",			60, 160, 50, 19, &tex->noisebasis2, 8.0, (float)TEX_SAW, 0, 0, "Uses a saw wave to produce bands"); 
-	uiDefButS(block, ROW, B_TEXPRV, "Tri",			110, 160, 50, 19, &tex->noisebasis2, 8.0, (float)TEX_TRI, 0, 0, "Uses a triangle wave to produce bands");
-	uiDefButS(block, ROW, B_TEXPRV, "Soft noise",	160, 160, 75, 19, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise");
-	uiDefButS(block, ROW, B_TEXPRV, "Hard noise",	235, 160, 75, 19, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise");
+	yco -= YSPACE;
 	
+	uiDefBut(block, LABEL, 0, "Noise:",
+		X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0.0, 0.0, 0, 0, "");
+	
 	uiBlockBeginAlign(block);
-	uiDefButF(block, NUM, B_TEXPRV, "NoiseSize :",	10, 130, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input");
-	uiDefButF(block, NUM, B_TEXPRV, "Turbulence:",	160, 130, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Sets the turbulence of the bandnoise and ringnoise types");
+	uiDefButF(block, NUM, B_TEXPRV, "Size:",
+		X2CLM1, yco-=BUTH, BUTW2, BUTH, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input");
+	uiDefButF(block, NUM, B_TEXPRV, "Turbulence:",
+		X2CLM1, yco-=BUTH, BUTW2, BUTH, &tex->turbul, 0.0, 200.0, 10, 0, "Sets the turbulence of the bandnoise and ringnoise types");
 	uiBlockEndAlign(block);
+
+	yco -= YSPACE;
+
+	uiBlockBeginAlign(block);
+	uiDefButS(block, ROW, B_TEXPRV, "Soft",
+		X4CLM1, yco-=BUTH, BUTW4+XSPACE, BUTH, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise");
+	uiDefButS(block, ROW, B_TEXPRV, "Hard",
+		X4CLM2, yco, BUTW4+XSPACE, BUTH, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise");
+	uiBlockEndAlign(block);
 	
-	/* newnoise: noisebasis menu */
-	uiDefBut(block, LABEL, 0, "Noise Basis",		10, 30, 150, 19, 0, 0.0, 0.0, 0, 0, "");
-	uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(),	10, 10, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence");
-	uiDefButF(block, NUM, B_NOP, "Nabla: ",			160, 10, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal");	
+	yco -= YSPACE;
 	
+	uiDefBut(block, LABEL, 0, "Basis:",
+		X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0.0, 0.0, 0, 0, "");
+	uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(),
+		X2CLM1, yco-=BUTH, BUTW2, BUTH, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence");
+	
+	/* column 2 */
+	yco=PANEL_YMAX-(2*BUTH+3*YSPACE);
+	
+	uiDefBut(block, LABEL, 0, "Waveform:",
+		X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0.0, 0.0, 0, 0, "");
+		
+	uiBlockBeginAlign(block);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list