Beispiel #1
0
 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 )
Beispiel #2
0
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
Beispiel #3
0
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 )