[Bf-committers] Antw.: [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41909] trunk/blender/source/blender/ modifiers/intern: Default cache file paths for ocean and fluidsim modifiers are now "< temp folder>/ocean_cache/" and "<temp_folder>/fl

Campbell Barton ideasman42 at gmail.com
Mon Nov 21 15:13:51 CET 2011


+1, though would change:  cache_futuresimulations --> cache_fluidsim

On Tue, Nov 22, 2011 at 1:05 AM, Thomas Dinges <blender at dingto.org> wrote:
> Agree here. This makes sense.
>
> Sent from my mobile device
>
> ----- Reply message -----
> Von: "PabloVazquez.org" <venomgfx at gmail.com>
> An: <bf-committers at blender.org>
> Betreff: [Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41909] trunk/blender/source/blender/ modifiers/intern: Default cache file paths for ocean and fluidsim modifiers are now "< temp folder>/ocean_cache/" and "<temp_folder>/fluid_cache/" when the file i
> Datum: So., Nov. 20, 2011 21:59
>
>
> <picky mode>
>
> As we usually have folders for textures/references/tests and so on inside
> our .blend's folder, I'd rather have these folders starting with "cache_"
> instead of the sim name, like:
>
>    cache_fluid
>    cache_ocean
>    cache_futuresimulations
>
> So when listing our .blend's folder alphabetically they are nicely listed
> together, easier for the eye.
>
> Perhaps a bit silly, but reduces the noise when having many caches and
> extra folders.
> </picky>
>
> --
> Pablo Vazquez
> CG Artist
> Blender Foundation Certified Trainer
> E-mail: contact at pablovazquez.org
> Website: http://www.pablovazquez.org
>
>
> On Wed, Nov 16, 2011 at 09:43, Lukas Toenne <lukas.toenne at googlemail.com>wrote:
>
>> Revision: 41909
>>
>> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41909
>> Author:   lukastoenne
>> Date:     2011-11-16 12:43:12 +0000 (Wed, 16 Nov 2011)
>> Log Message:
>> -----------
>> Default cache file paths for ocean and fluidsim modifiers are now "<temp
>> folder>/ocean_cache/" and "<temp_folder>/fluid_cache/" when the file is not
>> saved yet at the time the modifiers are created.
>>
>> If it has been saved, the file paths are relative to the .blend:
>> "//ocean_cache/" and "//fluid_cache/".
>>
>> This should at least partially fix bug #29273. Particle external point
>> caches are not changed.
>>
>>
>> http://projects.blender.org/tracker/?func=detail&atid=498&aid=29273&group_id=9
>>
>> Modified Paths:
>> --------------
>>    trunk/blender/source/blender/modifiers/intern/MOD_fluidsim_util.c
>>    trunk/blender/source/blender/modifiers/intern/MOD_ocean.c
>>
>> Modified: trunk/blender/source/blender/modifiers/intern/MOD_fluidsim_util.c
>> ===================================================================
>> --- trunk/blender/source/blender/modifiers/intern/MOD_fluidsim_util.c
>> 2011-11-16 12:38:40 UTC (rev 41908)
>> +++ trunk/blender/source/blender/modifiers/intern/MOD_fluidsim_util.c
>> 2011-11-16 12:43:12 UTC (rev 41909)
>> @@ -69,6 +69,7 @@
>>        if(fluidmd)
>>        {
>>                FluidsimSettings *fss =
>> MEM_callocN(sizeof(FluidsimSettings), "fluidsimsettings");
>> +               int surfdataPathMax = FILE_MAX;
>>
>>                fluidmd->fss = fss;
>>
>> @@ -104,7 +105,22 @@
>>
>>                /*  elubie: changed this to default to the same dir as the
>> render output
>>                to prevent saving to C:\ on Windows */
>> -               BLI_strncpy(fss->surfdataPath, BLI_temporary_dir(),
>> FILE_MAX);
>> +               if (G.relbase_valid) {          /* is the .blend saved? */
>> +                       /* subfolder next to saved file */
>> +                       BLI_strncpy(fss->surfdataPath, "//fluid_cache",
>> surfdataPathMax);
>> +                       BLI_add_slash(fss->surfdataPath);
>> +               }
>> +               else {
>> +                       /* subfolder in temp. directory */
>> +                       BLI_strncpy(fss->surfdataPath,
>> BLI_temporary_dir(), surfdataPathMax);
>> +                       surfdataPathMax -= strlen(fss->surfdataPath);
>> +                       if (surfdataPathMax > 1) {
>> +
>> BLI_strncpy(fss->surfdataPath+strlen(fss->surfdataPath), "fluid_cache",
>> surfdataPathMax);
>> +                               surfdataPathMax -= strlen("fluid_cache");
>> +                               if (surfdataPathMax > 1)
>> +                                       BLI_add_slash(fss->surfdataPath);
>> +                       }
>> +               }
>>
>>                // first init of bounding box
>>                // no bounding box needed
>>
>> Modified: trunk/blender/source/blender/modifiers/intern/MOD_ocean.c
>> ===================================================================
>> --- trunk/blender/source/blender/modifiers/intern/MOD_ocean.c   2011-11-16
>> 12:38:40 UTC (rev 41908)
>> +++ trunk/blender/source/blender/modifiers/intern/MOD_ocean.c   2011-11-16
>> 12:43:12 UTC (rev 41909)
>> @@ -34,10 +34,12 @@
>>  #include "DNA_scene_types.h"
>>
>>  #include "BKE_cdderivedmesh.h"
>> +#include "BKE_global.h"
>>  #include "BKE_modifier.h"
>>  #include "BKE_ocean.h"
>>  #include "BKE_utildefines.h"
>>
>> +#include "BLI_blenlib.h"
>>  #include "BLI_math.h"
>>  #include "BLI_math_inline.h"
>>  #include "BLI_utildefines.h"
>> @@ -95,6 +97,7 @@
>>  {
>>  #ifdef WITH_OCEANSIM
>>        OceanModifierData *omd = (OceanModifierData*) md;
>> +       int cachepathmax = sizeof(omd->cachepath);
>>
>>        omd->resolution = 7;
>>        omd->spatial_size = 50;
>> @@ -122,7 +125,22 @@
>>        omd->repeat_x = 1;
>>        omd->repeat_y = 1;
>>
>> -       BLI_strncpy(omd->cachepath, "//ocean_cache",
>> sizeof(omd->cachepath));
>> +       if (G.relbase_valid) {          /* is the .blend saved? */
>> +               /* subfolder next to saved file */
>> +               BLI_strncpy(omd->cachepath, "//ocean_cache", cachepathmax);
>> +               BLI_add_slash(omd->cachepath);
>> +       }
>> +       else {
>> +               /* subfolder in temp. directory */
>> +               BLI_strncpy(omd->cachepath, BLI_temporary_dir(),
>> cachepathmax);
>> +               cachepathmax -= strlen(omd->cachepath);
>> +               if (cachepathmax > 1) {
>> +                       BLI_strncpy(omd->cachepath+strlen(omd->cachepath),
>> "ocean_cache", cachepathmax);
>> +                       cachepathmax -= strlen("ocean_cache");
>> +                       if (cachepathmax > 1)
>> +                               BLI_add_slash(omd->cachepath);
>> +               }
>> +       }
>>
>>        omd->cached = 0;
>>        omd->bakestart = 1;
>>
>> _______________________________________________
>> Bf-blender-cvs mailing list
>> Bf-blender-cvs at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
- Campbell


More information about the Bf-committers mailing list