Environment Variables

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

digobh
Posts: 9
Joined: Sat Feb 07, 2009 9:11 pm
Location: Brazil

Environment Variables

Postby digobh » Thu Nov 15, 2012 7:46 am

Hi guys,

I am trying to setup blender in a vfx pipeline where we use linux.
We have a bunch of scripts the set variables for each software once you are in a job environment. So each shot, has its each individual paths set by environment variables.

My first question:
1 .Setting up Blender Environment Variables.

These ones are the ones found in blender -h and manual for 2.6. But I am not sure if they are necessary or right. I would like to have a confirmation on that. I've changed the values to fit my script's logic.

export BLENDER_TEMP=${TMP}
export BLENDER_SHARE=${CE_OPT_DIR}/blender${VER}
export BLENDER_VERSION=${VER:0:4} # getting only first 4 indexes of the variable as Blender version has 5 digits: 2.64a >> Needs only 2.64
export BLENDER_USER_BASE=${HOME}/.blender/${BLENDER_VERSION}
export BLENDER_SYSTEM_BASE=${BLENDER_SHARE}/${BLENDER_VERSION}
export BLENDER_USER_DATAFILES=${HOME}/.blender/${BLENDER_VERSION}/datafiles
export BLENDER_SYSTEM_DATAFILES=${BLENDER_SHARE}/${BLENDER_VERSION}/datafiles
export BLENDER_SYSTEM_PYTHON=${BLENDER_SHARE}/${BLENDER_VERSION}/python
export BLENDER_USER_PLUGINS=${HOME}/.blender/${BLENDER_VERSION}/plugins
export BLENDER_SYSTEM_PLUGINS=${BLENDER_SHARE}/${BLENDER_VERSION}/plugins

2. Question:
On Blender's User's preferences, under 'File' Section. There are File Paths:
Is it possible to set this paths through env variables? If yes, how are they called?
These paths are:
Fonts:
Textures:
Render output:
scripts:
Sounds:
Temp:
Image Editor:
Rodrigo R. Guimaraes
www.rodrigoguimaraes.com

ldo
Posts: 544
Joined: Sun Nov 07, 2010 11:30 pm
Location: Hamilton, New Zealand

Postby ldo » Sun Nov 25, 2012 3:00 am

All those fields are accessible here http://www.blender.org/documentation/bl ... Paths.html as bpy.context.user_preferences.filepaths.


Return to “Python”

Who is online

Users browsing this forum: No registered users and 2 guests