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:
authorMatt Ebb <matt@mke3.net>2009-08-19 15:18:52 +0400
committerMatt Ebb <matt@mke3.net>2009-08-19 15:18:52 +0400
commit132277f0989b0b7d99d883d22a2bade6534ae44c (patch)
tree6d26c46f62749470130375061381353fd54c2364 /source/blender/editors/preview
parent8480ea2b0abacae00c90d37e7d99fa5e0c89eebe (diff)
parente611c4756fa17c57855123dc2b5c2c2408b0d790 (diff)
svn merge -r 22450:22627 https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blender
Diffstat (limited to 'source/blender/editors/preview')
-rw-r--r--source/blender/editors/preview/previewrender.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/editors/preview/previewrender.c b/source/blender/editors/preview/previewrender.c
index 4f09faaf7c1..e273791273d 100644
--- a/source/blender/editors/preview/previewrender.c
+++ b/source/blender/editors/preview/previewrender.c
@@ -113,6 +113,7 @@ typedef struct ShaderPreview {
Scene *scene;
ID *id;
ID *parent;
+ MTex *slot;
int sizex, sizey;
int *pr_rect;
@@ -304,10 +305,12 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
end_render_material(mat);
/* turn on raytracing if needed */
- if(mat->mode_l & (MA_RAYTRANSP|MA_RAYMIRROR))
+ if(mat->mode_l & MA_RAYMIRROR)
sce->r.mode |= R_RAYTRACE;
if(mat->material_type == MA_TYPE_VOLUME)
sce->r.mode |= R_RAYTRACE;
+ if((mat->mode_l & MA_RAYTRANSP) && (mat->mode_l & MA_TRANSP))
+ sce->r.mode |= R_RAYTRACE;
if(mat->sss_flag & MA_DIFF_SSS)
sce->r.mode |= R_SSS;
@@ -364,6 +367,10 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
Material *mat= give_current_material(base->object, base->object->actcol);
if(mat && mat->mtex[0]) {
mat->mtex[0]->tex= tex;
+
+ if(sp && sp->slot)
+ mat->mtex[0]->which_output = sp->slot->which_output;
+
/* show alpha in this case */
if(tex==NULL || (tex->flag & TEX_PRV_ALPHA)) {
mat->mtex[0]->mapto |= MAP_ALPHA;
@@ -457,13 +464,14 @@ static int ed_preview_draw_rect(ScrArea *sa, Scene *sce, ID *id, int split, int
return 0;
}
-void ED_preview_draw(const bContext *C, void *idp, void *parentp, rcti *rect)
+void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, rcti *rect)
{
if(idp) {
ScrArea *sa= CTX_wm_area(C);
Scene *sce = CTX_data_scene(C);
ID *id = (ID *)idp;
ID *parent= (ID *)parentp;
+ MTex *slot= (MTex *)slotp;
SpaceButs *sbuts= sa->spacedata.first;
rcti newrect;
int ok;
@@ -491,7 +499,7 @@ void ED_preview_draw(const bContext *C, void *idp, void *parentp, rcti *rect)
}
if(ok==0) {
- ED_preview_shader_job(C, sa, id, parent, newx, newy);
+ ED_preview_shader_job(C, sa, id, parent, slot, newx, newy);
}
}
}
@@ -932,7 +940,7 @@ static void shader_preview_free(void *customdata)
MEM_freeN(sp);
}
-void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, int sizex, int sizey)
+void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, MTex *slot, int sizex, int sizey)
{
wmJob *steve;
ShaderPreview *sp;
@@ -952,6 +960,7 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, i
sp->pr_method= PR_DO_RENDER;
sp->id = id;
sp->parent= parent;
+ sp->slot= slot;
/* setup job */
WM_jobs_customdata(steve, sp, shader_preview_free);