I want to develop models of spaceships and planets using blender and store them as one .blend file. Then I want to code the game outside of blender in plain python using IDLE and “import Blender” so to say as module to get access to the blender files. When finished programming, I want to start the python program without starting blender.
Is this possible or do I have to code inside Blender !?
And if it must be done in blender:
a) how can I instantiate dynamically objects (i.e. generate new spaceships during runtime then) ?
b) how do I extend the blender embedded python language (e.g. extending it with own network module, VTK module, wxPython module, numeric module etc.) ?
Thanks
Sabrina
For example - is this API script only startable as a standalone python program ?
import Blender
scene = Blender.Scene.getCurrent () # get the current scene
ob = Blender.Object.New (‘Camera’) # make camera object
cam = Blender.Camera.New (‘ortho’) # make ortho camera data object
ob.link (cam) # link camera data with the object
scene.link (ob) # link the object into the scene
ob.setLocation (0.0, -5.0, 1.0) # position the object in the scene
Blender.Redraw() # redraw the scene to show the updates.
No as the Blender module isn’t available outside blender but…
If you want the script to execute when you open a blend file YES, just put all this in a python file loaded in blender and enable a scene scriptlink on load for that python file.
Then each time you open THAT blend file (unless you set that file as the default hehe) the script will run
But seems that you want to perform a default configuration, in that case just arrange the windows views cameras, etc… as you want and pres Ctrl + U