Blender question from a Python programmer

Hi everyone,

I am a seasoned Python programmer, and I am trying to figure out Blender. My goal is to write a game using Blender and Python and to distribute it as a standalone executable (ie: NOT distribute Blender or the Python interpreter with the game).

Here are my questions:

  1. I know you can run Python scripts within Blender, wowee. So once I create my models, armatures, scenes, sensors, actuators, controllers, etc., what do I have to do to get them to work with Python outside of Blender so that I can do the animation for a game?

  2. What is the purpose of Blender’s export function? Would exporting from Blender then allow me to use Python to manipulate those objects for a game?

  3. What is Yable? How is it connected to any of this?

  4. What is the “RealTimeEngine”? Is it just Blender’s API for Python to manipulate objects/models/whatever within Blender?

  5. What is Publisher? I assume it publishes a game as an executable. But does it publish a game with my Python scripts wrapped up in the executable?

  6. I’ve been reading that various versions of Blender no longer have a game engine, or some incomplete engine, etc. Which latest version of Blender should I use with which version of Python?

Thanks In Advance for answering my questions!

  1. Not sure, I haven’t had much experience with the game engine and python.

  2. Exporting from Blender usually exports a file’s data (usually meshes, often lamps, sometimes other things) and writes it to a file format to be read by another program. There is a directx exporter to .x files which may be used in game programming. However, once exported, these files are no longer tied to Blender - they are tied to the program that they were exported to. Read more about Yable for more info…

  3. Yable is a Python export script which exports Blender data into Yafray’s XML format. It has no bearing on realtime games, the exported data is independent of Blender and is only used by Yafray.

  4. Realtime engine consists of a logic system (which can either use Blender’s logic bricks or Python scripts) which connects actions (actuators) with triggers (sensors) using controllers to connect. The game engine also includes a physics engine. Older versions of Blender (Publisher 2.25, 2.23) contain the SOLID physics engine for physics simulation. The first BF 2.25 release and 2.26 have no usable game engine. It is hoped that either a new game engine (such as ODE or Enji) can be included in up-and-coming versions of Blender (experiments have already been committed to the experimental CVS). Also, the SOLID library v2.0 has just gone open source. Hopefully, v3.0 will be opensourced soon, since this is what Blender’s physics engine utilizes. I hope that all is right. :slight_smile:

  5. Publisher was the premium, non-free line of Blender products designed for deploying games (it also had non-game features that free Blender did not). There is no longer a Publisher since all of Blender is opensource. Any new version of Blender should be able to deploy a game (provided it has a game engine). I do not know, like I stated above, if Python scripts work in executables or not.

  6. To fully utilize the game capabilities of Blender, I would advise using version 2.23 with Python 2.0. The only problem is these don’t package completely independent executables. You might want to wait until a stable game engine is built into Blender (either an open source SOLID library, or the promising ODE) and use that new version of Blender with Python 2.2.

I disagree (some) with the above response to question 6:
blender 2.25 has the (not in 2.23) actuators
CD, Game, Visibility
(play audio cds, load new/ restart this file, change object visiblity)

and sphere mapping!

there may be bugs in 2.25 or 2.26 not in 2.23
(resulting in yable problems in 2.25? I don’t use yable, couldn’t tell you)


blender doesn’t currenty give python as much access as I would like. A major example is armatures, but curves, nurb surfaces, vertex keys, and a significant amount more is on that list as well.

hopefully this will change with 2.28 (doubt it in 2.27)

Oh, I think I posted on accident that 2.25 has no physics engine. IT DOES :-? (teaches me to speak before I check). Well, after what z3r0 d wrote, I would also suggest 2.25 for games. I completely spaced out about that. Yes, it definitely has more logic features than the other version and DOES have a complete game engine.

And I am most definitely a Python programmer and I can’t wait to see curves, armatures and especially VK’s accessible to Python. Ton just posted on blender.org plans to begin merging some old Python API code with the new code, which will hopefully be more complete (I believe one of the much older API’s, some of Jan Walter’s work, did include access to everything, but then again I wouldn’t want to say more than I know :expressionless: ).