svn merge -r 22628:22714 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
[blender.git] / source / blender / blenloader / intern / readfile.c
index 77b51d950b937195c5201e80f99b0d81d7b1a7f3..5cc3ff7695a28d93dfadf53d821009fc59f1efc8 100644 (file)
@@ -2819,6 +2819,11 @@ static void lib_link_texture(FileData *fd, Main *main)
                        tex->ima= newlibadr_us(fd, tex->id.lib, tex->ima);
                        tex->ipo= newlibadr_us(fd, tex->id.lib, tex->ipo);
                        if(tex->env) tex->env->object= newlibadr(fd, tex->id.lib, tex->env->object);
+                       if(tex->pd) {
+                               tex->pd->object= newlibadr(fd, tex->id.lib, tex->pd->object);
+                               tex->pd->psys= newlibadr(fd, tex->id.lib, tex->pd->psys);
+                       }
+                       if(tex->vd) tex->vd->object= newlibadr(fd, tex->id.lib, tex->vd->object);
 
                        if(tex->nodetree)
                                lib_link_ntree(fd, &tex->id, tex->nodetree);
@@ -2851,6 +2856,16 @@ static void direct_link_texture(FileData *fd, Tex *tex)
                memset(tex->env->cube, 0, 6*sizeof(void *));
                tex->env->ok= 0;
        }
+       tex->pd= newdataadr(fd, tex->pd);
+       if(tex->pd) {
+               tex->pd->point_tree = NULL;
+               tex->pd->coba= newdataadr(fd, tex->pd->coba);
+       }
+       
+       tex->vd= newdataadr(fd, tex->vd);
+       if(tex->vd) {
+               tex->vd->dataset = NULL;
+       }
        
        tex->nodetree= newdataadr(fd, tex->nodetree);
        if(tex->nodetree)
@@ -9478,6 +9493,24 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                        }
                                }
                        }
+                       
+                       /* volume rendering settings */
+                       if (ma->vol.stepsize < 0.0001f) {
+                               ma->vol.density = 1.0f;
+                               ma->vol.emission = 0.0f;
+                               ma->vol.absorption = 1.0f;
+                               ma->vol.scattering = 1.0f;
+                               ma->vol.emission_col[0] = ma->vol.emission_col[1] = ma->vol.emission_col[2] = 1.0f;
+                               ma->vol.absorption_col[0] = ma->vol.absorption_col[1] = ma->vol.absorption_col[2] = 0.0f;
+                               ma->vol.density_scale = 1.0f;
+                               ma->vol.depth_cutoff = 0.01f;
+                               ma->vol.stepsize_type = MA_VOL_STEP_RANDOMIZED;
+                               ma->vol.stepsize = 0.2f;
+                               ma->vol.shade_stepsize = 0.2f;
+                               ma->vol.shade_type = MA_VOL_SHADE_SINGLE;
+                               ma->vol.shadeflag |= MA_VOL_PRECACHESHADING;
+                               ma->vol.precache_resolution = 50;
+                       }
                }
 
                for(sce = main->scene.first; sce; sce = sce->id.next) {