svn merge -r 16866:17042 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender-staging.git] / source / blender / blenloader / intern / readfile.c
index 25f9e179ca901cbc1aed8775eedef452cc310b11..3cae5fe4972a44c289600d8b35497e4a35fd303f 100644 (file)
@@ -2476,6 +2476,7 @@ 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->id.flag -= LIB_NEEDLINK;
                }
@@ -2502,6 +2503,10 @@ 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->preview = direct_link_preview_image(fd, tex->preview);
 
        tex->iuser.ok= 1;
@@ -7689,6 +7694,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 11)) {
                Object *ob;
                bActionStrip *strip;
+
                
                /* nla-strips - scale */                
                for (ob= main->object.first; ob; ob= ob->id.next) {
@@ -7712,6 +7718,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                ob->soft->shearstiff = 1.0f; 
                        }
                }
+               
        }
 
        if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 14)) {
@@ -7870,6 +7877,35 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        la->skyblendtype= MA_RAMP_ADD;
                        la->skyblendfac= 1.0f;
                }
+               
+       }
+       
+       if (main->versionfile <= 247) {
+               Material *ma;
+               Tex *tex;
+               
+               for(ma=main->mat.first; ma; ma= ma->id.next) {
+                       /* trigger for non-volumetric file */
+                       if (ma->vol_shade_stepsize < 0.0001f) {
+                               ma->vol_shade_stepsize = 0.2f;
+                               ma->vol_stepsize = 0.2f;
+                               ma->vol_absorption = 1.0f;
+                               ma->vol_scattering = 1.0f;
+                               ma->vol_absorption_col[0] = ma->vol_absorption_col[1] = ma->vol_absorption_col[2] = 0.0f;       
+                       }
+               }
+               
+               for(tex=main->tex.first; tex; tex= tex->id.next) {
+                       if (tex->pd == NULL) 
+                               tex->pd = BKE_add_pointdensity();
+                       else if (tex->pd->noise_size < 0.0001f) {
+                               tex->pd->noise_size = 0.5f;
+                               tex->pd->noise_depth = 1;
+                               tex->pd->noise_fac = 1.0f;
+                               tex->pd->noise_influence = TEX_PD_NOISE_STATIC;
+                       }
+               }
+               
        }
        
        /* set the curve radius interpolation to 2.47 default - easy */
@@ -7894,6 +7930,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        }
                }
        }
+
        /* direction constraint actuators were always local in previous version */
        if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 7)) {
                bActuator *act;