本文整理汇总了Python中Red9.core.Red9_CoreUtils.nodeNameStrip方法的典型用法代码示例。如果您正苦于以下问题:Python Red9_CoreUtils.nodeNameStrip方法的具体用法?Python Red9_CoreUtils.nodeNameStrip怎么用?Python Red9_CoreUtils.nodeNameStrip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Red9.core.Red9_CoreUtils
的用法示例。
在下文中一共展示了Red9_CoreUtils.nodeNameStrip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: removeAttrFromHUD
# 需要导入模块: from Red9.core import Red9_CoreUtils [as 别名]
# 或者: from Red9.core.Red9_CoreUtils import nodeNameStrip [as 别名]
def removeAttrFromHUD(node, attr):
"""
remove attrs from the MetaHUD
"""
currentHUDs = r9Meta.getMetaNodes(mTypes=r9Meta.MetaHUDNode,
mAttrs='mNodeID=CBMonitorHUD')
if currentHUDs:
metaHUD=currentHUDs[0]
if attr:
metaHUD.killHud()
monitoredAttr='%s_%s' % (r9Core.nodeNameStrip(node), attr)
print 'removing attr :', attr, monitoredAttr
try:
metaHUD.removeMonitoredAttr(monitoredAttr)
except:
pass
metaHUD.refreshHud()
示例2: addAttrToHUD
# 需要导入模块: from Red9.core import Red9_CoreUtils [as 别名]
# 或者: from Red9.core.Red9_CoreUtils import nodeNameStrip [as 别名]
def addAttrToHUD(node, attr):
"""
adds node.attr to the HUD using Red9_Meta.MetaHUDNode
"""
currentHUDs = r9Meta.getMetaNodes(mTypes=r9Meta.MetaHUDNode,
mAttrs='mNodeID=CBMonitorHUD')
if not currentHUDs:
metaHUD = r9Meta.MetaHUDNode(name='CBMonitorHUD')
else:
metaHUD = currentHUDs[0]
monitoredAttr='%s_%s' % (r9Core.nodeNameStrip(node), attr)
metaHUD.addMonitoredAttr(monitoredAttr,
value=mc.getAttr('%s.%s' % (node, attr)),
refresh=False)
mc.connectAttr('%s.%s' % (node, attr), '%s.%s' % (metaHUD.mNode, monitoredAttr))
metaHUD.refreshHud()
示例3: test_nodeNameStrip
# 需要导入模块: from Red9.core import Red9_CoreUtils [as 别名]
# 或者: from Red9.core.Red9_CoreUtils import nodeNameStrip [as 别名]
def test_nodeNameStrip(self):
assert r9Core.nodeNameStrip('|root|of|systems|ctrl') == 'ctrl'
assert r9Core.nodeNameStrip('|AA:root|AA:of|AA:systems|AA:ctrl') == 'ctrl'
assert r9Core.nodeNameStrip('|BBBB:ctrl') == 'ctrl'