[Bf-committers] Fix for #913 "inconsistent .B.blend loading/saving"

Bill Baxter bf-committers@blender.org
Mon, 26 Jan 2004 13:49:57 -0500


Simon Clitherow wrote:

>Hi Bill,
>
>Thanks for the patch. 
>
>The plan was to remove the inconsistant saving of .B.blend across the 
>different windows versions (Win9x has no concept of profile dirs, etc).
>This change was then further (and perhaps, unduly) complicated by a 
>"transition period" - allowing people to still read their existing 
>settings but saving defaults goes to ~/.blender and from then on, they
>are read from there. This is the reason for all the #ifdefs dotted 
>around the place, which will later be removed.
>
>As for HOME/.blender vs. HOME, I'm entirely happy to use HOME (which
>is the location of the blender.exe and NOT the system var!), however, I 
>believe doing so caused problems with FTFont and the infamous 
>".blanguages not found" error, but I can't fully recall...
>  
>
Huh? HOME is not $HOME?  That's not what the code does now. Look at 
BLI_getHome().  And why should HOME not be $HOME, even on Windows, as 
long as the user has set it?  BLI_getHome is already doing the check on 
Windows to see if they have it, and if not default to the install dir.  
That's fine.  So the other functions shouldn't be ifdefing things for 
windows and explicitly referring to the install dir -- just call 
BLI_getHome. 

In any event, even on Windows it's useful to make a distinction between 
the "home" dir and "installation" dir.  If you install Blender on a 
Windows computer, each user should still be able to have a unique 
.B.blend file.

>My argument is that since ~/.blender is now becoming more and more
>important (already we've seen this used for translation files, and 
>now python scripts), it seemed the logical place for all blender's 
>external dependancies (excluding *.dlls, of course! :)).
>  
>
I agree.  It would make sense to have a whole folder for per-user 
blender related stuff.   But that's independent of the Windows issue so 
those changes shouldn't be in Windows ifdef blocks.

Personally I think it should go like this:
- if $BLENDERHOME is set, prefs should go there (*without* .blender/ 
prefix).
- else if $HOME is set, prefs should go there (+ .blender/ prefix).
- else if Windows and USERPROFILE is set, prefs should go there (+ .blender)
- else default to the installation dir (+ .blender/)

The extra BLENDERHOME check would be nice in case you don't want your 
blender files to go the same place as everything else.  (Say you have 
HOME set for Cygwin stuff, but want your blender stuff somewhere else)

And aside from the $USERPROFILE check, I think that would be a good way 
to do it for UNIX too.  At least for the .B.blend file.

What do you think?

--bb