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


Python NodeUtility.getMetaNodesInScene方法代码示例

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


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

示例1: fillList

# 需要导入模块: from marigold.utility import NodeUtility [as 别名]
# 或者: from marigold.utility.NodeUtility import getMetaNodesInScene [as 别名]
 def fillList( self ):
     metaNodes = NodeUtility.getMetaNodesInScene()
     try:
         cmds.textScrollList( self.scrollList, edit=True, removeAll=True )
     except:
         pass
     
     if metaNodes is not None:
         self.attrWin = cmds.textScrollList( parent=self.column, append=metaNodes,
                                             allowMultiSelection=False, width=self.winWidth,
                                             selectCommand=lambda: self.selectNode() )
     else:
         self.attrWin = cmds.textScrollList( parent=self.column, allowMultiSelection=True, width=self.winWidth )
开发者ID:EriLee,项目名称:marigold,代码行数:15,代码来源:SelectMetaUI.py

示例2: getFramesInSceneWIP

# 需要导入模块: from marigold.utility import NodeUtility [as 别名]
# 或者: from marigold.utility.NodeUtility import getMetaNodesInScene [as 别名]
def getFramesInSceneWIP():
    # Get all the meta nodes in the scene.
    metaNodes = NodeUtility.getMetaNodesInScene()
    print metaNodes
    
    if not metaNodes:
        return None
    else:
        for node in metaNodes:
            # Get the root bit of the frame module.
            rootBit = NodeUtility.getNodeAttrSource( node, 'rootBit' )
            # Get the parent's full path. We need to remove the group name from the beginning as well.
            parent = cleanParentFullName( rootBit[0] )
            print parent
开发者ID:EriLee,项目名称:marigold,代码行数:16,代码来源:FrameUtility.py

示例3: buildModule

# 需要导入模块: from marigold.utility import NodeUtility [as 别名]
# 或者: from marigold.utility.NodeUtility import getMetaNodesInScene [as 别名]
def buildModule():
    '''
    Build function for all the rigging associated with this module.
    '''
    # Get the frame module meta nodes in the scene.
    modules = NodeUtility.getMetaNodesInScene( 'frameModule' )
    
    # Read the meta node.
    nodeData = NodeUtility.getFrameBitSettings( modules[0] )
    prefix = nodeData['prefix'] 
    
    # Get the frame module bits.
    frameRoot = NodeUtility.getNodeAttrSource( modules[0], 'rootBit' )[0]
    shoulderBit = NodeUtility.getNodeAttrSource( modules[0], 'jShoulder' )[0]
    elbowBit = NodeUtility.getNodeAttrSource( modules[0], 'jElbow' )[0]
    wristBit = NodeUtility.getNodeAttrSource( modules[0], 'jWrist' )[0]
    ikRootBit = NodeUtility.getNodeAttrSource( modules[0], 'ikRoot' )[0]
    ikEndBit = NodeUtility.getNodeAttrSource( modules[0], 'ikEnd' )[0]
    ikUpVecBit = NodeUtility.getNodeAttrSource( modules[0], 'ikUpVecControl' )[0]
    
    # Build shadow skeleton.
    jointShoulder = marigoldJoints.createJoint( nodeData['jShoulder'], shoulderBit, inPrefix=prefix )
    jointElbow = marigoldJoints.createJoint( nodeData['jElbow'], elbowBit, jointShoulder, inPrefix=prefix )
    jointWrist = marigoldJoints.createJoint( nodeData['jWrist'], wristBit, jointElbow, inPrefix=prefix )
    
    # Make the FK rigging.
    fkControls = [ [nodeData['fkShoulderControl'], nodeData['fkShoulderControlName'], nodeData['jShoulder'], shoulderBit],
                   [nodeData['fkElbowControl'], nodeData['fkElbowControlName'], nodeData['jElbow'],elbowBit] ]
    for i in fkControls:
        # Create the spacer.
        spacerName = 'j_{0}_{1}'.format( prefix, i[2] )
        newSpacer = marigoldControls.makeControl().createSpacer( i[3], i[1], spacerName, True )
        
        # Create the controller.
        controlSplit = i[0].split( '.' )
        marigoldControls.makeControl().createController( controlSplit[0], controlSplit[1], i[1], newSpacer )
        
    # Make the IK rigging.
    effSplit = nodeData['ikEffControl'].split('.')
    effSpacer = marigoldControls.makeControl().createSpacer( ikEndBit, nodeData['ikEffControlName'], 'j_'+prefix+'_'+nodeData['jWrist'], inDoParent=False, inPrefix=prefix )
    marigoldControls.makeControl().createController( effSplit[0], effSplit[1], nodeData['ikEffControlName'], effSpacer, inPrefix=prefix )
    
    upVecSplit = nodeData['ikUpVecControl'].split('.')
    upVecSpacer = marigoldControls.makeControl().createSpacer( ikUpVecBit, nodeData['ikUpVecControlName'], ikUpVecBit, inDoParent=False, inPrefix=prefix )
    marigoldControls.makeControl().createController( upVecSplit[0], upVecSplit[1], nodeData['ikUpVecControlName'], upVecSpacer, inPrefix=prefix )
    
    jointFn = OpenMayaAnim.MFnIkJoint()

    # IK root joint.
    jointShoulder = 'j_{0}_{1}'.format( prefix, nodeData['jShoulder'] )
    rootJointDagPath = NodeUtility.getDagPath( jointShoulder )
    
    # IK eff joint.
    jointWrist = 'j_{0}_{1}'.format( prefix, nodeData['jWrist'] ) 
    effJointDagPath = NodeUtility.getDagPath( jointWrist )
    
    # Do up the solver.
    ikHandleName = '{0}_{1}_arm'.format( nodeData['ikEffControlName'], prefix )
    cmds.ikHandle( name=ikHandleName,
                   startJoint=rootJointDagPath.fullPathName(),
                   endEffector=effJointDagPath.fullPathName(),
                   solver='ikRPsolver' )
    
    effControlName = 'ct_{0}_{1}'.format( prefix, nodeData['ikEffControlName'] ) 
    cmds.parent( ikHandleName, effControlName, absolute=True )
    
    upVecControlName = 'ct_{0}_{1}'.format( prefix, nodeData['ikUpVecControlName'] )
    cmds.poleVectorConstraint( upVecControlName, ikHandleName )
开发者ID:EriLee,项目名称:marigold,代码行数:70,代码来源:fkikArm.py


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