本文整理汇总了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