Using Properties with scripts

How do i access (get, set) the properties created in the logic panel from a python script. I’m sure this is noob question, please have patience with me.

Also has anyone done an in depth tutorial, course or book, on python and the blender api.

Don’t know if this helps, but I am a python noob and I am using and alot. Found the presentation of structure and examples helpful.

If you mean how to access game properties from the Blender API, not via the game engine API, here’s an example. This gets info about a property called “testprop” on the active object and prints it to the console window:

import Blender

scn = Blender.Scene.getCurrent()
ob =

prop = ob.getProperty("testprop")
print,, prop.type

Here are the relevant object functions to access properties, and here for the properties themselves.

Thanks, now if I want to change the value?

In you script Sanne just ( = #) will set the property to what ever value i choose.

I think I’ve got it.

You’re welcome, avbsoftworks, glad I could help. :slight_smile: