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


Python core.Red9_Meta类代码示例

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


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

示例1: _reload

def _reload():
    '''
    reload carefully and re-register the RED9_META_REGISTRY
    '''
    Red9.core._reload()
    reload(cgm_General)    
    reload(cgm_Meta)
    reload(cgm_PuppetMeta)
    reload(cgm_RigMeta)
    reload(cgmPy.validateArgs)
    reload(rigger.ModuleFactory)
    reload(rigger.JointFactory)
    reload(rigger.TemplateFactory)
    reload(rigger.PuppetFactory)
    reload(rigger.RigFactory)
    reload(rigger.ModuleShapeCaster)
    reload(rigger.ModuleControlFactory)
    
    reload(classes.DraggerContextFactory)
    reload(classes.SnapFactory)
    reload(lib.rayCaster)
    reload(lib.meta_Utils)
    reload(lib.shapeCaster)
    
    
    Red9_Meta.registerMClassNodeMapping(nodeTypes = ['transform','objectSet','clamp','setRange','pointOnCurveInfo','decomposeMatrix','remapValue',
                                                     'ikSplineSolver','blendColors','blendTwoAttr','addDoubleLinear','condition','multiplyDivide','plusMinusAverage'])

    print('CGM Core Reloaded and META REGISTRY updated') 
    print '=============================================================================='  
    Red9_Meta.printSubClassRegistry()  
    print '=============================================================================='    
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:32,代码来源:__init__.py

示例2: _reload

def _reload():
    '''
    reload carefully and re-register the RED9_META_REGISTRY
    '''
    Red9.core._reload()
    reload(cgm_Meta)
    reload(cgm_PuppetMeta)
    
    print('CGM Core Reloaded and META REGISTRY updated') 
    print '============================================='  
    Red9_Meta.printSubClassRegistry()  
    print '============================================='    
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:12,代码来源:__init__.py

示例3: pushPoseFromLib

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,代码行数:7,代码来源:Red9_facial_poseHandler.py

示例4: addAttrToHUD

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,代码行数:18,代码来源:__init__.py

示例5: test_getMetaNodes_mTypesAsClass

 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,代码行数:7,代码来源:Red9_MetaTests.py

示例6: test_getMetaNodes_mTypes

 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,代码行数:7,代码来源:Red9_MetaTests.py

示例7: test_basicRigStructure

 def test_basicRigStructure(self):
     
     mRig=r9Meta.getConnectedMetaSystemRoot('L_Wrist_Ctrl')
     
     assert type(mRig)==r9Meta.MetaRig
     assert mRig.mNode=='RED_Rig'
     assert mRig.CTRL_Main[0]=='|World_Ctrl'
     
     #test the Left Arm wires
     assert type(mRig.L_ArmSystem)==r9Meta.MetaRigSubSystem
     assert mRig.L_ArmSystem.mNode=='L_ArmSystem'
     assert mRig.L_ArmSystem.systemType=='Arm'
     assert mRig.L_ArmSystem.mirrorSide==1
     assert mRig.L_ArmSystem.CTRL_L_Wrist[0]=='|World_Ctrl|L_Wrist_Ctrl'
     assert mRig.L_ArmSystem.CTRL_L_Elbow[0]=='|World_Ctrl|COG__Ctrl|L_Elbow_Ctrl'
     ctrl=r9Meta.MetaClass(mRig.L_ArmSystem.CTRL_L_Wrist[0])
     assert ctrl.mirrorSide==1 #?????? consistency of attrs on node and metaSubsystems!!!!!!!
     assert ctrl.mirrorIndex==1
     
     #test the Right Leg wires
     assert type(mRig.R_LegSystem)==r9Meta.MetaRigSubSystem
     assert r9Meta.isMetaNode('R_LegSystem')
     assert mRig.R_LegSystem.mNode=='R_LegSystem'
     assert mRig.R_LegSystem.systemType=='Leg'
     assert mRig.R_LegSystem.mirrorSide==2
     assert mRig.R_LegSystem.CTRL_R_Foot[0]=='|World_Ctrl|R_Foot_grp|R_Foot_Ctrl'
     assert mRig.R_LegSystem.CTRL_R_Knee[0]=='|World_Ctrl|R_Knee_Ctrl'
     ctrl=r9Meta.MetaClass(mRig.R_LegSystem.CTRL_R_Foot[0])
     assert ctrl.mirrorSide==2 #?????? consistency of attrs on node and metaSubsystems!!!!!!!
     assert ctrl.mirrorIndex==4
     
     #test the Left Leg wires 
     #:NOTE slight difference in the naming as we didn't pass in the attr when making the subSystem
     assert type(mRig.L_Leg_System)==r9Meta.MetaRigSubSystem
     assert r9Meta.isMetaNode('L_LegSystem')
     assert mRig.L_Leg_System.mNode=='L_LegSystem'
     assert mRig.L_Leg_System.systemType=='Leg'
     assert mRig.L_Leg_System.mirrorSide==1      
     
     #test the Spine wires
     assert type(mRig.SpineSystem)==r9Meta.MetaRigSubSystem
     assert mRig.SpineSystem.mNode=='SpineSystem'
     assert mRig.SpineSystem.systemType=='Spine'
     assert mRig.SpineSystem.mirrorSide==0
     assert mRig.SpineSystem.CTRL_Hips[0]=='|World_Ctrl|COG__Ctrl|Hips_Ctrl'
     assert mRig.SpineSystem.CTRL_Chest[0]=='|World_Ctrl|COG__Ctrl|Chest_Ctrl'
     ctrl=r9Meta.MetaClass(mRig.SpineSystem.CTRL_Chest[0])
     assert ctrl.mirrorSide==0 #?????? consistency of attrs on node and metaSubsystems!!!!!!!
     assert ctrl.mirrorIndex==4
     
     #test the MetaRigSupport nodes
     assert type(mRig.L_ArmSystem.L_ArmSupport)==r9Meta.MetaRigSupport
     assert mRig.L_ArmSystem.L_ArmSupport.mNode=='L_ArmSupport'
     assert mRig.L_ArmSystem.L_ArmSupport.SUP_IKHandle[0]=='|World_Ctrl|L_Wrist_Ctrl|ikHandle1'
     assert mRig.SpineSystem.SpineSupport.SUP_NeckIK[0]=='|World_Ctrl|COG__Ctrl|Chest_Ctrl|Head_grp|Head_Ctrl|ikHandle3'
     assert mRig.SpineSystem.SpineSupport.SUP_SpineIK[0]=='|World_Ctrl|COG__Ctrl|Chest_Ctrl|ikHandle4'
开发者ID:vitattoo,项目名称:Red9_StudioPack,代码行数:56,代码来源:Red9_MetaTests.py

示例8: test_getMetaNodes_mInstances

 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,代码行数:12,代码来源:Red9_MetaTests.py

示例9: test_getMetaNodes_mInstancesAsClass

 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,代码行数:12,代码来源:Red9_MetaTests.py

示例10: test_getMetaNodes_mAttrs

 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,代码行数:12,代码来源:Red9_MetaTests.py

示例11: getNodesOverload

def getNodesOverload(poseObj, nodes, *args):

    # NOTE: poseObj already has an attr 'metaRig' which is filled
    # automatically in the main buildInternalPoseData() call
    metaNode = poseObj.metaRig
    currentSelection = cmds.ls(sl=True, l=True)
    filteredNodes = []
    
    if not issubclass(type(metaNode), r9Meta.MetaHIKControlSetNode):
        # see if we have a controller selected thats connected to an
        # appropriate subMetaSystem
        if not currentSelection:
            result = cmds.confirmDialog(
                                title='selection hint missing',
                                button=['L_Fingers', 'R_Fingers', 'L_Toes', 'R_Toes', 'Cancel'],
                                message='We need a hint to ID which finger system to load/save the data too,\nIdeally you should select something in the correct limb system that we can use',
                                defaultButton='Cancel',
                                cancelButton='Cancel',
                                icon='information',
                                dismissString='Cancel')
            if result == 'L_Fingers':
                msystem = metaNode.L_ArmSystem
            elif result == 'R_Fingers':
                msystem = metaNode.R_ArmSystem
            elif result == 'L_Toes':
                msystem = metaNode.L_LegSystem
            elif result == 'R_Toes':
                msystem = metaNode.R_LegSystem
        else:   
            msystem = r9Meta.getConnectedMetaNodes(cmds.ls(sl=True))[0]

        # from selected node, or selected system find our finger / toe subSystem
        if not msystem.systemType.lower() in ['fingers', 'toes']:   
            fingersystem = msystem.getChildMetaNodes(mAttrs=['systemType'])
            if fingersystem:
                fingersystem=fingersystem[0]
        else:
            fingersystem = msystem
        if not fingersystem or not fingersystem.systemType.lower() in ['fingers', 'toes']:
            raise IOError('no finger / toe metaSubSystems found from the selected node')

        print '\nFinger : PoseOverload Handler : %s >> subSystem: %s' % (metaNode, fingersystem)
        
        filteredNodes = fingersystem.getChildren()
            
#         if cmds.getAttr('%s.mirrorSide' % currentSelection[0]) == 1:
#             print '\nFinger : PoseOverload Handler : %s >> side: Left' % metaNode
#             filteredNodes = metaNode.L_ArmSystem.L_FingerSystem.getChildren()
#         elif cmds.getAttr('%s.mirrorSide' % currentSelection[0]) == 2:
#             print '\nFinger : PoseOverload Handler : %s >> side: Right' % metaNode
#             filteredNodes = metaNode.R_ArmSystem.R_FingerSystem.getChildren()
            
    # modify the actual PoseData object, changing the data to be matched on index
    # rather than using the standard name or metaMap matching
    poseObj.metaPose = False
    poseObj.matchMethod = 'mirrorIndex_ID'
    poseObj.mirrorInverse = True  # set the mirror inverse code to active to cope with mirror differences between Left and Right fingers
    
    return filteredNodes
开发者ID:hoorayfor3d,项目名称:Red9_StudioPack,代码行数:59,代码来源:fingerMirrorID_poseHandler.py

示例12: test_isMetaNode

 def test_isMetaNode(self):
     assert r9Meta.isMetaNode('MetaRig_Test')
     assert r9Meta.isMetaNode('MetaRig_Test', mTypes=['MetaRig'])
     assert r9Meta.isMetaNode('MetaRig_Test', mTypes='MetaRig')
     assert not r9Meta.isMetaNode('MetaRig_Test', mTypes='MonkeyBollox')
     assert not r9Meta.isMetaNode('MetaRig_Test', mTypes='MetaFacialRigSupport_Test')
     assert r9Meta.isMetaNode('MetaRig_Test', mTypes=[r9Meta.MetaRig])
     assert r9Meta.isMetaNode('MetaRig_Test', mTypes=r9Meta.MetaRig)
     cube1=cmds.ls(cmds.polyCube()[0],l=True)[0]
     assert not r9Meta.isMetaNode(cube1)
开发者ID:vitattoo,项目名称:Red9_StudioPack,代码行数:10,代码来源:Red9_MetaTests.py

示例13: setup

 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,代码行数:9,代码来源:Red9_PoseTests.py

示例14: test_metaRigHandlers

 def test_metaRigHandlers(self):
     '''
     main metaRig handlers in the pose setups
     '''
     self.poseData.metaPose=False
     assert not self.poseData.metaRig
     self.poseData.setMetaRig('L_Wrist_Ctrl')
     assert r9Meta.isMetaNode(self.poseData.metaRig)
     assert self.poseData.metaPose==False
     self.poseData.metaPose=True
     assert self.poseData.settings.metaRig==True
开发者ID:Bumpybox,项目名称:Tapp,代码行数:11,代码来源:Red9_PoseTests.py

示例15: _iterate_

        def _iterate_(self):	
	    self.call2_func = self.test2_func
		
            for i in range(self.int_targetCount):
                self.progressBar_set(status = ("Pass 1: Substantiating Call %i"%i), progress = i, maxValue = self.int_targetCount)		
		#string = mc.joint(n = "obj_{0}".format(i))
		string = mc.createNode('network',n = "obj_{0}".format(i))
		#string = mc.createNode('transform',n = "obj_{0}".format(i))
		t1 = time.clock()	
		n1 = self.test1_func(string)              
		t2 = time.clock()
		self.l_times_1.append(t2-t1)
		
		r9Meta.registerMClassNodeCache(n1)
		
		t1 = time.clock()	
		#self.l_roots_2.extend( [self.test2_func(self._toCall)] )  
		self.call2_func(n1.mNode)              
		t2 = time.clock()
		self.l_times_2.append(t2-t1)	
开发者ID:Italic-,项目名称:maya-prefs,代码行数:20,代码来源:mayaBeOdd_r9ONLY.py


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