[Bf-committers] Setting a default system scripts directory

Campbell Barton ideasman42 at gmail.com
Sun Sep 13 07:54:03 CEST 2009

Hi, this is an old problem for linux/unix packages and Id like to
solve this too... some things to think about.

Should this be limited to scripts? - Might it be better to have the
whole ~/.blender path scanned elsewhere (would include icons, language
files, .bfont.ttf), otherwise packages still have to have some way to
have blender find language files in a place other then the home

I'd propose one of 4 solutions, some of which have been suggested
above, and on other occasions.
1) Do nothing
- People packaging blender can have the ".blender" directory installed
in some directory such as "/usr/share/blender", and use a shell
wrapper script that copies these files into the home directory on
startup if it doesn't exist.
- One of the problems with this is when blender is upgraded, the users
home holder wont be, unless the startup shell script detects versions.
- If this becomes the recommended method we must have some way to
support updates. maybe copy to ~/.blender-2.5 (gimp has versions like

2) System wide data files (as well as ~/.blender)
- This boils down to having blender look in a fixed path for data
files (including scripts)
- This directory will be used if ~/.blender is not found (which is the
case mostly for freshly installed packages), works much nicer for
updating packages too since users wont have stale copies.
- At compile time set a prefix (like /usr/share/blender/2_49b),
similar to --prefix="/usr", often use with ./configure; make; make
install autoconf setups.
- PROBLEM, both /usr/share/blender AND /home/User/.blender cant both
be used at the same time (wont go into details but think this is a
recipe for disaster).

3) Environment variable or argument eg. $BLENDER_DATA
have an environment variable (or command line argument) $BLENDER_DATA
thats overrides $HOME (when set).
- This allows for most flexibility, package startup scripts can point
to whatever location they like, check its there, etc.
- It would need to save .B.blend and .Blog in $HOME and look for data
files in $BLENDER_DATA
- Still doesn't solve system + user scripts.

4) Only solve for scripts
Have an env var / argument that scans another path for scripts when
set. I dont like this much because it only solves one problem but if
we did this, the scripts could at least co-exist by scanning both the
system and user scripts.


Personally Id go for 2 or 3, If we go for 3 (an env variable), Id like
to include a startup shell script that makes use of this in a way we'd
recommend packagers follow so they don't all go and do their own

This isn't especially hard, if we agree on one I can look into adding
it for 2.49c or 2.5x

On Sat, Sep 12, 2009 at 8:35 PM,  <michael at obberon.com> wrote:
> On Saturday 12 September 2009 20:10:09 Roger Wickes wrote:
>> curious - which one of those is your user setting in the folder user
>>  preferences tab? Secondly, that list does not seem to include the
>>  bpymodules folder??
> I did not change the user setting, so I believe that it is the default,
> ~/.blender. The reason the list turned out the way it did was because on my
> system, ~/.blender did not exist, so it fell back to /usr/bin/.blender, and
> then finally /usr/bin/release/scripts (in case the user ran the executable
> from the source directory). With the directory created, blender does check
> the ~/.blender/scripts directory, along with
> ~/.blender/scripts/bpymodules, but does not bother checking anything in
> /usr/bin.
> However, this is not the point I was trying to make. There still should be
> a way to specify a system directory that should also be checked.
> --
> Michael Forney <michael at obberon.com>
> _______________________________________________
> 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