How to Select joint hierarchy with the Script?

How to Select joint hierarchy with the Script?

Anonymous
Not applicable
13,829 Views
3 Replies
Message 1 of 4

How to Select joint hierarchy with the Script?

Anonymous
Not applicable
Hi, how to select joint hierarchy with the script, or if select the parent joint the i want to select whole hierarchy (listReleatives or listConnections) like.
so how to do this
b'se i want to create spine stretch, i created script for arclength, multiplydivide nodes,and connecting arclength to multplydivides with just one click. but when connection to create for m'divide node to joints i have to select joints manually in outliner, instead of this how can i select hierarchy with script.
13,830 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Very Simple:

select -hi;


Selecting First Joint with hierarchy with Script:

select "Your Joint name without quotes";
select -hi;
Message 3 of 4

adamghering
Contributor
Contributor

ah yes but how to select only joints in heirarchy

 

as with a rig there are multiple bits that arent joints. you dont want to select those

 

how do you select "only" the joints in the heirarchy?

0 Likes
Message 4 of 4

tdHendrix
Collaborator
Collaborator

Doing something like this should get the children joints after selecting the top joint and running the code.

 

import maya.cmds as cmds

children_joints = cmds.listRelatives(allDescendents=True, type='joint')
cmds.select(children_joints, add=True)

Greg Hendrix - Senior Technical Animator
LinkedIn : Twitter