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
Object.GetSelected()[0] functions.
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()[0]
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):
http://jmsoler.free.fr/didacticiel/blender/tutor/python_renobject.htm
jm
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
engine.
import GameLogic
controller = GameLogic.getCurrentController()
owner = controller.getOwner()
print dir(owner)
Then you can see in in the console :
[âapplyImpulseâ, âdisableRigidBodyâ,âenableRigidBodyâ,
âgetLinearVelocityâ, âgetMassâ, âgetMeshâ, âgetOrientationâ,
âgetParentâ,âgetPositionâ, âgetReactionForceâ,âgetVelocityâ,
ârestoreDynamicsâ, âsetOrientationâ, âsetPositionâ, âsetVisibleâ,
âsuspendDynamicsâ]
You can use functions of this list to modify a lot of properties.
jm
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.
jm
hey!something finnally works!incredible!amazing!unbelieveable!