You say a controller has been moved and want to know what it has the ability to affect. You can look on a per channel basis, like first looking at what connections go out from .translateX, those connections will be all that can be modified by that channel. Nothing else can happen unless you have scripts running in the background, like expressions or script nodes, which would make it slightly more tricky.
A more bruteforce and perhaps safe route would be to, in psuedocode, for each node in all nodes, cmd.ls(dag=True), for each attribute in all keyable attributes, cmd.listAttr(keyable=True), store each value, cmd.getAttr(node.attr) Then, move the controller and run the same code again. This time you will have two lists of attributes, one with values prior to moving the control and one afterwards. You can then do a for each value in listBefore, if valueBefore != valueAfter, print node. That way, you would get a before-and-after of all of the nodes that have changed since moving the controller. Hopefully, if the rig is not yours and you do not now of all the details of how it works, listing the connections or simply looking in the hypergraph would be the easiast approach to adjust, since a list of changed nodes only tells you what has changed, and not How it changed. If a scriptJob is doing some of the work, you might have to dig into the expressions inside of those to fully nail it down. Good luck On Sunday, 23 June 2013, Ævar Guðmundsson wrote: > Been wondering about the opposite case for this one lately but think the > same applies. My pondering relates to the lack of an "ancestor" > terminology in Maya, listRelatives is a command to query childs and parents > and although listRelatives has an allParents keyword I can't find any > notion of ancestry beyond the nearest family. > > Threw this together in order to get the full "family" tree but am aware > of two cases it doesn't fully list all relatives,you could potentially > switch out the parent keyword for children and it should traverse downwards > instead. > > def get_ancestors( node , checked=None ): > """Returns all connected ancestors of a given node""" > > if not checked: > checked = [] > ancestors = [] > checked.append( node ) > parents = maya.cmds.listRelatives( node , ap=True) > if parents: > for parent in parents: > if parent not in checked: > checked.append( parent ) > ancestors.append( parent ) > ancestors += get_ancestors( parent , checked=checked ) > > return ancestors > > print get_ancestors( node ) > > > Just a simple recursive function, something that keeps calling itself > until the job is done, but I iterate this example I'm copy pasting off my > notes app is not doing the full job so you will need to expand on it a > little. > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:;>. > To post to this group, send email to > [email protected]<javascript:;> > . > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
