goplexian.com | animation, modeling, scripting - 2010-08-31 11:39:00
First, on Linux for Blender to launch properly it must be set to launch from a terminal or console window.
The reason for this is because the output from Blender scripts is displayed in the console window which Blender was launched from, so if you just click an icon to launch Blender then you need to right click that icon and change it so that it launches blender from a terminal. In Gnome this is easy just right click the icon and go to properties, this will open up the "Launcher Properties" window and then set the Type to "Application in Terminal" instead of the default which is just "Application".
Here is a screenshot of the the Gnome Launcher Properties window and how things need to look to launch Blender properly on Linux.
Second, if you want to do Blender scripting you should really get your head wrapped around the Python language itself first. You don't need to be a Python master, but you need to at least understand the basics.
So if you don't know any Python or just don't feel confident about what you do know, then my advice is stop reading this and go do some Python lessons first. A good place to start is Zed Shaw's Python primer entitled
"Learning Python the Hard Way" it is short and well written and will probably make you a bit uncomfortable but in the end you will come away with a good understanding of what Python is and how it works.
Zed is a bit of a genius slash screwball but he takes the right approach more often than not and "Learning Python the Hard Way" is as a result a great book for beginners. For any who might be Zeds' fan's, the screwball remark was just a joke, I've met Zed and he is a very nice fellow, over nine feet tall, shoots fireballs out of his arse. ;)
Now you may hear some people say that you don't need to know Python to start scripting in Blender, and I suppose to a certain extent that might be somewhat true, but it really depends upon how limited your goals are. If you just want to figure out how to copy and paste a script which someone else wrote then I suppose you don't need to understand Python, but if you want to understand how a script works and possibly modify it, or improve it, then you will need to know Python and that is all there is to it.
So go learn some Python, it's good for you.
Now in line with Zeds recommended practice of writing scripts out by hand and then figuring out what they do by running them head on over to the Blender Artists Forum and
check out this thread by Crouch he goes over 15 different Blender 2.5 scripts, write out each one of them by hand and then run them yourself in Blender.
If you get stuck, or you are unsure of what a particular method does then just look it up in the
Blender 2.5 Python API Documentation, if you still can't figure out how it works then maybe just skip it and move on to the next script, but make a note to come back and look at it again in a few weeks and see if it makes more sense.
You should also look at the
Blender 2.5 Python API Introduction it briefly goes over all the basics of how the API works and what each of the major components does.
I hope you find this to be a useful introduction to scripting in Blender and I hope you take my advice about studying Python. Blender and Python are a powerful combination, and the only thing holding you back from harnessing that power is yourself.