PDA

View Full Version : MEL Transformation of Objects


Phlok
01-27-2009, 07:51 PM
Hi,

In my scene there are some polyCubes, and I want to write a script that creates a smaller polyCube in the middle of each of the polyCubes already in the scene.

The problem is, the big cubes are scattered all over the scene, their history deleted and a "Freeze Transformations" was done to them. So if I do:

xform -q -matrix -ws pCubeN;

All I get is 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1, which is not what I need, of course.

I hoped the worldSpace flag would return the transformations relative to worldSpace, but taht doesn't seem to work.

So how do I get the information I need for creating the little cubes?
Maybe there's a more simple approach, if you got an idea please let me know!

Thanks!

Wick3dParticle
01-27-2009, 09:02 PM
Hey Flo.


Why don't you try using the 'center' attribute to retrieve the world space? This will return to you the center of the bounding box in world space.

vector $cubeCenter = `getAttr pCube1.center`;


~Ilan

Phlok
01-27-2009, 11:25 PM
Thank you! I think that's exaclty what I was looking for!

CGTalk Moderation
01-27-2009, 11:25 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.