• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python cmds.isConnected函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: reverseCheck

 def reverseCheck(self, remapNode, reverseCheck ):
 
     if reverseCheck:
         revNode = self.getReverse()
         if not cmds.isConnected( revNode+'.output', remapNode+'.color' ):
             cmds.connectAttr( revNode+'.output', remapNode+'.color', f=1 )
         
         colorRCons = cmds.listConnections( remapNode+'.colorR', s=1, d=0, c=1, p=1 )
         if colorRCons: cmds.disconnectAttr( colorRCons[1], colorRCons[0] )
         colorGCons = cmds.listConnections( remapNode+'.colorG', s=1, d=0, c=1, p=1 )
         if colorGCons: cmds.disconnectAttr( colorGCons[1], colorGCons[0] )
         colorBCons = cmds.listConnections( remapNode+'.colorB', s=1, d=0, c=1, p=1 )
         if colorBCons: cmds.disconnectAttr( colorBCons[1], colorBCons[0] )
         
     else:
         sampler = self.getSamplerInfo()
         if not cmds.isConnected( sampler+'.facingRatio', remapNode+'.colorR' ):
             cmds.connectAttr( sampler+'.facingRatio', remapNode+'.colorR' )
         if not cmds.isConnected( sampler+'.facingRatio', remapNode+'.colorG' ):
             cmds.connectAttr( sampler+'.facingRatio', remapNode+'.colorG' )
         if not cmds.isConnected( sampler+'.facingRatio', remapNode+'.colorB' ):
             cmds.connectAttr( sampler+'.facingRatio', remapNode+'.colorB' )
         
         colorCons = cmds.listConnections( remapNode+'.color', s=1, d=0, c=1, p=1 )
         if colorCons:
             cmds.disconnectAttr( colorCons[1], colorCons[0] )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:26,代码来源:cmdModel.py


示例2: getReverse

 def getReverse(self):
     
     reverseName = RemapConnectInfo._reverseName
     reverseAttr = RemapConnectInfo._reverseAttr
     
     reverses = cmds.ls( type='reverse' )
     
     vrayRemapReverse = None
     
     if not reverses: reverses = []
     
     for reverse in reverses:
         if cmds.attributeQuery( reverseAttr, node=reverse, ex=1 ):
             vrayRemapReverse = reverse
             break
         
     if not vrayRemapReverse:
         vrayRemapReverse = cmds.shadingNode( 'reverse', n=reverseName, asUtility=1 )
         cmds.addAttr( vrayRemapReverse, ln=reverseAttr, at='message' )
     
     samplerInfos = cmds.listConnections( vrayRemapReverse, s=1, d=0, type='samplerInfo' )
     if not samplerInfos:
         samplerInfo = self.getSamplerInfo()
         if not cmds.isConnected( samplerInfo+'.facingRatio', vrayRemapReverse+'.inputX' ):
             cmds.connectAttr( samplerInfo+'.facingRatio', vrayRemapReverse+'.inputX', f=1 )
         if not cmds.isConnected( samplerInfo+'.facingRatio', vrayRemapReverse+'.inputY' ):
             cmds.connectAttr( samplerInfo+'.facingRatio', vrayRemapReverse+'.inputY', f=1 )
         if not cmds.isConnected( samplerInfo+'.facingRatio', vrayRemapReverse+'.inputZ' ):
             cmds.connectAttr( samplerInfo+'.facingRatio', vrayRemapReverse+'.inputZ', f=1 )
     
     return vrayRemapReverse
开发者ID:jonntd,项目名称:mayadev-1,代码行数:31,代码来源:cmdModel.py


示例3: createLocalBlendTwoMatrixObject

def createLocalBlendTwoMatrixObject( first, second, target = None ):
    
    import sgBFunction_attribute
    
    blMtx = cmds.createNode( 'blendTwoMatrixDecompose' )
    cmds.connectAttr( first+'.m', blMtx+'.inMatrix1' )
    cmds.connectAttr( second+'.m', blMtx+'.inMatrix2' )
    
    if not target: target = cmds.createNode( 'transform' )
    
    sgBFunction_attribute.addAttr( target, ln='blend', min=0, max=1, dv=0.5, k=1 )
    cmds.connectAttr( target+'.blend', blMtx+'.attributeBlender' )
    
    if cmds.nodeType( target ) == 'joint':
        try:cmds.setAttr( target+'.jo', 0,0,0 )
        except:pass
    
    if not cmds.isConnected( blMtx+'.ot', target+'.t' ):
        cmds.connectAttr( blMtx+'.ot', target+'.t', f=1 )
    if not cmds.isConnected( blMtx+'.or', target+'.r' ):
        cmds.connectAttr( blMtx+'.or', target+'.r', f=1 )
    if not cmds.isConnected( blMtx+'.os', target+'.s' ):
        cmds.connectAttr( blMtx+'.os', target+'.s', f=1 )
    if not cmds.isConnected( blMtx+'.osh', target+'.sh' ):
        cmds.connectAttr( blMtx+'.osh', target+'.sh', f=1 )
    
    cmds.select( blMtx, target )
    return blMtx, target
开发者ID:jonntd,项目名称:mayadev-1,代码行数:28,代码来源:sgBFunction_rigObject.py


示例4: addAngleDriverAttribute

def addAngleDriverAttribute( sel ):
    
    import sgBFunction_attribute
    
    sgBFunction_attribute.addAttr( sel, ln='angleRate0', cb=1 )
    sgBFunction_attribute.addAttr( sel, ln='angleRate1', cb=1 )
    sgBFunction_attribute.addAttr( sel, ln='angleRate2', cb=1 )
    
    if cmds.listConnections( sel, s=1, d=0, type='angleDriver' ): return None
    
    selP = cmds.listRelatives( sel, p=1, f=1 )[0]
    selName = sel.split( '|' )[-1]
    targetDriver = cmds.createNode( 'angleDriver', n= 'angleDriver_' + selName )
    mm = cmds.createNode( 'multMatrix', n='mm_' + selName )
    base = cmds.createNode( 'transform', n= 'angleBase_' + selName )

    base = cmds.parent( base, selP )[0]

    cmds.xform( base, ws=1, matrix= cmds.getAttr( sel+'.wm' ) )
    
    cmds.connectAttr( sel+'.wm', mm+'.i[0]' )
    cmds.connectAttr( base+'.wim', mm+'.i[1]' )
    cmds.connectAttr( mm+'.matrixSum', targetDriver+'.angleMatrix' )
        
    
    sgBFunction_attribute.addAttr( sel, ln='angleRate0', cb=1 )
    sgBFunction_attribute.addAttr( sel, ln='angleRate1', cb=1 )
    sgBFunction_attribute.addAttr( sel, ln='angleRate2', cb=1 )
    if not cmds.isConnected( targetDriver+'.outDriver0', sel+'.angleRate0' ):
        cmds.connectAttr( targetDriver+'.outDriver0', sel+'.angleRate0' )
    if not cmds.isConnected( targetDriver+'.outDriver1', sel+'.angleRate1' ):
        cmds.connectAttr( targetDriver+'.outDriver1', sel+'.angleRate1' )
    if not cmds.isConnected( targetDriver+'.outDriver2', sel+'.angleRate2' ):
        cmds.connectAttr( targetDriver+'.outDriver2', sel+'.angleRate2' )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:34,代码来源:sgBFunction_rigObject.py


示例5: createWorldBlendTwoMatrixObject

def createWorldBlendTwoMatrixObject( first, second, target = None ):
    
    import sgBFunction_attribute
    
    blMtx = cmds.createNode( 'blendTwoMatrix' )
    mmdc  = cmds.createNode( 'multMatrixDecompose' )
    cmds.connectAttr( first+'.wm', blMtx+'.inMatrix1' )
    cmds.connectAttr( second+'.wm', blMtx+'.inMatrix2' )
    cmds.connectAttr( blMtx+'.outMatrix', mmdc+'.i[0]' )
    
    if not target: target = cmds.createNode( 'transform' )
    cmds.connectAttr( target+'.pim', mmdc+'.i[1]' )
    
    sgBFunction_attribute.addAttr( target, ln='blend', min=0, max=1, dv=0.5, k=1 )
    cmds.connectAttr( target+'.blend', blMtx+'.attributeBlender' )
    
    if not cmds.isConnected( mmdc+'.ot', target+'.t' ):
        cmds.connectAttr( mmdc+'.ot', target+'.t', f=1 )
    if not cmds.isConnected( mmdc+'.or', target+'.r' ):
        cmds.connectAttr( mmdc+'.or', target+'.r', f=1 )
    if not cmds.isConnected( mmdc+'.os', target+'.s' ):
        cmds.connectAttr( mmdc+'.os', target+'.s', f=1 )
    if not cmds.isConnected( mmdc+'.osh', target+'.sh' ):
        cmds.connectAttr( mmdc+'.osh', target+'.sh', f=1 )
    
    cmds.select( blMtx, target )
    return blMtx, target
开发者ID:jonntd,项目名称:mayadev-1,代码行数:27,代码来源:sgBFunction_rigObject.py


示例6: tryConnect

 def tryConnect( srcAttr, dstAttr ):
     if not cmds.isConnected( srcAttr, dstAttr ):
         try:
             cmds.connectAttr( srcAttr, dstAttr, f=1 )
         except:
             pymelAttr = pymel.core.ls( srcAttr )[0]
             if not cmds.isConnected( pymelAttr.name(), dstAttr ):
                 try:cmds.connectAttr( pymelAttr.name(), dstAttr, f=1 )
                 except:pass
开发者ID:jonntd,项目名称:mayadev-1,代码行数:9,代码来源:__init__.py


示例7: isConnected

	def isConnected(self, other, inOrder = True ):
		""":param other: other AttributeNode
		:returns: if the attributes are connected"""
		if not self.exists:
			raise AttributeNotFound( self._node.name, self._attribute )
		if not other.exists:
			raise AttributeNotFound( self._node.name, self._attribute )
		if inOrder:
			return mc.isConnected( self.fullname, other.fullname )
		else:
			return mc.isConnected( other.fullname, self.fullname )
开发者ID:skarone,项目名称:PipeL,代码行数:11,代码来源:mayaNode.py


示例8: getInstanceObject

    def getInstanceObject():
        
        instObjName = 'sgPutObjectAtGround_instObj'
        selItem = Functions.getSelectedObject()
        
        selItemShape = cmds.listRelatives( selItem, s=1, f=1 )
        if not selItemShape: return None
        selItemShape = selItemShape[0]
        if cmds.objExists( instObjName ): 
            instObjShape = cmds.listRelatives( instObjName, s=1, f=1 )[0]
            if not cmds.isConnected( selItemShape + '.outMesh', instObjShape + '.inMesh' ):
                cmds.connectAttr( selItemShape + '.outMesh', instObjShape + '.inMesh', f=1 )
                dagPath = getDagPath( instObjShape )
                fnMesh = OpenMaya.MFnMesh( dagPath )
                fnMesh.getPoints( Tool_global.instancePoints )
            return instObjName
        
        shapeType = cmds.nodeType( selItemShape )
        
        instObjShape = cmds.createNode( shapeType )
        instObj = cmds.listRelatives( instObjShape, p=1, f=1 )[0]
        instObj = cmds.rename( instObj, instObjName )
        instObjShape = cmds.listRelatives( instObj, s=1, f=1 )[0]
        Tool_global.instShape = instObjShape
        
        if shapeType in ['nurbsSurface', 'nurbsCurve']:
            inputAttr = 'create'
            outputAttr = 'local'
        elif shapeType == 'mesh':
            inputAttr = 'inMesh'
            outputAttr = 'outMesh'
        
        if not cmds.isConnected( selItemShape + '.' + outputAttr, Tool_global.instShape + '.' + inputAttr ):
            cmds.connectAttr( selItemShape + '.' + outputAttr, Tool_global.instShape + '.' + inputAttr, f=1 )
            dagPath = getDagPath( instObjShape )
            fnMesh = OpenMaya.MFnMesh( dagPath )
            fnMesh.getPoints( Tool_global.instancePoints )

        shadingEngine = cmds.listConnections( selItemShape, s=0, d=1, type='shadingEngine' )
        if not shadingEngine: 
            cmds.sets( instObjShape, e=1, forceElement='initialShadingGroup' )
        else:
            cmds.sets( instObjShape, e=1, forceElement=shadingEngine[0] )
        
        dagPath = getDagPath( instObjShape )
        fnMesh = OpenMaya.MFnMesh( dagPath )
        fnMesh.getPoints( Tool_global.instancePoints )
        
        return instObj
开发者ID:jonntd,项目名称:mayadev-1,代码行数:49,代码来源:sgPutObjectOnGround.py


示例9: rebuildConnections

    def rebuildConnections(self):
        if not self.connectionStorage:
            raise Exception('No connection data stored to connect attributes with.')

        for node in self.connectionStorage:
            print "Node :: %s" % node
            for connectionPair in self.connectionStorage[node]:

                if connectionPair[0] == 'parent':
                    try:
                        cmds.parent(node, connectionPair[1])
                    except:
                        print "Could not connect :: %s To :: %s" % (node, connectionPair[1])

                if not cmds.objExists(connectionPair[0]) or not cmds.objExists(connectionPair[1]):
                    print '%s or %s are not valid objects, skipping to the next connection' % (
                    connectionPair[0], connectionPair[1])
                    continue

                print "Connecting :: %s To :: %s" % (connectionPair[0], connectionPair[1])

                if not cmds.isConnected(connectionPair[0], connectionPair[1]):
                    try:
                        cmds.connectAttr(connectionPair[0], connectionPair[1], f=True)
                    except:
                        print "Could not connect :: %s To :: %s" % (connectionPair[0], connectionPair[1])
开发者ID:bennymuller,项目名称:glTools,代码行数:26,代码来源:connectionAttrStorage.py


示例10: displayModCombine

def displayModCombine( sels ):
    import sgBFunction_dag
    
    targetMeshObjs = []
    
    sels = cmds.listRelatives( sels, s=1, f=1 )
    
    for sel in sels:
        if cmds.getAttr( sel+'.io' ): continue
        selP = cmds.listRelatives( sel, p=1, f=1 )[0]
        if selP.find( 'display_' ) == -1: continue
        targetMeshObjs.append( selP )
    
    targetMeshObjs = list( set( targetMeshObjs ) )
    
    cmds.select( targetMeshObjs )
    
    for targetMesh in targetMeshObjs:
        displayMod = cmds.ls( targetMesh )[0]
        realMod    = displayMod.replace( 'display_', '' )
        
        if not cmds.objExists( realMod ): continue
        
        displayModShape = sgBFunction_dag.getShape( displayMod )
        realModShape     = sgBFunction_dag.getShape( realMod )
        
        displayOrig = sgBFunction_dag.getOrigShape( displayModShape )
        
        if not cmds.isConnected( realModShape+'.outMesh', displayOrig+'.inMesh' ):
            cmds.connectAttr( realModShape+'.outMesh', displayOrig+'.inMesh', f=1 )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:30,代码来源:sgBExcute_asset.py


示例11: duplicateOnlyCurve

def duplicateOnlyCurve( curves ):
    
    import sgBFunction_dag
    curves = sgBFunction_dag.getChildrenCurveExists( curves )
    
    newCurves = []
    for curve in curves:
        curveP = sgBFunction_dag.getParent( curve )
        if curveP:
            newCurveParent = sgBFunction_dag.makeCloneObject( curveP )
        else:
            newCurveParent = None
        
        newCurveShape = cmds.createNode( 'nurbsCurve' )
        curveShape = sgBFunction_dag.getShape( curve )
        cmds.connectAttr( curveShape+'.local', newCurveShape+'.create' )
        
        newCurve = sgBFunction_dag.getTransform( newCurveShape )
        newCurve = cmds.rename( newCurve, 'du_' + curve.split( '|' )[-1] )
        if newCurveParent:
            newCurve = cmds.parent( newCurve, newCurveParent )[0]
        newCurves.append( newCurve )
    
    cmds.refresh()
    
    for i in range( len( newCurves ) ):
        curveShape = sgBFunction_dag.getShape( curves[i] )
        newCurveShape = sgBFunction_dag.getShape( newCurves[i] )
        if cmds.isConnected( curveShape+'.local', newCurveShape+'.create' ):
            cmds.disconnectAttr( curveShape+'.local', newCurveShape+'.create' )
    
    return newCurves
开发者ID:jonntd,项目名称:mayadev-1,代码行数:32,代码来源:sgBFunction_curve.py


示例12: cmdCreate

 def cmdCreate(self, *args ):
     
     import sgBFunction_dag
     
     controller = self.popupController.getFieldText()
     curves = self.popupCurves.getFieldTexts()
     
     curves = sgBFunction_dag.getChildrenShapeExists( curves )
     
     copyAttrs = [ 'globalEnvelope', 'globalWave1', 'globalTimeMult1', 'globalOffset1', 'globalLength1', 'globalWave2', 'globalTimeMult2', 'globalOffset2', 'globalLength2' ]
     
     targetCrvs = []
     aimMatrixs = []
     
     targetCrvGrps = cmds.createNode( 'transform', n= 'WobbleCurveGrp' )
     aimMatrixGrps = cmds.createNode( 'transform', n= 'aimMatrixGrp' )
     
     createNewCurve = cmds.checkBox( self.check, q=1, v=1 )
     
     for curve in curves:
         targetCrv, aimMatrix = sgRigCurve.createSgWobbleCurve( curve, True, createNewCurve, '_wobble' )
         
         targetCrvs.append( targetCrv )
         aimMatrixs.append( aimMatrix )
         
         for copyAttr in copyAttrs:
             sgRigAttribute.copyAttribute( targetCrv+'.'+copyAttr, controller )
             if cmds.isConnected( controller+'.'+copyAttr, targetCrv+'.'+copyAttr ): continue
             cmds.connectAttr( controller+'.'+copyAttr, targetCrv+'.'+copyAttr )
     
     if createNewCurve : cmds.parent( targetCrvs, targetCrvGrps )
     cmds.parent( aimMatrixs, aimMatrixGrps )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:32,代码来源:sgPWindow_curve_sgWobbleCurve.py


示例13: ctlVisConnection

def ctlVisConnection( ctl, targets, attrName = 'ctlVis' ):

    import sgBFunction_attribute
    
    sgBFunction_attribute.addAttr( ctl, ln=attrName, min=0, max=1, at='long', k=1 )
        
    for target in targets:
        targetP = cmds.listRelatives( target, p=1, f=1 )[0]
        
        if not cmds.isConnected( ctl+'.'+attrName, target+'.v' ):
            try:
                cmds.connectAttr( ctl+'.'+attrName, target+'.v' )
            except:
                if not cmds.isConnected( ctl+'.'+attrName, targetP+'.v' ):
                    try:cmds.connectAttr( ctl+'.'+attrName, targetP+'.v' )
                    except:pass
开发者ID:jonntd,项目名称:mayadev-1,代码行数:16,代码来源:sgBFunction_connection.py


示例14: breakReferencePlaceholderConnections

def breakReferencePlaceholderConnections(shape):
    """
    Break all reference placeholder connections to the shape.instObjGroups plug.
    @param shape: Shape to break reference placeholder connections from.
    @type shape: str
    """
    # Get Shape Connections
    placeHolderConn = cmds.listConnections(shape, s=True, d=True, p=True, c=True) or []

    # For Each Connection Pair
    for i in range(0, len(placeHolderConn), 2):

        # Check Reference Connection
        placeHolderNode = cmds.ls(placeHolderConn[i + 1], o=True)[0]
        if glTools.utils.reference.isReference(placeHolderNode):

            # Disconnect PlaceHolder
            if cmds.isConnected(placeHolderConn[i], placeHolderConn[i + 1]):
                try:
                    cmds.disconnectAttr(placeHolderConn[i], placeHolderConn[i + 1])
                except:
                    print('FAILED: ' + placeHolderConn[i] + ' >X< ' + placeHolderConn[i + 1] + '!')
                else:
                    print('Disconnected: ' + placeHolderConn[i] + ' >X< ' + placeHolderConn[i + 1] + '...')
            else:
                try:
                    cmds.disconnectAttr(placeHolderConn[i + 1], placeHolderConn[i])
                except:
                    print('FAILED: ' + placeHolderConn[i + 1] + ' >X< ' + placeHolderConn[i] + '!')
                else:
                    print('Disconnected: ' + placeHolderConn[i + 1] + ' >X< ' + placeHolderConn[i] + '...')
开发者ID:bennymuller,项目名称:glTools,代码行数:31,代码来源:shader.py


示例15: checkExistingItp

    def checkExistingItp( self, mainBlendShape, targetGeoms, indies ):
        
        neadIndies = []
        
        for i in range( len( indies ) ):
            index  = indies[i]
            targetGeomShape = cmds.listRelatives( targetGeoms[i+1], s=1 )[0]
            if cmds.attributeQuery( 'isFixEditMesh', node=targetGeomShape, ex=1 ): continue
            neadIndies.append( index )
        
        itpNodes = cmds.listConnections( mainBlendShape, type='vectorInterpolation' )
        if not itpNodes: return None
        itpNodes = list( set( itpNodes ) )

        for itpNode in itpNodes:
            inputs = cmds.listConnections( itpNode, s=1, d=0, c=1, type='blendShape' )[::2]
            
            if len( inputs ) != len( neadIndies ):
                continue
            
            inputConnected = True
            for inputValue in inputs:
                
                connected = False
                for index in indies:
                    if cmds.isConnected( mainBlendShape+'.w[%d]' % index, inputValue ): connected=True
                
                if not connected:
                    inputConnected = False
            
            if inputConnected: return itpNode
            
        return None
开发者ID:jonntd,项目名称:mayadev-1,代码行数:33,代码来源:createFixEditShape.py


示例16: uiCmd_connectBindPreMatrix

def uiCmd_connectBindPreMatrix( *args ):
    
    selections = cmds.ls( sl=1 )
    
    firsts = selections[:-1][::2]
    seconds = selections[:-1][1::2]
    last = selections[-1]
    
    for i in range( len( firsts ) ):
        
        first = firsts[i]
        second = seconds[i]
        
        cons = cmds.listConnections( first, type='skinCluster', d=1, s=0, c=1, p=1 )
        
        outputs = cons[0::2]
        inputs  = cons[1::2]
        
        for ii in range( len( outputs ) ):
            
            if inputs[ii].find( 'matrix' ) == -1: continue
            
            outputAttr = outputs[ii].replace( first, second ).replace( 'worldMatrix', 'worldInverseMatrix' )
            inputAttr = inputs[ii].replace( 'matrix', 'bindPreMatrix' )
            
            if inputAttr.find( last ) == -1: continue
            
            if not cmds.isConnected( outputAttr, inputAttr ):
                cmds.connectAttr( outputAttr, inputAttr, f=1 )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:29,代码来源:cmdModel.py


示例17: connectOutput

    def connectOutput(self, dstAttr):
        """
		Connect remapValue node output to destination plug.
		@param dstAttr: Destination plug for remapValue node output.
		@type dstAttr: str
		"""
        # Checks
        if not glTools.utils.attribute.isAttr(dstAttr):
            raise Exception(
                'Destination attribute "'
                + dstAttr
                + '" is not a valid attribute! Unable to establish output connection...'
            )

            # Connect Output
        outAttr = self._name + ".outValue"
        if not mc.isConnected(outAttr, dstAttr):
            try:
                mc.connectAttr(outAttr, dstAttr, f=True)
            except:
                raise Exception('Error connecting remapValue output ("' + outAttr + '" >> "' + dstAttr + '")!')
        else:
            print(
                'RemapValue node output "'
                + outAttr
                + '" already connected to destination plug "'
                + dstAttr
                + '"! Skipping...'
            )
开发者ID:auqeyjf,项目名称:glTools,代码行数:29,代码来源:remap.py


示例18: _setUpIBL

def _setUpIBL():
	
		if not c.objExists('myIbl') and not c.objExists('myIblShape'):
			mel.eval('miCreateDefaultNodes()');
			
			c.select(cl=True);
			mel.eval('setCurrentRenderer mentalRay;');
			ibl = c.createNode( 'mentalrayIblShape', n='myIbl' );
			c.rename('mentalrayIbl1', 'myIblShape');
			if(c.isConnected( 'myIbl.message', 'mentalrayGlobals.imageBasedLighting' ) != '0'):
				c.evalDeferred( "c.connectAttr(  'myIbl.message', 'mentalrayGlobals.imageBasedLighting', f=True)", lp=True);
			mel.eval('$path = `optionVar -q WeatherViz_HDR_Path`');
			#mel.eval('$path = optionVar -q "WeatherViz_HDR_Path"');
			mel.eval('AEassignFilenameCB  myIbl.texture $path "image"');
			c.setAttr('myIbl.colorGain', 14, 14, 14, type='double3');
			#sets render stats
			c.setAttr('myIbl.visibleInEnvironment', 1);
			c.setAttr('myIbl.visibleInReflections', 1);
			c.setAttr('myIbl.visibleInRefractions', 1);
			c.setAttr('myIbl.visibleInFinalGather', 1);

			c.setAttr('myIblShape.scaleX', 80);
			c.setAttr('myIblShape.scaleY', 80);
			c.setAttr('myIblShape.scaleZ', 80);
			c.select(cl=True);
		else:
			mel.eval('$path = `optionVar -q WeatherViz_HDR_Path`');
			mel.eval('AEassignFilenameCB  myIbl.texture $path "image"');
开发者ID:sebra729,项目名称:WeatherViz,代码行数:28,代码来源:WeatherViz.py


示例19: mirrorConnect

def mirrorConnect( target ):
    
    import sgBFunction_attribute
    
    if cmds.nodeType( target ) in [ 'transform', 'joint' ]:
        mirrorTarget = mirrorTransform( target )
    else:
        mirrorTarget = mirrorNode( target )
    
    srcCons = cmds.listConnections( target, s=1, d=0, p=1, c=1 )
    
    outCons = srcCons[1::2]
    inCons  = srcCons[::2]
    
    for i in range( len( outCons ) ):
        outputNode, outputAttr = outCons[i].split( '.' )
        inputAttr = inCons[i].split( '.' )[-1]
        
        if cmds.nodeType( outputNode ) in [ 'transform', 'joint' ]:
            mirrorOutputNode = mirrorTransform( outputNode )
        else:
            mirrorOutputNode = mirrorNode( outputNode )
        
        if not cmds.attributeQuery( outputAttr, node=mirrorOutputNode, ex=1 ):
            sgBFunction_attribute.copyAttribute( outputNode+'.'+outputAttr, mirrorOutputNode )
        if not cmds.attributeQuery( inputAttr, node=mirrorTarget, ex=1 ):
            sgBFunction_attribute.copyAttribute( target+'.'+inputAttr, mirrorTarget )

        if not cmds.isConnected( mirrorOutputNode+'.'+outputAttr, mirrorTarget+'.'+inputAttr ):
            cmds.connectAttr( mirrorOutputNode+'.'+outputAttr, mirrorTarget+'.'+inputAttr )
    
    return mirrorTarget
开发者ID:jonntd,项目名称:mayadev-1,代码行数:32,代码来源:sgBRig_base.py


示例20: legTwistRepairSet

def legTwistRepairSet():
    
    blMts    = cmds.ls( '*Leg_*_Ik2_blendMtx' )
    ankleJnts = cmds.ls( '*Ankle_*_FootIk_JNT' )
    
    for i in range( len( blMts ) ):
        if not cmds.isConnected( ankleJnts[i]+'.wm', blMts[i]+'.inMatrix1' ):
            cmds.connectAttr( ankleJnts[i]+'.wm', blMts[i]+'.inMatrix1', f=1 )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:8,代码来源:repairSet.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python cmds.joint函数代码示例发布时间:2022-05-27
下一篇:
Python cmds.internalVar函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap