Python veteran, new to Blender, wants to learn

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
rpmuller
Posts: 3
Joined: Wed Nov 27, 2002 10:12 pm

Python veteran, new to Blender, wants to learn

Post by rpmuller »

I'm an experienced Python programmer who would like to learn how to use Blender. I've installed Blender Publisher for MacOS X 10.2 on my powerbook. I was hoping that someone could give me pointers as to how to get started.

Some specific questions are:
(1) Can I only write blender scripts from within Blender, or can I run them free standing as well?
(2) If I can run Blender free standing, how do I install the libraries so that Python knows about them? Where are the libraries, for that matter?
(3) If I want to run a python script from within Blender, how do I actually run the script? I can't find a "run" or a "render" button anywhere.

Thanks in advance for any help you can offer.

Rick

Jamesk
Posts: 239
Joined: Mon Oct 14, 2002 8:15 am
Location: Sweden

Post by Jamesk »

1) Well, you can write them somewhere else of course, but when the time comes for execution, you'd have to run it from within Blender. At least if you want to use the Blender API (pretty likely, for obvious reasons).

2) Hmm... Blender runs stand-alone, but I assume you meant the scripts, and, well see 1) above... So you can't really make the standard system Python interpreter aware of the Blender libs (thats a python module called Blender containing some submodules, but they're only alive inside Blender when it's running. Not accessible from anywhere else.)

3) To run your script, press ALT+P with your mouse pointer over the script window.

And - welcome to blender dot org! Hope you'll churn out a couple of hundred useful scripts soon then! :D

rpmuller
Posts: 3
Joined: Wed Nov 27, 2002 10:12 pm

Post by rpmuller »

> 3) To run your script, press ALT+P with your mouse pointer
> over the script window.

Thanks. Where does the standard output go? I'm running this on OS X, so didn't start the program from the command line, so it isn't clear where it would be echoed.

Also, can you or someone else recommend a good source of documentation or tutorials?

Thanks!

Rick

rpmuller
Posts: 3
Joined: Wed Nov 27, 2002 10:12 pm

Post by rpmuller »

> Thanks. Where does the standard output go? I'm running this on OS X,
> so didn't start the program from the command line, so it isn't clear
> where it would be echoed.

Never mind -- figured it out -- goes to the console window. Duh!

I would still be grateful if someone could recommend documentation, tutorials, books, or any other way for me to gather information.

Rick

theeth
Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Post by theeth »

Like pretty much everything in Python, the Blender module is self documentable, so you can browse the module and print the docstrings to access the documentation and sometimes examples.

For the rest, I suggest you have a look at the Python forum on Elysiun ( http://www.elysiun.com/forum/viewforum.php?f=5 ). A good way to learn the API is to download some scripts and pick them apart.

Martin
Life is what happens to you when you're busy making other plans.
- John Lennon

Schlops
Posts: 20
Joined: Wed Oct 16, 2002 2:29 pm

Post by Schlops »

Some (old) python tutorials: http://www.blenderbuch.de/tutor/index.htm.
Stay Rude!

toisanji
Posts: 0
Joined: Fri Aug 08, 2003 7:25 am

Post by toisanji »

uhhhhhh....I'm on OS X, I'm having trouble finding it.
rpmuller wrote:> Thanks. Where does the standard output go? I'm running this on OS X,
> so didn't start the program from the command line, so it isn't clear
> where it would be echoed.

Never mind -- figured it out -- goes to the console window. Duh!

I would still be grateful if someone could recommend documentation, tutorials, books, or any other way for me to gather information.

Rick

Post Reply