Here we have the 2 Top nodes of both hierarchies selected. This is the CORE FUNCTION of the entire AnimationUI, it's how it processes matched pairs into something usable for the code:
import Red9.core.Red9_CoreUtils as r9Core #make a settings object and set the internal filter types filter=r9Core.FilterNode_Settings() filter.nodeTypes='nurbsCurve' filter.searchPattern='Ctrl' #use the processMatchedNodes call to do all the work for you! matched=r9Core.processMatchedNodes(cmds.ls(sl=True),filterSettings=filter) #matched is an object which contains MatchedPairs, a list of tuples in #the form [(source, destination)] This in turn lets us unpack the #data in one go for processing for source,dest in matched.MatchedPairs: print source print destThe same filter can be passed into most of the Red9 functions and is used extensively across all the code. For example the above code is filtering hierarchies, so if we just wanted to search a single hierarchy we can pass the same filter to the FilterNode class:
filterNode=r9Core.FilterNode(cmds.ls(sl=True),filterSettings=fSet) filterNode.ProcessFilter()This is again a key concept in the entire pack so worth looking at if you're intending to use the code.