PDA

View Full Version : Accessing a specific node of an object.


ChrisBore
10-21-2009, 08:56 AM
I have a script I am trying to complete, but have hit a bit of a wall.

This is what I am trying to achieve;

A group of objects (rigid bodies), that have been collected through a little script and saved in to a string variable.

the Rb's are all set to passives at frame zero then are tested against a script on a per frame basis against the position of an activation object, if the test proves true then the the rigid body become active.

The problem is that as I have collected rigid bodies in my string I can't find away of getting the position of the RB to compare against (I believe its is stored in the parent poly object).

So here is my question, If I have a queried my RB object, how do I find its parent nodes name and hence its position?

Any help would be greatly appreciated,

Chrs

mlefevre
10-21-2009, 10:09 AM
Hi Chris,

Not sure if this is what you're after.


string $objParent[] = `listRelatives -parent "my_RB_object"`;
vector $parentPos = `xform -q -ws -translation $objParent[0]`;



Good luck!

ChrisBore
10-21-2009, 12:41 PM
Hey Matt.

Thanks for the code mate, initial tests seems to indicate that is exactly what I was needing, now just need to shoehorn it into my code!

Take it easy,

Chris

CGTalk Moderation
10-21-2009, 12:41 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.