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>2006-06-09 19:55:27 +0400
committerMatt Ebb <matt@mke3.net>2006-06-09 19:55:27 +0400
commit5b756f7b8ae9402787ee724faed61f1d14ff8e20 (patch)
tree5ad957101b99d407811b23fceb760b4169f3b3c6 /source/blender/src/previewrender.c
parent27bea32b700ddefb494c3687a01c2d128b40b65f (diff)
* preview.blend fixes
The preview.blend now shows raytracing/transparency, and also turns on and off the fake shadow based on the 'shadbuf' setting. Also included an updated preview.blend file to accomodate this.
Diffstat (limited to 'source/blender/src/previewrender.c')
-rw-r--r--source/blender/src/previewrender.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c
index d6895143720..a0b76a2736e 100644
--- a/source/blender/src/previewrender.c
+++ b/source/blender/src/previewrender.c
@@ -269,9 +269,26 @@ static Scene *preview_prepare_scene(RenderInfo *ri, int id_type, ID *id, int pr_
if(id_type==ID_MA) {
Material *mat= (Material *)id;
- sce->r.mode |= R_SHADOW;
-
if(id) {
+ /* turn on raytracing if needed */
+ if((mat->mode & MA_RAYTRANSP) || (mat->mode & MA_RAYMIRROR))
+ sce->r.mode |= R_RAYTRACE;
+
+ /* turn off fake shadows if needed */
+ /* this only works in a specific case where the preview.blend contains
+ * an object starting with 'c' which has a material linked to it (not the obdata)
+ * and that material has a fake shadow texture in the active texture slot */
+ for(base= sce->base.first; base; base= base->next) {
+ if(base->object->id.name[2]=='c') {
+ Material *shadmat= give_current_material(base->object, base->object->actcol);
+ if(shadmat) {
+ if (mat->mode & MA_SHADBUF) shadmat->septex = 0;
+ else shadmat->septex |= 1;
+ }
+ }
+ }
+
+
if(pr_method==PR_ICON_RENDER) {
sce->lay= 1<<MA_SPHERE_A;
}