[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12820] trunk/blender/source/blender/src: EnV requests, copy and paste for colorbands, world ambient colorpicker
Campbell Barton
ideasman42 at gmail.com
Fri Dec 7 20:48:53 CET 2007
Revision: 12820
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12820
Author: campbellbarton
Date: 2007-12-07 20:48:53 +0100 (Fri, 07 Dec 2007)
Log Message:
-----------
EnV requests, copy and paste for colorbands, world ambient colorpicker
Modified Paths:
--------------
trunk/blender/source/blender/src/buttons_shading.c
trunk/blender/source/blender/src/interface.c
Modified: trunk/blender/source/blender/src/buttons_shading.c
===================================================================
--- trunk/blender/source/blender/src/buttons_shading.c 2007-12-07 14:58:36 UTC (rev 12819)
+++ trunk/blender/source/blender/src/buttons_shading.c 2007-12-07 19:48:53 UTC (rev 12820)
@@ -2233,20 +2233,20 @@
uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE);
uiBlockSetCol(block, TH_AUTO);
+ uiBlockBeginAlign(block);
uiDefButF(block, COL, B_WORLDPRV, "", 10,150,145,19, &wrld->horr, 0, 0, 0, B_COLHOR, "");
- uiDefButF(block, COL, B_WORLDPRV, "", 160,150,145,19, &wrld->zenr, 0, 0, 0, B_COLZEN, "");
-
- uiBlockBeginAlign(block);
uiDefButF(block, NUMSLI,B_WORLDPRV,"HoR ", 10,130,145,19, &(wrld->horr), 0.0, 1.0, B_COLHOR,0, "Sets the amount of red color at the horizon");
uiDefButF(block, NUMSLI,B_WORLDPRV,"HoG ", 10,110,145,19, &(wrld->horg), 0.0, 1.0, B_COLHOR,0, "Sets the amount of green color at the horizon");
uiDefButF(block, NUMSLI,B_WORLDPRV,"HoB ", 10,90,145,19, &(wrld->horb), 0.0, 1.0, B_COLHOR,0, "Sets the amount of blue color at the horizon");
uiBlockBeginAlign(block);
+ uiDefButF(block, COL, B_WORLDPRV, "", 160,150,145,19, &wrld->zenr, 0, 0, 0, B_COLZEN, "");
uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeR ", 160,130,145,19, &(wrld->zenr), 0.0, 1.0, B_COLZEN,0, "Sets the amount of red color at the zenith");
uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeG ", 160,110,145,19, &(wrld->zeng), 0.0, 1.0, B_COLZEN,0, "Sets the amount of green color at the zenith");
uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeB ", 160,90,145,19, &(wrld->zenb), 0.0, 1.0, B_COLZEN,0, "Sets the amount of blue color at the zenith");
uiBlockBeginAlign(block);
+ uiDefButF(block, COL, B_WORLDPRV, "", 10,70,145,19, &wrld->ambr, 0, 0, 0, 0, "");
uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbR ", 10,50,145,19, &(wrld->ambr), 0.0, 1.0 ,0,0, "Sets the amount of red ambient color");
uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbG ", 10,30,145,19, &(wrld->ambg), 0.0, 1.0 ,0,0, "Sets the amount of green ambient color");
uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbB ", 10,10,145,19, &(wrld->ambb), 0.0, 1.0 ,0,0, "Sets the amount of blue ambient color");
Modified: trunk/blender/source/blender/src/interface.c
===================================================================
--- trunk/blender/source/blender/src/interface.c 2007-12-07 14:58:36 UTC (rev 12819)
+++ trunk/blender/source/blender/src/interface.c 2007-12-07 19:48:53 UTC (rev 12820)
@@ -135,6 +135,7 @@
static char but_copypaste_str[256]="";
static double but_copypaste_val=0.0;
static float but_copypaste_rgb[3];
+static ColorBand but_copypaste_coba = { NULL };
/* ************* PROTOTYPES ***************** */
@@ -556,9 +557,23 @@
return 1;
}
}
-
-
- return 0;
+ else if(but->type==BUT_COLORBAND) {
+ if(mode=='c') {
+ if (!but->poin) {
+ return 0;
+ }
+ memcpy( &but_copypaste_coba, but->poin, sizeof(ColorBand) );
+ } else {
+ if (but_copypaste_coba.tot==0) {
+ return 0;
+ }
+ if (!but->poin) {
+ but->poin= MEM_callocN( sizeof(ColorBand), "colorband");
+ }
+ memcpy( but->poin, &but_copypaste_coba, sizeof(ColorBand) );
+ return 1;
+ }
+ }
}
/* ******************* block calc ************************* */
More information about the Bf-blender-cvs
mailing list