本文整理匯總了Python中Red9_CoreUtils.matchNodeLists方法的典型用法代碼示例。如果您正苦於以下問題:Python Red9_CoreUtils.matchNodeLists方法的具體用法?Python Red9_CoreUtils.matchNodeLists怎麽用?Python Red9_CoreUtils.matchNodeLists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Red9_CoreUtils
的用法示例。
在下文中一共展示了Red9_CoreUtils.matchNodeLists方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _matchNodesToPoseData
# 需要導入模塊: import Red9_CoreUtils [as 別名]
# 或者: from Red9_CoreUtils import matchNodeLists [as 別名]
def _matchNodesToPoseData(self, nodes):
'''
Main filter to extract matching data pairs prior to processing
return : tuple such that : (poseDict[key], destinationNode)
NOTE: I've changed this so that matchMethod is now an internal PoseData attr
@param nodes: nodes to try and match from the poseDict
'''
matchedPairs=[]
log.info('using matchMethod : %s' % self.matchMethod)
if self.matchMethod=='stripPrefix' or self.matchMethod=='base':
log.info('matchMethodStandard : %s' % self.matchMethod)
matchedPairs=r9Core.matchNodeLists([key for key in self.poseDict.keys()], nodes, matchMethod=self.matchMethod)
if self.matchMethod=='index':
for i, node in enumerate(nodes):
for key in self.poseDict.keys():
if int(self.poseDict[key]['ID'])==i:
matchedPairs.append((key,node))
log.info('poseKey : %s %s >> matchedSource : %s %i' % (key, self.poseDict[key]['ID'], node, i))
break
if self.matchMethod=='metaData':
getMetaDict=self.metaRig.getNodeConnectionMetaDataMap # optimisation
poseKeys=dict(self.poseDict) # optimisation
for node in nodes:
try:
metaDict=getMetaDict(node)
for key in poseKeys:
if poseKeys[key]['metaData']==metaDict:
matchedPairs.append((key,node))
poseKeys.pop(key)
break
except:
log.info('FAILURE to load MetaData pose blocks - Reverting to Name')
matchedPairs=r9Core.matchNodeLists([key for key in self.poseDict.keys()], nodes)
return matchedPairs