Many old hats here know that Blender and Python fit like a hand in a glove. Blender really isn't living up to its full potential without Python. This tutorial is designed to help new users install Python and setup Blender to use it. It isn't enough to simply have Python installed. Blender needs to know where to find its scripts. To further complicate the matter, Blender is multi-platform which means it stores those scripts in different locations depending on the platform it is installed on. Lastly, I really never understood the idea behind hiding the folder that houses the scripts you need to get at. Evidently neither does my Distributor of Linux since it places the scripts in a global location. Well, enough of that rant. Here we go....
First, you will need both Blender and Python.
http://www.blender.org
http://www.python.org
The version of python is important especially with pre-built Blender packages. Further, if you are running Linux, it is better to use your distribution's package manager to install these programs since different distros install them differently. Also, Python has a 2.6.* version that is currently incompatible with Blender so make sure you use the 2.5.* version!
Lastly, I can't verify installs for Mac since I don't own one. If you own a Mac and find an error in my tutorial here, as always, post below and I'll make appropriate corrections.
Once python is installed properly, you will get something like the following message in your console window:
Compiled with Python version 2.5.2.
Checking for installed Python... got it!
Make sure you get that message before proceeding!
The reason it is necessary to setup the paths is because it is possible to run multiple versions of Blender on the same machine as long as the configuration files are kept separate from each other. To avoid confusion as much as possible in this tutorial, I'll use the default Windows paths even though I'm using Linux. I will point out the differences when appropriate.
Once you have both installed, fire up Blender and go to the preferences page. It is hidden at the top of the screen. You want to select the "paths" tab:
Depicted above is the default setup of every Blender install. (I purposely deleted the control file [.B.blend] that we will be creating at the end of this tutorial). A word on platform paths is next:
If you are using Windows, Blender installed itself to be "multi-user" meaning it creates the directory structure it needs to run at run-time. On Windows it can be found in the following location:
C:\Documents and Settings\<USERNAME>\Application Data\Blender Foundation\Blender\.blender
Where "<USERNAME>" is the username you use to log into Windows with.
On Linux (and Mac?) it is usually located in your home directory /.blender. On some systems (like mine) you may find that it is located in /usr/share/blender and /usr/lib/blender. Help is available in the forums here if you have trouble locating it. The thing is, you are looking for python scripts ending in "py".
Back to the paths boxes...
The paths listed from left to right with their associated Windows settings are as follows:
YFexport: -- Path to store the Yafray XML file used by the Yafray render engine. This path must exist before you fill this box in. It is optional just as the Yafray engine is optional. It can be safely left at its default.
Fonts:// -- Path to the fonts Blender can use. These are NOT the system fonts folder although some system fonts will work with Blender.
Windows Path should be set at:
C:\Documents and Settings\<USERNAME>\Application Data\Blender Foundation\Blender\.blender\
Render:// -- Default render path. This path can be overridden in the output tab. It is an optional field and can be safely left at its default.
Textures:// -- Default texture location path. This is an optional field that can be safely left at the default. It tells Blender where to look for texture files.
Python Scripts:// --Default location for all python scripts Blender will use. This is the important one to fill in. There is an additional button next to the file browser button that will refresh the script list AFTER you change this location. If you hit it before you fill this field out, nothing will happen.
Windows path should be set at:
C:\Documents and Settings\<USERNAME>\Application Data\Blender Foundation\Blender\.blender\scripts
Tex Plugins: --The location of texture plugins used for procedural textures. This is another important path.
C:\Documents and Settings\<USERNAME>\Application Data\Blender Foundation\Blender\.blender\plugins\texture
Sounds:// --Location of sound files. This is an optional field and can be overridden in the audio section of the buttons panel. It is safe to leave this field at the default.
Seq Plugins: -- Location of the plugins needed for the sequencer. This is another important field.
C:\Documents and Settings\<USERNAME>\Application Data\Blender Foundation\Blender\.blender\plugins\sequence
Temp: -- Location for temporary files such as quit.blend talked so much about here at BU. It is safe to use the temp folder in Windows for this "C:\Windows\temp"
Once you setup the paths, you need to tell Blender to keep them by using "File->Save Defaults".
That concludes this tutorial. You should now see a huge increase in the functionality once you update your python script list by hitting that refresh button or better yet, restart Blender and go to "File->Import" and see if you have a massive list of importers.
Enjoy and as always, if there is an error in this tutorial, post below and I'll fix it...
