2.5 api reference? tutorials? useful reading? anything?

I hope this is the right forum…

Hi, I need to wrap my head around BGE python for a little project. With 2.5 approaching stability it’s pointless to start anything with 2.49. I’m aware the api is not yet stable, but it will be easier to do a bit of refactoring and fix a few bugs than to rewrite the whole thing when 2.5 becomes stable, or write extensive wrappers. The trouble is, most of the examples and tutorials don’t work for 2.5 and I’m having a hard time finding any reference beyond the few wiki pages at blender.org. The few tutorials for 2.5 that I managed to find, such as Ira Krakow’s, mostly deal with the basics of the basics, such as how to use the console and auto-complete rather than how to get stuff done in 2.5. Those are probably very useful for people new to python, or programming in general, but that’s not at all what I need.

I’m posting this because after a day of searching I haven’t found anything. Other than diving into the actual blender source code, which is way over my head, is there any 2.5-specific reference you can suggest? Even auto-generated documentation, simple list of api calls and arguments, or 2.4x->2.5 changelog would be appreciated.

Edit: Just my luck. 30 minutes after posting this, I’ve found what I was looking for. All this time I never thought to click the Types link.

Now I feel really stupid.

Many of the tutorials you find should work in 2.5 with possibly some minor adjustments. As long as the script isn’t using depricated functions, and is python 3.1, it should work. The most common change needed to get a script from python 2.6 to 3.1 is using print as a function instead of a statement( print(“Hello, World!”) instead of print “Hello, World!”).

You’ll want to use the game engine modules (bge.*) instead of the bpy ones. Also, the BGE api is pretty stable and there probably will be no more breaking changes to the BGE modules.

Check out these ones:

Thank you, these will come in handy! :slight_smile:

These are all for Blender’s bpy module, which is not recommended for use inside the BGE.

Oh. But I’m guessing most of the relevant functionality is present or accessible from bge.

By the way, I notice there are many classes named KX_something_or_other. What do KX and the other prefixes stand for?


KX stands for Ketsji, which was the name of the original Blender Game Engine, developed by NaN when Blender was not open source. SCA means “Sensors, Controllers, Actuators”. The SCA class contains the api for the logic bricks themselves (the “gamelogic”). I don’t know what BL stands for, and I’m not sure why the amalgamation of KX_SCA is used in the current engine.

This interesting and outdated document the general layout of the original engine, including a list of the modules:

When the BGE was re-implemented as an open source game engine in Blender 2.33a, the initial plan seemed to be to bring back the previous Ketsji engine to the fullest extent possible, hence the classes inherited their old names.

Thank you! Your knowledge of Blender lore is awe inspiring!