the title says it all
no it doesnt.
what properties do you want to acess?
You can read and write in properties if
you get it in a variable with Object.Get(Name) or
But properties format are not always the same. It can be
float, or list, or another objet. Try this code to see all
of them except ‘inverse’ which doesn’t exist, and matrix
which makes script crasch.
import Blender from Blender import Object Obj=Object.GetSelected() Vlist=dir(Obj) print dir(Obj) for property in Vlist: if property.find('inverse')==-1 and property.find('matrix')==-1: print property,':',; exec "print str(Obj."+property+")"
To see an example of code to change the name of an object group (the rest of the text is in french, sorry, no time for translation):
that code’s not really what i need( i don’t even undertand what it does)
i just need to know how to read/write object properties, the ones in the realtime buttons
In the game engine? Why didn’t you say it?
Link this code to a sensor in the real time
import GameLogic controller = GameLogic.getCurrentController() owner = controller.getOwner() print dir(owner)
Then you can see in in the console :
‘getLinearVelocity’, ‘getMass’, ‘getMesh’, ‘getOrientation’,
‘restoreDynamics’, ‘setOrientation’, ‘setPosition’, ‘setVisible’,
You can use functions of this list to modify a lot of properties.
PYTHON SCRIPT ERROR:
Traceback (most recent call last):
File “Text”, line 1, in ?
ImportError: No module named GameLogic
nothing seem’s to work for me anymore…
This scipt doesn’t work if it’s not linked to a sensor.
And you don’t need to do Alt-p to launch it.
1/ Select one object
2/ Go to the Realtime buttons
3/ Add a Sensor “Always”
4/ Add a Controller Python, and write the script name.
5/ link the sensor to the controler
6/ Pkey to enter in GameMode
7/ Esckey to stop GameMode
Look at the DOS console.
hey!something finnally works!incredible!amazing!unbelieveable!