Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-02-16 22:24:04 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-02-16 22:24:04 +0300
commitad01c90ee3942fb2a4a792f0454a136b441f42b4 (patch)
treef0468981d9f46ae32b386d36ab34d1d9bbda9a2f /source/blender/editors/space_image
parenta4c010975a6afaecc2ca8f8284de3febda113369 (diff)
Revert render slots commit for release, I can't find the bug or even redo
it myself, there will still be render slots just old implementation.
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/image_buttons.c24
-rw-r--r--source/blender/editors/space_image/image_draw.c52
-rw-r--r--source/blender/editors/space_image/image_ops.c18
3 files changed, 48 insertions, 46 deletions
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index bd5f8754990..01c53961f66 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -538,12 +538,12 @@ static char *slot_menu()
char *str;
int a, slot;
- str= MEM_callocN(IMA_MAX_RENDER_SLOT*32, "menu slots");
+ str= MEM_callocN(RE_SLOT_MAX*32, "menu slots");
strcpy(str, "Slot %t");
a= strlen(str);
- for(slot=0; slot<IMA_MAX_RENDER_SLOT; slot++)
+ for(slot=0; slot<RE_SLOT_MAX; slot++)
a += sprintf(str+a, "|Slot %d %%x%d", slot+1, slot);
return str;
@@ -617,6 +617,7 @@ static void image_multi_cb(bContext *C, void *rr_v, void *iuser_v)
{
ImageUser *iuser= iuser_v;
+ RE_SetViewSlot(iuser->menunr);
BKE_image_multilayer_index(rr_v, iuser);
WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL);
}
@@ -717,7 +718,7 @@ static void image_user_change(bContext *C, void *iuser_v, void *unused)
}
#endif
-static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, ImageUser *iuser, int w, short *render_slot)
+static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, ImageUser *iuser, int w, int render)
{
uiBlock *block= uiLayoutGetBlock(layout);
uiBut *but;
@@ -733,9 +734,10 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, Image
wmenu3= (3*w)/6;
/* menu buts */
- if(render_slot) {
+ if(render) {
strp= slot_menu();
- but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu1, 20, render_slot, 0,0,0,0, "Select Slot");
+ iuser->menunr= RE_GetViewSlot();
+ but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu1, 20, &iuser->menunr, 0,0,0,0, "Select Slot");
uiButSetFunc(but, image_multi_cb, rr, iuser);
MEM_freeN(strp);
}
@@ -754,7 +756,7 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, Image
}
}
-static void uiblock_layer_pass_arrow_buttons(uiLayout *layout, RenderResult *rr, ImageUser *iuser, short *render_slot)
+static void uiblock_layer_pass_arrow_buttons(uiLayout *layout, RenderResult *rr, ImageUser *iuser, int render)
{
uiBlock *block= uiLayoutGetBlock(layout);
uiLayout *row;
@@ -775,7 +777,7 @@ static void uiblock_layer_pass_arrow_buttons(uiLayout *layout, RenderResult *rr,
but= uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0,0,18,20, NULL, 0, 0, 0, 0, "Next Layer");
uiButSetFunc(but, image_multi_inclay_cb, rr, iuser);
- uiblock_layer_pass_buttons(row, rr, iuser, 230, render_slot);
+ uiblock_layer_pass_buttons(row, rr, iuser, 230, render);
/* decrease, increase arrows */
but= uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0,0,17,20, NULL, 0, 0, 0, 0, "Previous Pass");
@@ -884,9 +886,9 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
}
else if(ima->type==IMA_TYPE_R_RESULT) {
/* browse layer/passes */
- Render *re= RE_GetRender(scene->id.name);
+ Render *re= RE_GetRender(scene->id.name, RE_SLOT_VIEW);
RenderResult *rr= RE_AcquireResultRead(re);
- uiblock_layer_pass_arrow_buttons(layout, rr, iuser, &ima->render_slot);
+ uiblock_layer_pass_arrow_buttons(layout, rr, iuser, 1);
RE_ReleaseResult(re);
}
}
@@ -913,7 +915,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
/* multilayer? */
if(ima->type==IMA_TYPE_MULTILAYER && ima->rr) {
- uiblock_layer_pass_arrow_buttons(layout, ima->rr, iuser, NULL);
+ uiblock_layer_pass_arrow_buttons(layout, ima->rr, iuser, 0);
}
else if(ima->source != IMA_SRC_GENERATED) {
if(compact == 0) {
@@ -993,7 +995,7 @@ void uiTemplateImageLayers(uiLayout *layout, bContext *C, Image *ima, ImageUser
/* render layers and passes */
if(ima && iuser) {
rr= BKE_image_acquire_renderresult(scene, ima);
- uiblock_layer_pass_buttons(layout, rr, iuser, 160, (ima->type==IMA_TYPE_R_RESULT)? &ima->render_slot: NULL);
+ uiblock_layer_pass_buttons(layout, rr, iuser, 160, ima->type==IMA_TYPE_R_RESULT);
BKE_image_release_renderresult(scene, ima);
}
}
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index bc07222c9fb..cb942472b9e 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -64,8 +64,6 @@
#include "WM_api.h"
-#include "RE_pipeline.h"
-
#include "image_intern.h"
#define HEADER_HEIGHT 18
@@ -92,35 +90,37 @@ static void image_verify_buffer_float(SpaceImage *sima, Image *ima, ImBuf *ibuf,
}
}
-static void draw_render_info(Scene *scene, Image *ima, ARegion *ar)
+static void draw_render_info(Image *ima, ARegion *ar)
{
- RenderResult *rr;
rcti rect;
float colf[3];
+ int showspare= 0; // XXX BIF_show_render_spare();
- rr= BKE_image_acquire_renderresult(scene, ima);
-
- if(rr->text) {
- rect= ar->winrct;
- rect.xmin= 0;
- rect.ymin= ar->winrct.ymax - ar->winrct.ymin - HEADER_HEIGHT;
- rect.xmax= ar->winrct.xmax - ar->winrct.xmin;
- rect.ymax= ar->winrct.ymax - ar->winrct.ymin;
-
- /* clear header rect */
- UI_GetThemeColor3fv(TH_BACK, colf);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
- glColor4f(colf[0]+0.1f, colf[1]+0.1f, colf[2]+0.1f, 0.5f);
- glRecti(rect.xmin, rect.ymin, rect.xmax, rect.ymax+1);
- glDisable(GL_BLEND);
-
- UI_ThemeColor(TH_TEXT_HI);
+ if(ima->render_text==NULL)
+ return;
+
+ rect= ar->winrct;
+ rect.xmin= 0;
+ rect.ymin= ar->winrct.ymax - ar->winrct.ymin - HEADER_HEIGHT;
+ rect.xmax= ar->winrct.xmax - ar->winrct.xmin;
+ rect.ymax= ar->winrct.ymax - ar->winrct.ymin;
+
+ /* clear header rect */
+ UI_GetThemeColor3fv(TH_BACK, colf);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glColor4f(colf[0]+0.1f, colf[1]+0.1f, colf[2]+0.1f, 0.5f);
+ glRecti(rect.xmin, rect.ymin, rect.xmax, rect.ymax+1);
+ glDisable(GL_BLEND);
+
+ UI_ThemeColor(TH_TEXT_HI);
- UI_DrawString(12, rect.ymin + 5, rr->text);
+ if(showspare) {
+ UI_DrawString(12, rect.ymin + 5, "(Previous)");
+ UI_DrawString(72, rect.ymin + 5, ima->render_text);
}
-
- BKE_image_release_renderresult(scene, ima);
+ else
+ UI_DrawString(12, rect.ymin + 5, ima->render_text);
}
void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *fp, int *zp, float *zpf)
@@ -654,7 +654,7 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene)
/* render info */
if(ibuf && ima && show_render)
- draw_render_info(scene, ima, ar);
+ draw_render_info(ima, ar);
/* XXX integrate this code */
#if 0
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index eb87b5656bf..b69b6a552a6 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1805,21 +1805,21 @@ static int cycle_render_slot_poll(bContext *C)
static int cycle_render_slot_exec(bContext *C, wmOperator *op)
{
- Image *ima= CTX_data_edit_image(C);
- int a, slot, cur= ima->render_slot;
+ Scene *scene= CTX_data_scene(C);
+ int a, slot, cur= RE_GetViewSlot();
- for(a=1; a<IMA_MAX_RENDER_SLOT; a++) {
- slot= (cur+a)%IMA_MAX_RENDER_SLOT;
+ for(a=1; a<RE_SLOT_MAX; a++) {
+ slot= (cur+a)%RE_SLOT_MAX;
- if(ima->renders[slot] || slot == ima->last_render_slot) {
- ima->render_slot= slot;
+ if(RE_GetRender(scene->id.name, slot)) {
+ RE_SetViewSlot(slot);
break;
}
}
- if(a == IMA_MAX_RENDER_SLOT)
- ima->render_slot= ((cur == 1)? 0: 1);
-
+ if(a == RE_SLOT_MAX)
+ RE_SetViewSlot((cur == 1)? 0: 1);
+
WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL);
return OPERATOR_FINISHED;