Reaaaaly easy python

Hellow all,

First… I shame myself for this question… But I really can’t find it anywhere working… :spin:

How can I import the value of a timer property so that I can use it in my script…

Thanks :slight_smile:

There is another thread currently 2 steps bellow yours with the answer :stuck_out_tongue:

Use own[“property”], where own is the object the timer belongs to.

what do you mean by import? How can you import a property in the same program?

anyways, to get it I would think it was

own = GameLogic.getCurrentController().owner

own[’(property name)’]

and it see it just:
print own[’(property name)’]
and it’ll show up in the blender prompt…

You can learn this easily from blendenzo’s tutorial…
http://www.blendenzo.com
he has a tutorial for beginners.

Unless your question is more complicated, then you need to explain more… I don’t know what you mean by import :\

Thanks both :slight_smile:

or with the 2.49 api its just :
own.propertyName
:slight_smile:

or with the 2.49 api its just :
own.propertyName
wrong. => you have to use own[‘propertyName’] from 2.49, like vibrunazo and linkxgl stated.
Attributes and properties are differentiated.

Attribution access of properties has been deprecated in 2.49 in favor of dictionary access. This has a couple of benefits:

  • Dictionary access if faster than attribute access
  • Separating methods and properties make for easier debugging