Get affected mesh

28 views
Skip to first unread message

Luke Harris

unread,
Mar 30, 2015, 8:01:10 AM3/30/15
to python_in...@googlegroups.com
I'm trying to determine which meshes in a char rig are affected by dynamics - eg using nucleus/hairSystem for a pony tail. When I select the hairSystem node, the ponytail mesh turns pink/purple implying it is affected by the hairsystem. How can I get this information with python - ie which meshes turn pink (are affected by) a certain node? There isn't a getAffected() command similar to displayAffected(). The hairSystem node is not in the history of the ponytail mesh node (as far as I can tell) so I'm stumped in that respect...

Luke Harris

unread,
Apr 2, 2015, 12:54:49 PM4/2/15
to python_in...@googlegroups.com
It was the wierd way ikHandles affect joints without a connection ikHandle -> Joint that baffled me here. To get it I needed to search downstream from the hairSystem to find the ikHandle, then upstream to find the joint, and then downstream to find the mesh

for hairSystem in pm.ls(type="hairSystem"):
   
for ikHandle in hairSystem.future(type="ikHandle"):
       
for joint in ikHandle.inputs(type="joint"):
           
for mesh in joint.future(type='mesh'):
               
print "%s is affected by dynamic system %s" % (mesh, hairSystem)
Reply all
Reply to author
Forward
0 new messages