diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index f7c36b8caa5..41363f02c70 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -2233,20 +2233,20 @@ static void world_panel_world(World *wrld) uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE); uiBlockSetCol(block, TH_AUTO); - 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, COL, B_WORLDPRV, "", 10,150,145,19, &wrld->horr, 0, 0, 0, B_COLHOR, ""); 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"); diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index 07debe8f864..46e27c59465 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -135,6 +135,7 @@ uiBut *UIbuttip; 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 @@ static int ui_but_copy_paste(uiBut *but, char mode) 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 ************************* */