You are not logged in.
Hi,
In my AOI learning process I'm starting to look at scripting and came across a very basic hurdle. How do I get the location and size of an object in the scene?
I looked at the particle script (which has to get the location of the particle emitter) and I guess it has to do with the coordinate system. I also found this topic that helps a bit, but I don't completely understand.
My understanding so far is that the origin of an object's coordinate system corresponds to the position of the object in the scene, so these are the (x,y,z) values that I see when I look at the object properties in the object editor. Is that correct?
And from Francois' answer in the topic above, I think that zdir and updir have to do with the size, in the local up direction and out-of-screen direction, but why are these (x,y,z) vectors? I would expect just doubles, indicating so many units in the zdir and so many units in the updir. So I'm still a bit confused.
And in my concrete case, where I'm trying to get the height of a cylinder, I can see in the API that there is a method setSize (x,y,z) for the Cylinder class, but I can't find a getSize, neither in the Cylinder class, nor the Object3D or ObjectInfo class.
Hope someone can help 
Thanks.
Offline
try the .getBounds() method on the Object3D, this returns a bounding box which can allow you to determine the size. I don't know if this is something that people do a lot, I had to think a bit. My advice, work through the examples on the main webpage http://www.artofillusion.org/docs/scripttut/index. These helped me a lot. There is a bit of a learning curve, keep at it and you will soon be able to do amazing things.
Offline