当前位置: 首页>>代码示例>>Python>>正文


Python Red9_Meta.getMetaNodes方法代码示例

本文整理汇总了Python中Red9.core.Red9_Meta.getMetaNodes方法的典型用法代码示例。如果您正苦于以下问题:Python Red9_Meta.getMetaNodes方法的具体用法?Python Red9_Meta.getMetaNodes怎么用?Python Red9_Meta.getMetaNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Red9.core.Red9_Meta的用法示例。


在下文中一共展示了Red9_Meta.getMetaNodes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_getMetaNodes_mTypesAsClass

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
 def test_getMetaNodes_mTypesAsClass(self):
     #mTypes test passing in Class rather than string
     nodes=sorted(r9Meta.getMetaNodes(mTypes=[r9Meta.MetaRig,r9Meta.MetaFacialRig]),key=lambda x: x.mClass.upper())
     assert [n.mClass for n in nodes]==['MetaFacialRig','MetaRig']
     
     nodes=r9Meta.getMetaNodes(dataType=None, mTypes=[r9Meta.MetaRig])
     assert nodes==['MetaRig_Test']
开发者ID:vitattoo,项目名称:Red9_StudioPack,代码行数:9,代码来源:Red9_MetaTests.py

示例2: test_getMetaNodes_mTypes

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
 def test_getMetaNodes_mTypes(self):    
     #mTypes test
     nodes=sorted(r9Meta.getMetaNodes(mTypes=['MetaRig','MetaFacialRig']),key=lambda x: x.mClass.upper())
     assert [n.mClass for n in nodes]==['MetaFacialRig','MetaRig']
     
     nodes=r9Meta.getMetaNodes(dataType=None, mTypes=['MetaRig'])
     assert nodes==['MetaRig_Test']
开发者ID:vitattoo,项目名称:Red9_StudioPack,代码行数:9,代码来源:Red9_MetaTests.py

示例3: test_getMetaNodes_mInstances

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
 def test_getMetaNodes_mInstances(self):
     #mInstances tests
     nodes=r9Meta.getMetaNodes(dataType=None, mInstances=['MetaRig'])
     assert nodes==['MetaFacialRig_Test', 'MetaRig_Test']
     nodes=r9Meta.getMetaNodes(mInstances=['MetaRig'])
     assert [n.mNodeID for n in nodes]==['MetaFacialRig_Test', 'MetaRig_Test']
     nodes=r9Meta.getMetaNodes(mInstances=['MetaClass'])
     assert sorted([n.mNode for n in nodes])==['MetaClass_Test',
                                               'MetaFacialRigSupport_Test',
                                               'MetaFacialRig_Test',
                                               'MetaRigSupport_Test',
                                               'MetaRig_Test']  
开发者ID:vitattoo,项目名称:Red9_StudioPack,代码行数:14,代码来源:Red9_MetaTests.py

示例4: test_getMetaNodes_mInstancesAsClass

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
 def test_getMetaNodes_mInstancesAsClass(self):
     #mInstances tests passing in Class rather than string
     nodes=r9Meta.getMetaNodes(dataType=None, mInstances=[r9Meta.MetaRig])
     assert nodes==['MetaFacialRig_Test', 'MetaRig_Test']
     nodes=r9Meta.getMetaNodes(mInstances=[r9Meta.MetaRig])
     assert [n.mNodeID for n in nodes]==['MetaFacialRig_Test', 'MetaRig_Test']
     nodes=r9Meta.getMetaNodes(mInstances=[r9Meta.MetaClass])
     assert sorted([n.mNode for n in nodes])==['MetaClass_Test',
                                               'MetaFacialRigSupport_Test',
                                               'MetaFacialRig_Test',
                                               'MetaRigSupport_Test',
                                               'MetaRig_Test']  
开发者ID:vitattoo,项目名称:Red9_StudioPack,代码行数:14,代码来源:Red9_MetaTests.py

示例5: test_getMetaNodes_mAttrs

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
 def test_getMetaNodes_mAttrs(self):
     mNodes=r9Meta.getMetaNodes(mAttrs='mirrorSide=1')
     assert sorted([node.mNodeID for node in mNodes])==['L_Arm_System',
                                              'L_Fingers_System',
                                              'L_Leg_System',
                                              'L_Toes_System',
                                              'L_other_System'] 
     mNodes=r9Meta.getMetaNodes(mAttrs=['mirrorSide=1','systemType=Arm'])
     assert sorted([node.mNodeID for node in mNodes])==['L_Arm_System']
     
     mNodes=r9Meta.getMetaNodes(mAttrs=['systemType=Leg'])
     assert sorted([node.mNodeID for node in mNodes])== ['L_Leg_System', 'R_Leg_System']
开发者ID:vitattoo,项目名称:Red9_StudioPack,代码行数:14,代码来源:Red9_MetaTests.py

示例6: pushPoseFromLib

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
def pushPoseFromLib(poseUIObj):
    mFacial = r9Meta.getMetaNodes(mTypes='Red9_MetaFacialCore')[0]
    posepath = poseUIObj.getPoseDir()
    poseName = os.path.basename(poseUIObj.getPoseSelected())
    print 'posepath', posepath
    print 'poseName', poseName
    mFacial.poses_pull_from_library(posepath, poseName)
开发者ID:markj3d,项目名称:Red9_StudioPack,代码行数:9,代码来源:Red9_facial_poseHandler.py

示例7: setup

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
 def setup(self):
     cmds.file(os.path.join(r9Setup.red9ModulePath(),'tests','testFiles','MetaRig_anim_jump.mb'),open=True,f=True)
     self.mRig = r9Meta.getMetaNodes(mTypes=r9Meta.MetaRig)[0]
     self.poseFolder = getPoseFolder()
     
     #make our PoseData object with the unitTest config loaded
     filterNode=r9Core.FilterNode_Settings()
     filterNode.read(red9MetaRigConfig)
     self.poseData=r9Pose.PoseData(filterNode)
开发者ID:Bumpybox,项目名称:Tapp,代码行数:11,代码来源:Red9_PoseTests.py

示例8: test_registerMClassNodeMapping

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
 def test_registerMClassNodeMapping(self):
     '''
     test the registry functions for nodeTypes
     '''
     cmds.file(new=True,f=True)
     r9Meta.MetaClass(name='standardNetworkMetaNode')
     assert [cmds.nodeType(n.mNode) for n in r9Meta.getMetaNodes()]==['network']   
      
     #register transforms to the NodeTypes
     r9Meta.registerMClassNodeMapping(nodeTypes='transform')
     assert r9Meta.getMClassNodeTypes()==['network', 'transform']
     new=r9Meta.MetaClass(name='newTransformMetaNode', nodeType='transform')
     assert [cmds.nodeType(n.mNode) for n in r9Meta.getMetaNodes()]==['network','transform']  
     
     #reset the NodeTypes
     r9Meta.resetMClassNodeTypes()
     assert r9Meta.getMClassNodeTypes()==['network']
     assert [cmds.nodeType(n.mNode) for n in r9Meta.getMetaNodes()]==['network'] 
开发者ID:miketon,项目名称:SymLink,代码行数:20,代码来源:Red9_MetaTests.py

示例9: removeAttrFromHUD

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [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()
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:19,代码来源:__init__.py

示例10: test_longJsonDumps

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
    def test_longJsonDumps(self):
        '''
        Test the handling of LONG serialized Json data - testing the 16bit string attrTemplate handling
        NOTE: if you set a string to over 32,767 chars and don't lock the attr once made, selecting
        the textField in the AttributeEditor will truncate the data, hence this test!
        '''
        data= "x" * 40000
        self.MClass.addAttr('json_test', data)
        assert len(self.MClass.json_test)==40000
        
        #save the file and reload to ensure the attr is consistent
        cmds.file(rename=os.path.join(r9Setup.red9ModulePath(),'tests','testFiles','deleteMe.ma'))
        cmds.file(save=True,type='mayaAscii')
        cmds.file(new=True,f=True)
        cmds.file(os.path.join(r9Setup.red9ModulePath(),'tests','testFiles','deleteMe.ma'),open=True,f=True)

        mClass=r9Meta.getMetaNodes()[0]
        assert len(mClass.json_test)
开发者ID:vitattoo,项目名称:Red9_StudioPack,代码行数:20,代码来源:Red9_MetaTests.py

示例11: addAttrToHUD

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [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()
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:20,代码来源:__init__.py

示例12: setup

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
 def setup(self):
     cmds.file(os.path.join(r9Setup.red9ModulePath(),'tests','testFiles','Meta_Network_WalkTest.ma'),open=True,f=True)
     self.mRig=r9Meta.getMetaNodes(mTypes='MetaRig')[0]
开发者ID:vitattoo,项目名称:Red9_StudioPack,代码行数:5,代码来源:Red9_MetaTests.py

示例13: test_getMetaNodes

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
 def test_getMetaNodes(self):
     nodes=sorted(r9Meta.getMetaNodes(),key=lambda x: x.mClass.upper())
     assert [n.mClass for n in nodes]==['MetaClass','MetaFacialRig','MetaFacialRigSupport','MetaRig','MetaRigSupport']
开发者ID:vitattoo,项目名称:Red9_StudioPack,代码行数:5,代码来源:Red9_MetaTests.py

示例14: _res

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
#>>Instance query =========================================================================
#Okay, now let's search some stuff
#First, a call just to see some info about meta class inheritance as registered in the subclass registry
r9Meta.getMClassInstances(r9Meta.MetaClass)

#...make it more readable
for o in r9Meta.getMClassInstances(r9Meta.MetaClass):print o
#...as you can see there are a lot of subclasses. What if we just wanted to see subclasses to cgmObject
for o in r9Meta.getMClassInstances(cgmMeta.cgmObject):print o#...quite a few less

#>>getMetaNodes =========================================================================
#...just to make seeing stuff a little easier, we're gonna make a little pass through function
def _res(l):
    for o in l:print o

_res(r9Meta.getMetaNodes())#...returns all metaNodes in the scene
_res(r9Meta.getMetaNodes(dataType = ''))#...returns as dag strings
_res(r9Meta.getMetaNodes(mTypes = 'cgmObject'))#...only returns a given meta type
_res(r9Meta.getMetaNodes(mTypes = r9Meta.MetaClass))#...only returns a given meta type
_res(r9Meta.getMetaNodes(mInstances = 'cgmNode'))#...returns both the cgmNode in the scene and the cgmObject as it's a subclass to cgmNode

_res(r9Meta.getMetaNodes(mAttrs = 'tx=0'))#...get any nodes with a tx value of 1
_res(r9Meta.getMetaNodes(mAttrs = 'testAttr=2'))#...get our set attr
_res(r9Meta.getMetaNodes(mAttrs = 'NOT:testAttr=2'))#...get any nodes that don't have this value


#...relational 
_res(n1.getChildren())#...can see all our children of our 'parent' node
_res(n1.getChildren(asMeta = True))#...can get data as meta
n1.getChildren(cAttrs = ['childNode'])#....cAttrs checks the wiring
n1.getChildren(cAttrs = ['childNode2'])
开发者ID:Italic-,项目名称:maya-prefs,代码行数:33,代码来源:help_introToMeta.py

示例15:

# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import getMetaNodes [as 别名]
mLambert.diffuse     #>>0.5
mLambert.color       #>>(0.5, 0.5, 0.5)
mLambert.color=(1,0.2,0.2) #sets the compound float3 attr

mLambert.diffuse=0.7 #sets the diffuse directly
mLambert.diffuse     #>>0.7


'''
General
===============================================================
Generic call to find all mClass nodes in the scene. This also takes
a type argument so you can return only nodes of a given class type
NOTE: 'type' the given class type must exist as a key in the RED9_META_REGISTRY 
'''
mClass = r9Meta.getMetaNodes()
mClass = r9Meta.getMetaNodes(dataType='mClass',mTypes='MetaRig')
#Return only MetaRig class objects. If the dataType isn't 'mClass' then we
#return the standard MayaNodes, else we return the mClass initialized to the class object

#Connect the selected Maya Nodes to the mClass node under a Multi-Message attr 'mirrorLeft'
node.connectChildren(cmds.ls(sl=True),'mirrorLeft')
node.mirrorLeft    #will now return all connected nodes to the message attr

#Connect the selected Maya Node to the mClass node under a NON Multi-Message attr 'simpleChild'
#this is what most of the MRig calls use as a single connection describes a single MayaNode
node.connectChild(cmds.ls(sl=True)[0],'simpleChild')
node.simpleChild    #will now return all connected nodes to the message attr

r9Meta.getConnectedMetaNodes(nodes, source=True, destination=True, dataType='mClass')
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:32,代码来源:MetaData_Getting_started.py


注:本文中的Red9.core.Red9_Meta.getMetaNodes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。