Execute a script without using the GUI

Hello,

I am quite new at Blender and although I have studied about it, I have a simple (I think) problem.
My project is about using Blender and creating an animation video. What I want to do is to write a script in or out of Blender’s GUI, save it and then execute it.

Is there a tutorial that I could read about doing this?

(I use Macosx Lion)

Thanks in advance

from the command line docs:

-P or --python <filename> Run the given Python script (filename or Blender Text)

The thing is that I have to Built Blender First, right?

The thing is that I have to Built Blender First, right?

I don’t know what you mean by that. You need to run this command from the commandline, so you would have to open a terminal, cd into the directory where the blender binary is located (it’s inside the .app container of blender for mac) and run it from there. You have to know how to use a terminal on mac.

I know how to use terminal, but I don’t know we it can’t execute a script.
Well, I am in the blender.app and I do the following


cd blender.app
cd Contents
cd MacOS
ls

and afterwards I have the folder “2.57” and “blender”.

blender is the one that I need to execute right?

so I do the following
<filename> = the absolute path of my ImportRoom.py


blender --python &lt;filename&gt;
blender -P &lt;filename&gt;
blender -p &lt;filename&gt;

and I get the following result

-bash: blender: command not found

I have read in some tutorial that I have to build blender to use terminal
http://wiki.blender.org/index.php/Dev:2.5/Doc/Building_Blender/Mac
is that right?

Any help would be appreciated!

Dimitra

Are you sure?

blender is the one that I need to execute right?

yes, the binary should be called blender


-bash: blender: command not found

On UNIX, you would need to type “./blender” not just “blender” in order to run it from the current directory

I have read in some tutorial that I have to build blender to use terminal

Where exactly does it say that? It doesn’t say that in the build directions as far as I looked.

Thank you very much!!!

That was exactly the problem. I was confused with all the information provided, that I didn’t believe that my problem had such a simple solution. I really appreciate your help!!!