Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / Node Hierarchy Position
  RSS 2.0 ATOM  

Node Hierarchy Position
Rate this thread
 
38032
 
Permlink of this thread  
avatar
  • tfrey
  • Posted: 21 December 2009 10:01 PM
  • Total Posts: 4
  • Joined: 28 August 2006 03:05 AM

Hello Area People :)

I tried to realize a script where I can output the current node “position” inside the outliner/hierarchy.

For example I have the following Objects inside the Outliner:
persp
top
front
side
pCube1
-pCube2 (parent is pCube1)

When i select Node pCube2 and I run the script it should show a Number which indicates the position.
Something like: 4|0

pCube1 is the 4th object (beginning with 0) and pCube2 is the first object (0).

My main problem is, I dont know how I can get information about the hierarchy of an object.

I have here a simple script that returns the type of the selected node.

//make a list of the shapes in the first selected object
string $list[] = `listRelatives -s $sel[0]`;
print("Connected shape is “ + $list[0])
//Find its type
nodeType $list[0];

Which commands could I use to get outliner/hierarchy informations of a selected object?

Thanks for any inputs!



Replies: 0