Esempio n. 1
0
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()
Esempio n. 2
0
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()
Esempio n. 3
0
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()
Esempio n. 4
0
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()
 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'
 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'