PDA

View Full Version : maxscript : detect link between geometry


mindbreaker
12-23-2008, 11:44 AM
hi,
I'm writing my first max script but I'm stuck at the point of detecting a link between 2 objects (geometry).
The script basically write to an xml file some info about the scene.
I take the selection and write each item to the file. so now I want to add link info.
how can I detect if an object is linked to an other, get the other object's name and detect what's there relation (parent-child) ?

hope I make myself clear ,

grtz

Jsnyder
12-24-2008, 10:57 PM
I think this is what you're asking, to find out an objects parent is as simple as the .parent

Sphere01.parent would return the parent of that object
Sphere01.children would return the children of that object

JHN
12-26-2008, 08:03 PM
if object.children.count > 0 then print "object has children"

if object.parent != undefined then print "object has parent"


Cheers,
-Johan

ZeBoxx2
12-27-2008, 12:58 PM
keep in mind that this only works for static links and not 'links' established via a Link Constraint

JHN
12-27-2008, 01:30 PM
Or the more esotheric, "I swear those we're linked" links.

-Johan

CGTalk Moderation
12-27-2008, 01:30 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.