Where the heck is the most up to date API?

I’ve got a couple days off work as I have family over, Figured I’d remake asteroids in blender (its going really well so far :D!) however, I cannot find a consistent API when looking up functions.

For example,
I’m using:

import GameLogic

But most of the examples on the API use:

import bpy

I’m at a loss here, please could someone clarify the API situation.

In Blender you can navigate to Help -> Python API Reference which takes you to the site for the Blender version you are using…

Google ‘Blender API’. The first link is always to the most recent API (in this case 2.71). You can also download it as a ZIP file so you can study offline.

Thank you, this was unknown to me :slight_smile:
I still think the API is in shambles aha

the BGE API look at this website.



Scroll down and see that there are Game engine modules.
bge == blender game engine.
bpy is for stuff outside the game engine i think.

Yup, I was aware of that.

Be aware that the blender api is different to the blender game engine api.
You can’t use bpy in the game engine.

The modules ypu can use are:

  • bge
  • mathutils
  • aud
    And a couple of others.

Be aware that the ‘Import GameLogic’ has been deprecated, and it is better to use ‘import bge’ and then ‘bge.logic.functionname’

@Allan - The API is pretty together in my opinion - you just have to know that you can only use the game engine modules and the standalone modules (like mathutils and aud). The actual documentation’s pretty solid, though some areas (like the bge.texture module) could use some work.

So there’s already like 5+ correct answers. But this link redirects to the latest API. Makes for a handy bookmark.

Great bookmark!