Undo revision 23130 which was a merge with 2.5, a messy one because I did something...
[blender.git] / source / blender / editors / preview / previewrender.c
index 714ebce..8fcf652 100644 (file)
@@ -307,8 +307,6 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
                                /* turn on raytracing if needed */
                                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)
@@ -349,14 +347,8 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
                        
                        for(base= sce->base.first; base; base= base->next) {
                                if(base->object->id.name[2]=='p') {
-                                       if(ELEM4(base->object->type, OB_MESH, OB_CURVE, OB_SURF, OB_MBALL)) {
-                                               /* don't use assign_material, it changed mat->id.us, which shows in the UI */
-                                               Material ***matar= give_matarar(base->object);
-                                               int actcol= MAX2(base->object->actcol > 0, 1) - 1;
-
-                                               if(matar && actcol < base->object->totcol)
-                                                       (*matar)[actcol]= mat;
-                                       }
+                                       if(ELEM4(base->object->type, OB_MESH, OB_CURVE, OB_SURF, OB_MBALL))
+                                               assign_material(base->object, mat, base->object->actcol);
                                }
                        }
                }
@@ -954,11 +946,7 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
        /* XXX ugly global still, but we can't do preview while rendering */
        if(G.rendering)
                return;
-       
-       if(GS(id->name) == ID_TE) {
-               ntreeTexSetPreviewFlag(1);
-       }
-       
+
        steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner);
        sp= MEM_callocN(sizeof(ShaderPreview), "shader preview");