Notifications
Clear all

[Closed] get complete hierarchy

 lo1

One of these days, Denis…

Do those two functions that you added get dependents of hierarchy’s?

Aside from that, is there a way to add an option to get all referenced geometry associated with an object…say for example you selected and IK handle and you wanted to get the objects it’s associated with as well as the object which is being used as it’s Target Swivel Angle? or look at constraint nodes?

my descendant/ascendant functions do nothing about dependency.

to get dependencies of a node use the refs structure.
usually(not always) refs.dependsOn returns all nodes that the node depends on.
but it doesn’t return weak references. a good sample is a target object used as Swivel Angle.
it’s easy to see…
let say we have a IK_Chain_Object (let’s call it chain_object), and its Target for Swivel Angle (let’s call it target_object)
now check:


   refs.dependson chain_object
 -- no target_object in list
   -- well... maybe controller depends on
   refs.dependson chain_object.controller
   -- nope again
   -- but ..!
   refs.dependencylooptest chain_object target_object
   -- says that chain_object depends on target_object
   

so probably in this case we need a ‘reverse engineering’ to get dependency
(in general it’s slow)

2 Replies
(@jokermartini)
Joined: 11 months ago

Posts: 0

How would one then collect nodes being used as position constraints? Some way?

(@denist)
Joined: 11 months ago

Posts: 0

if you know that it’s a position constraint use its methods (getNumTargets(), getNode())

do you want to see another funny trick?
check this out:


for n in <node> collect n

it will collect all node’s children and children of children…

it sounds weird but the node is a collection. with a very specific enumeration rule.
there some other ‘obscure’ collections in max:
multimaterial
selectionset
node.children
obj.verts(faces,edges)

but I couldn’t find any other than node collection that calls recursive enumeration.

True. I just wasn’t sure if there was a more universal way of checking.

Page 2 / 2