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

Python cmds.deformer函数代码示例

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

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



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

示例1: getGeoIndex

def getGeoIndex(dfm, geo):
    """
    return index of geometry in deformer
    geo - should be a shape node
    """
    deformedGeos = mc.deformer(dfm, q=True, g=True)
    geoId = deformedGeos.index(geo)
    deformedGeosId = mc.deformer(dfm, q=True, gi=True)
    return deformedGeosId[geoId]
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:9,代码来源:__init__.py


示例2: createCmd

def createCmd():
	"""Create node."""
	
	geo = _getGeoFromUI()
	rbsNode = geo and _getRbs(geo)
	
	if rbsNode:
		_updateUI()
		return
	
	# create the rbs
	cmds.deformer(geo, typ=_rbsNodeName, foc=True)
	
	_updateUI()
开发者ID:Bumpybox,项目名称:Tapp,代码行数:14,代码来源:ZvRadialBlendShape.py


示例3: apply_push_deformer_selection

	def apply_push_deformer_selection():
		if not self.__load_plugin():
			return

		objs = cmds.ls(sl=True, type='transform')
		if not len(objs):
			cmds.warning('No objects selected.')
			return

		for x in objs:
			cmds.select(x)
			name = str(x) + '_pushDeformer'
			name = mel.eval('formValidObjectName(\"{0}\");'.format(name))
			cmds.deformer(name=name, type='pushDeformer')
开发者ID:KasumiL5x,项目名称:cageedit,代码行数:14,代码来源:apply_push_deformer.py


示例4: pruneWeights

def pruneWeights(deformer, geoList=[], threshold=0.001):
    """
    Set deformer component weights to 0.0 if the original weight value is below the set threshold
    @param deformer: Deformer to removed components from
    @type deformer: str
    @param geoList: The geometry objects whose components are checked for weight pruning
    @type geoList: list
    @param threshold: The weight threshold for removal
    @type threshold: str
    """
    # Check deformer
    if not cmds.objExists(deformer):
        raise Exception('Deformer "' + deformer + '" does not exist!')

    # Check geometry
    if type(geoList) == str: geoList = [geoList]
    if not geoList: geoList = cmds.deformer(deformer, q=True, g=True)
    if not geoList: raise Exception('No geometry to prune weight for!')
    for geo in geoList:
        if not cmds.objExists(geo):
            raise Exception('Geometry "' + geo + '" does not exist!')

    # For each geometry
    for geo in geoList:
        # Get deformer member indices
        memberIndexList = getDeformerSetMemberIndices(deformer, geo)

        # Get weight list
        weightList = getWeights(deformer, geo)

        # Prune weights
        pWeightList = [wt if wt > threshold else 0.0 for wt in weightList]

        # Apply pruned weight list
        setWeights(deformer, pWeightList, geo)
开发者ID:bennymuller,项目名称:glTools,代码行数:35,代码来源:deformer.py


示例5: importAssetCache

 def importAssetCache(self, cacheXmlLt, cacheErrorCheck = False):
     """ cacheXmlLt = "R:/data/cache/sq001/sh001/light/char/ben00c_ben/ben00c_ben.xml" """
     if os.path.exists(cacheXmlLt):
         cacheChannels = mc.cacheFile(fileName=cacheXmlLt,q=1,channelName=1)
         cacheGeos = self.getCacheGeos()
         cacheGeoDict, cacheChannelsTmp = {}, []
         for chn in cacheChannels:
             for geo in cacheGeos:
                 baseChn = utils.stripNames(utils.convertName(chn, "texture"))
                 baseGeo = utils.stripNames(utils.stripNames(geo, ":"), "|")
                 if baseChn in baseGeo:
                     cacheGeoDict[chn] = geo
                     cacheChannelsTmp.append(chn)
                     continue
     else:
         utils.msgWin("Error", "File does not exist : %s"%cacheXmlLt, self.silent)
         return False
     if cacheErrorCheck:
         missedChannels = list(set(cacheChannels).difference(set(cacheGeoDict.keys())))
         if len(missedChannels) > 0:
             msg = "Cache geometry missing\n"
             msg += "\n".join(missedChannels)
             utils.msgWin("Error", msg, self.silent)
             return missedChannels
         else:
             return False
     for chNode in self.getCacheNodes():
         mc.delete(chNode)
     for chn in cacheGeoDict.keys():
         deformShp = cacheGeoDict[chn]
         try:
             shpSwitch = mc.deformer(deformShp, type="historySwitch")
         except:
             continue
         shpHist = mc.listHistory(deformShp, pdo=1)
         if shpHist:
             for hist in shpHist:
                 if mc.nodeType(hist) == "tweak":
                     dblList = mc.listAttr("%s.plist"%hist, m= 1)
                     fltList = mc.listAttr("%s.vlist"%hist, m= 1)
                     dbCon, flCon = False, False
                     if dblList:
                         if len(dblList) > 1: dbCon = True
                     if fltList:
                         if len(fltList) > 1: flCon = True
                     if not(dbCon or flCon):
                         mc.delete(hist)
                     break
         conns = mc.listConnections("%s.ip[0].ig"%shpSwitch[0], p=1)
         mc.connectAttr(conns[0], "%s.ug[0]"%shpSwitch[0])
         mc.setAttr("%s.playFromCache"%shpSwitch[0], 1)
         mc.getAttr("%s.op[0]"%shpSwitch[0], sl = 1)
         mc.setAttr("%s.playFromCache"%shpSwitch[0], 0)
         mc.disconnectAttr(conns[0], "%s.ug[0]"%shpSwitch[0])
         switch = mc.rename(shpSwitch[0],'cacheSwitch#')
         mc.setAttr(switch+'.ihi',0)
         cacheNode = mc.cacheFile(f = cacheXmlLt, attachFile = True, ia = '%s.inp[0]'%switch, cnm = chn)
         mc.connectAttr(cacheNode+".inRange", switch + '.playFromCache')
     utils.msgWin("Message", "Cache loaded successfully for %s"%self.namespace, self.silent)
     return True
开发者ID:sid2364,项目名称:Maya_Python,代码行数:60,代码来源:pipeClasses.py


示例6: addModification

def addModification( meshObjs ):
    
    import sgBFunction_attribute
    import sgBFunction_dag
    
    meshObjs = sgBFunction_dag.getChildrenMeshExists( meshObjs )
    softMod = cmds.deformer( meshObjs, type='softMod' )[0]
    
    ctlGrp = cmds.createNode( 'transform' )
    cmds.setAttr( ctlGrp+'.dh', 1 )
    dcmp   = cmds.createNode( 'decomposeMatrix' )
    ctl = cmds.sphere()[0]
    ctl = cmds.parent( ctl, ctlGrp )[0]
    sgBFunction_attribute.addAttr( ctl, ln='__________', at='enum', enumName = ':Modify Attr', cb=1 )
    sgBFunction_attribute.addAttr( ctl, ln='falloffRadius', min=0, dv=1, k=1 )
    sgBFunction_attribute.addAttr( ctl, ln='envelope', min=0, max=1, dv=1, k=1 )
    
    cmds.connectAttr( ctlGrp+'.wim', softMod+'.bindPreMatrix' )
    cmds.connectAttr( ctlGrp+'.wm', softMod+'.preMatrix' )
    cmds.connectAttr( ctl+'.wm', softMod+'.matrix' )
    cmds.connectAttr( ctl+'.m',  softMod+'.weightedMatrix' )
    
    cmds.connectAttr( ctlGrp+'.wm', dcmp+'.imat' )
    
    cmds.connectAttr( dcmp+'.ot', softMod+'.falloffCenter' )
    for i in range( len( meshObjs ) ):
        cmds.connectAttr( meshObjs[i]+'.wm', softMod+'.geomMatrix[%d]' % i )
    
    cmds.connectAttr( ctl+'.envelope', softMod+'.envelope' )
    cmds.connectAttr( ctl+'.falloffRadius', softMod+'.falloffRadius' )
    
    cmds.xform( ctlGrp, ws=1, t=cmds.getAttr( meshObjs[0]+'.wm' )[-4:-1] )
    cmds.select( ctlGrp )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:33,代码来源:sgBFunction_rigObject.py


示例7: makeWire

def makeWire( dropoffDistance ):
    
    sels = cmds.ls( sl=1 )
    
    last = sels[-1]
    lastShape = cmds.listRelatives( last, s=1 )[0]
    baseShape = getBaseShape( last )
    
    for sel in sels[:-1]:
        wireExists = False
        hists = cmds.listHistory( sel, pdo=1 )
        if not hists: hists = []
        for hist in hists:
            if cmds.nodeType( hist ) == 'wire':
                wireExists = True
                break
        if wireExists:
            wire = hist
        else:
            wire = cmds.deformer( sel, type='wire' )[0]
            cmds.connectAttr( baseShape+'.local', wire+'.baseWire[0]' )
            cmds.connectAttr( lastShape+'.local', wire+'.deformedWire[0]' )
        cmds.setAttr( wire+'.dropoffDistance[0]', dropoffDistance )

    cmds.select( sels )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:25,代码来源:cmdModel.py


示例8: mirrorDeformer

def mirrorDeformer(middleEdge,deformer,search='lf',replace='rt'):
	'''
	'''
	# Load plugin
	loadPlugin()
	
	# Get Mesh Data
	mesh = mc.ls(middleEdge,o=True)[0]
	vmap = mm.eval('edgeFlowMirror -task "getMapArray" -middleEdge '+middleEdge)
	
	# Mirror Membership
	mem = glTools.utils.deformer.getDeformerSetMemberIndices(deformer,mesh)
	if len(vmap) > len(mem): mem = sorted([vmap[i] for i in mem])
	mem = [mesh+'.vtx['+str(i)+']' for i in mem]
	
	# Create Mirror Deformer
	deformerType = mc.objectType(deformer)
	deformerName = deformer
	if deformerName.startswith(search): deformerName = deformerName.replace(search,replace)
	elif deformerName.startswith(replace): deformerName = deformerName.replace(replace,search)
	else: deformerName = deformerName+'_mirror'
	
	mDeformer = mc.deformer(mem,type=deformerType,name=deformerName)[0]
	
	# Mirror Deofmer Weights
	mirrorDeformerWeights(middleEdge,deformer,dstDeformer=mDeformer)
	
	# Return Result
	return mDeformer
开发者ID:auqeyjf,项目名称:glTools,代码行数:29,代码来源:edgeFlowMirror.py


示例9: matchCurveShapes_andShrinkWrap

 def matchCurveShapes_andShrinkWrap(self, getFirstGrp, getSecondGrp):
     myDict={
             ".shapePreservationEnable":1,
             ".shapePreservationSteps":72,
             ".shapePreservationReprojection":1,
             ".shapePreservationIterations":1,
             ".shapePreservationMethod":0,
             ".envelope":1,
             ".targetSmoothLevel":1,
             ".continuity":1,
             ".keepBorder":0,
             ".boundaryRule":1,
             ".keepHardEdge":0,
             ".propagateEdgeHardness":0,
             ".keepMapBorders":1,
             ".projection":4,
             ".closestIfNoIntersection":0,
             ".closestIfNoIntersection":0 ,
             ".reverse":0,
             ".bidirectional":0,
             ".boundingBoxCenter":1,
             ".axisReference":0 ,
             ".alongX":1,
             ".alongY":1,
             ".alongZ":1,
             ".offset":0,
             ".targetInflation":0,
             ".falloff":0.3021390379,
             ".falloffIterations": 1
             }        
     cmds.delete(getFirstGrp, ch=1)
     getShrink=cmds.deformer(getFirstGrp, type="shrinkWrap")
     cmds.connectAttr(getSecondGrp+".worldMesh[0]", getShrink[0]+".targetGeom", f=1)
     for key, value in myDict.items():
         cmds.setAttr(getShrink[0]+key, value)
开发者ID:edeglau,项目名称:storage,代码行数:35,代码来源:plot.py


示例10: ShapeInverterCmdold

def ShapeInverterCmdold(base=None, corrective=None, name=None):
    mc.undoInfo(openChunk=True)
    if not base or not corrective:
        sel = mc.ls(sl=True)
        base, corrective = sel
    shapes = mc.listRelatives(base, children=True, shapes=True)
    for s in shapes:
        if mc.getAttr("%s.intermediateObject" % s) and mc.listConnections("%s.worldMesh" % s, source=False):
            origMesh = s
            break
    deformed = mc.polyPlane(ch=False)[0]
    mc.connectAttr("%s.worldMesh" % origMesh, "%s.inMesh" % deformed)
    mc.setAttr("%s.intermediateObject" % origMesh, 0)
    mc.delete(deformed, ch=True)
    mc.setAttr("%s.intermediateObject" % origMesh, 1)
    if not name:
        name = "%s_inverted#" % corrective
    invertedShape = duplicateMesh(base, name=name)
    deformer = mc.deformer(invertedShape, type="ShapeInverter")[0]
    mc.ShapeInverterCmd(baseMesh=base, invertedShape=invertedShape, ShapeInverterdeformer=deformer, origMesh=deformed)
    # correctiveShape = duplicateMesh(base,name=corrective+"_corrective#")
    # mc.connectAttr('%s.outMesh' % getShape(correctiveShape), '%s.correctiveMesh' % deformer)
    # transferMesh(corrective,[correctiveShape])
    mc.connectAttr("%s.outMesh" % getShape(corrective), "%s.correctiveMesh" % deformer)
    mc.setAttr("%s.activate" % deformer, True)
    mc.delete(deformed)
    bdingBx = mc.polyEvaluate(corrective, boundingBox=True)
    xDifVal = bdingBx[0][1] - bdingBx[0][0]
    # mc.move(xDifVal*1.10,correctiveShape,r=True,moveX=True)
    mc.move(xDifVal * 2.20, invertedShape, r=True, moveX=True)
    mc.undoInfo(closeChunk=True)
    return invertedShape  # ,correctiveShape
开发者ID:jonntd,项目名称:cvShapeInverter,代码行数:32,代码来源:ShapeInverterScript.py


示例11: importPolyMesh

def importPolyMesh(name, identifier, jobInfo, parentXform=None, isConstant=False, useDynTopo=False):
	cmds.ExocortexAlembic_profileBegin(f="Python.ExocortexAlembic._import.importPolyMesh")

	# TODO: set isConstant properly elsewhere when there are no transforms but are
	# animated attributes
	isConstant = False
	try:
		reader = ""
		shape  = fnt.alembicCreateNode(name, "mesh", parentXform)
		cmds.sets(shape, e=True, forceElement="initialShadingGroup")

		topoReader = cmds.createNode("ExocortexAlembicPolyMesh")
		cmds.connectAttr(topoReader+".outMesh", shape+".inMesh")
		cmds.connectAttr(jobInfo.filenode+".outFileName", topoReader+".fileName")
		cmds.setAttr(topoReader+".identifier", identifier, type="string")
		cmds.setAttr(topoReader+".normals", jobInfo.useNormals)
		cmds.setAttr(topoReader+".uvs", jobInfo.useUVs)
		if jobInfo.useFaceSets:
			cmds.ExocortexAlembic_createFaceSets(o=shape, f=jobInfo.filename, i=identifier)

		if useDynTopo:
			cmds.connectAttr(jobInfo.timeCtrl+".outTime", topoReader+".inTime")
			reader = topoReader
		elif not isConstant:
			reader = cmds.deformer(shape, type="ExocortexAlembicPolyMeshDeform")[0]
			setupReaderAttribute(reader, identifier, isConstant, jobInfo)

		#if not useDynTopo:
		#	setupReaderAttribute(topoReader, identifier, isConstant, jobInfo)

	except:
		return [traceback.format_exc()]
	finally:
		cmds.ExocortexAlembic_profileEnd(f="Python.ExocortexAlembic._import.importPolyMesh")
	return [shape, reader]
开发者ID:AardmanCGI,项目名称:ExocortexCrate,代码行数:35,代码来源:_import.py


示例12: create

	def create(self,targetList,influenceList,defaultWeightVal=1.0,maxDist=0.0,name='surfaceSkin1'):
		"""
		Create surfaceSkin deformer for the given target list or selection
		@param targetList: list of shapes to bind using surfaceSkin
		@type targetList: list
		@param influenceList: list of influences to affect surfaceSkin
		@type influenceList: list
		@param defaultWeightVal: Default influence weight value assigned to components
		@type defaultWeightVal: float
		@param maxDist: Maximum distance to search for components to affect, from the influence surface
		@type maxDist: float
		@param name: Name for new surfaceSkin node
		@type name str
		"""
		# Load plugin
		if not mc.pluginInfo('isoMuscle',l=1,q=1):
			try: mc.loadPlugin('isoMuscle')
			except: raise MissingPluginError('Unable to load surfaceSkin (isoMuscle) plugin!!')
		
		# Create Deformer
		surfaceSkin = mc.deformer(targetList,type='surfaceSkin',n=name)[0]
		# Add influences
		self.addInfluence(influenceList,surfaceSkin,defaultWeightVal,maxDist,calculatePrebind=False)
		# Ensure surfaceSkin::paintWeight and surfaceSkin::weights are paintable attrs
		self.makePaintable()
		# Return result
		return surfaceSkin
开发者ID:auqeyjf,项目名称:pubTool,代码行数:27,代码来源:utilities.py


示例13: importPolyMesh

def importPolyMesh(name, identifier, jobInfo, parentXform=None, isConstant=False, useDynTopo=False):
	cmds.ExocortexAlembic_profileBegin(f="Python.ExocortexAlembic._import.importPolyMesh")

	try:
		reader = ""
		shape  = fnt.alembicCreateNode(name, "mesh", parentXform)
		cmds.sets(shape, e=True, forceElement="initialShadingGroup")

		topoReader = cmds.createNode("ExocortexAlembicPolyMesh")
		cmds.connectAttr(topoReader+".outMesh", shape+".inMesh")
		cmds.connectAttr(jobInfo.filenode+".outFileName", topoReader+".fileName")
		cmds.setAttr(topoReader+".identifier", identifier, type="string")
		cmds.setAttr(topoReader+".normals", jobInfo.useNormals)
		cmds.setAttr(topoReader+".uvs", jobInfo.useUVs)
		if jobInfo.useFaceSets:
			cmds.ExocortexAlembic_createFaceSets(o=shape, f=jobInfo.filename, i=identifier)

		if useDynTopo:
			cmds.connectAttr(jobInfo.timeCtrl+".outTime", topoReader+".inTime")
			reader = topoReader
		elif not isConstant:
			reader = cmds.deformer(shape, type="ExocortexAlembicPolyMeshDeform")[0]
			setupReaderAttribute(reader, identifier, isConstant, jobInfo)

		#if not useDynTopo:
		#	setupReaderAttribute(topoReader, identifier, isConstant, jobInfo)

	except Exception as ex:
		shape = "?importPolyMesh --> exception: \"" + str(ex.args) + "\" of type " + str(type(ex));
		apix.MPxCommand.setResult(shape)
	cmds.ExocortexAlembic_profileEnd(f="Python.ExocortexAlembic._import.importPolyMesh")
	return shape
开发者ID:EriLee,项目名称:ExocortexCrate,代码行数:32,代码来源:_import.py


示例14: attachPolyMesh

def attachPolyMesh(name, identifier, jobInfo, isConstant=False):
    cmds.ExocortexAlembic_profileBegin(f="Python.ExocortexAlembic._attach.attachPolyMesh")
    try:
        if cmds.objectType(name) != "mesh":
            return ["!", "Only mesh can be attached too!"]

        conX = cmds.listConnections(name, d=False, type="ExocortexAlembicPolyMeshDeform")
        if conX:  # it's already attached to a deform, simply change the file reference
            polyObj = conX[0]
            attachTimeAndFile(polyObj, jobInfo, isConstant)
            return [polyObj]

            # create deformer, and attach time and file
        newDform = cmds.deformer(name, type="ExocortexAlembicPolyMeshDeform")[0]
        cmds.setAttr(newDform + ".identifier", identifier, type="string")
        attachTimeAndFile(newDform, jobInfo, isConstant)

        if jobInfo.useFaceSets:
            cmds.ExocortexAlembic_createFaceSets(
                f=cmds.getAttr(jobInfo.filenode + ".outFileName"), i=identifier, o=name
            )
    except:
        return ["!", traceback.format_exc()]
    finally:
        cmds.ExocortexAlembic_profileEnd(f="Python.ExocortexAlembic._attach.attachPolyMesh")
    return [newDform]
开发者ID:AardmanCGI,项目名称:ExocortexCrate,代码行数:26,代码来源:_attach.py


示例15: attachCurves

def attachCurves(name, identifier, jobInfo, isConstant=False):
    cmds.ExocortexAlembic_profileBegin(f="Python.ExocortexAlembic._attach.attachCurves")
    try:
        conX = cmds.listConnections(
            name + ".create", d=False, type="ExocortexAlembicCurvesDeform"
        ) or cmds.listConnections(name + ".create", d=False, type="ExocortexAlembicCurves")
        if conX:
            curObj = conX[0]
            attachTimeAndFile(curObj, jobInfo, isConstant)
            return [curObj]

            # create deformer, and attach time and file
        newDform = cmds.deformer(name, type="ExocortexAlembicCurvesDeform")[0]
        cmds.setAttr(newDform + ".identifier", identifier, type="string")
        attachTimeAndFile(newDform, jobInfo, isConstant)

        # get curObj new "output" attribute connection
        conX = cmds.listConnections(name + ".create", d=False, type="ExocortexAlembicCurvesDeform")
        if conX:
            curObj = conX[0]
            originalCur = cmds.connectionInfo(curObj + ".output", sfd=True).split(".")[0]

            cmds.delete(curObj)
            curObj = cmds.createNode("ExocortexAlembicCurves")
            attachTimeAndFile(curObj, jobInfo, isConstant)

            cmds.connectAttr(curObj + ".outCurve", originalCur + ".create")
            cmds.connectAttr(jobInfo.filenode + ".outFileName", curObj + ".fileName")
            cmds.setAttr(curObj + ".identifier", identifier, type="string")
    except:
        return ["!", traceback.format_exc()]
    finally:
        cmds.ExocortexAlembic_profileEnd(f="Python.ExocortexAlembic._attach.attachCurves")
    return [curObj]
开发者ID:AardmanCGI,项目名称:ExocortexCrate,代码行数:34,代码来源:_attach.py


示例16: createCmd

 def createCmd(self, *args ):
     
     sels = cmds.ls( sl=1 )
     
     if not sels: return None
     
     targetObj = sels[0]
     
     skinNode = self._cmd.getTargetSkinCluster( targetObj )
 
     if not skinNode : return None
     
     duObjs = self._cmd.duplicateObj( targetObj, skinNode )
     
     print duObjs
     
     if duObjs: secondObj = duObjs[0]; thirdObj = duObjs[1]
     else: return None
     
     secondShape = cmds.listRelatives( secondObj, s=1 )[0]
     
     inverseSkinCluster = cmds.deformer( thirdObj, type='inverseSkinCluster' )[0]
     cmds.connectAttr( secondShape+'.outMesh', inverseSkinCluster+'.inMesh' )
     cmds.connectAttr( skinNode+'.message', inverseSkinCluster+'.targetSkinCluster' )
     cmds.connectAttr( targetObj+'.wm', inverseSkinCluster+'.geomMatrix')
     
     pos1, pos2 = self._cmd.getDuPosition( targetObj )
 
     cmds.xform( secondObj, ws=1, matrix=pos1 )
     cmds.xform( thirdObj, ws=1, matrix=pos2 )
     
     cmds.sets( secondObj, thirdObj, e=1, forceElement = "initialShadingGroup" )
     
     cmds.select( secondObj )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:34,代码来源:simpleAddShape.py


示例17: attachCurves

def attachCurves(name, identifier, jobInfo, isConstant=False):
	cmds.ExocortexAlembic_profileBegin(f="Python.ExocortexAlembic._attach.attachCurves")
	if cmds.objExists( name ):
		curObj = cmds.connectionInfo(name+".visibility", sfd=True)
		if curObj and cmds.objectType(curObj) == "ExocortexAlembicCurvesDeform":
			attachTimeAndFile(curObj, jobInfo, isConstant)
			return

		# create deformer, and attach time and file
		newDform = cmds.deformer(name, type="ExocortexAlembicCurvesDeform")[0]
		cmds.setAttr(newDform+".identifier", identifier, type="string")
		attachTimeAndFile(newDform, jobInfo, isConstant)

		# get curObj new "output" attribute connection
		if cmds.objExists( curObj ):
			if curObj != None and cmds.objectType(curObj) != "ExocortexAlembicCurves":
				originalCur = cmds.connectionInfo(curObj+".output", sfd=True).split('.')[0]

				cmds.delete(curObj)
				curObj = cmds.createNode("ExocortexAlembicCurves")
				attachTimeAndFile(curObj, jobInfo, isConstant)

				cmds.connectAttr(curObj+".outCurve", originalCur+".create")
				cmds.connectAttr(jobInfo.filenode+".outFileName", curObj+".fileName")
				cmds.setAttr(curObj+".identifier", identifier, type="string")

	cmds.ExocortexAlembic_profileEnd(f="Python.ExocortexAlembic._attach.attachCurves")
	pass
开发者ID:skarone,项目名称:PipeL,代码行数:28,代码来源:_attach.py


示例18: sqCreateStikyLipsDeformers

 def sqCreateStikyLipsDeformers(self, *args):
     baseMesh = None
     mainCurveList = [self.mainCurveA, self.mainCurveB]
     for mainCurve in mainCurveList:
         if baseMesh == None:
             baseMesh = cmds.duplicate(self.receptList[0], name=self.receptList[0]+"Base")[0]
             cmds.setAttr(baseMesh+".visibility", 0)
         
         wrapNode = cmds.deformer(mainCurve, name="StickyLips_Wrap", type="wrap")[0]
         try:
             cmds.connectAttr(self.receptList[0]+".dropoff", wrapNode+".dropoff[0]", force=True)
             cmds.connectAttr(self.receptList[0]+".inflType", wrapNode+".inflType[0]", force=True)
             cmds.connectAttr(self.receptList[0]+".smoothness", wrapNode+".smoothness[0]", force=True)
             cmds.connectAttr(self.receptList[0]+"Shape.worldMesh[0]", wrapNode+".driverPoints[0]", force=True)
         except:
             pass
         
         cmds.connectAttr(baseMesh+"Shape.worldMesh[0]", wrapNode+".basePoints[0]", force=True)
         cmds.connectAttr(mainCurve+"Shape.worldMatrix[0]", wrapNode+".geomMatrix", force=True)
         cmds.setAttr(wrapNode+".maxDistance", 1)
         cmds.setAttr(wrapNode+".autoWeightThreshold", 1)
         cmds.setAttr(wrapNode+".exclusiveBind", 1)
         
     baseCurveList = [self.baseCurveA, self.baseCurveB]
     for c, baseCurve in enumerate(baseCurveList):
         wireNode = cmds.wire(self.receptList[1], name=baseCurve+"_Wire", groupWithBase=False, crossingEffect=0, localInfluence=0)[0]
         cmds.connectAttr(mainCurveList[c]+"Shape.worldSpace[0]", wireNode+".baseWire[0]", force=True)
         cmds.connectAttr(baseCurve+"Shape.worldSpace[0]", wireNode+".deformedWire[0]", force=True)
         self.wireNodeList.append(wireNode)
         
         wireLocList = []
         for i in range(0, self.maxIter):
             wireLocList.append(baseCurve+".u["+str(i)+"]")
         cmds.dropoffLocator(1, 1, wireNode, wireLocList)
开发者ID:utsdab,项目名称:config,代码行数:34,代码来源:sqStickyLipsSetup.py


示例19: _setup_plugin

    def _setup_plugin(self):
        collider = cmds.polySphere()[0]
        target = cmds.polySphere(subdivisionsAxis=20,
                                 subdivisionsHeight=20)[0]
#         target = cmds.polyCube()
        plugin = cmds.deformer(target, type=self.name)[0]
        cmds.connectAttr('%s.worldInverseMatrix' % collider,
                         '%s.volumeInverseMatrix' % plugin)
开发者ID:jonntd,项目名称:Public,代码行数:8,代码来源:goe_volumenode.py


示例20: create

def create(mesh=None):
    _load_plugin()
    if mesh is None:
        sel = cmds.ls(sl=True, l=True)
        if not sel or len(sel) != 1:
            OpenMaya.MGlobal.displayError('Select a mesh.')
            return
        mesh = sel[0]

    return cmds.deformer(mesh, type='zMappedWrapDeformer')[0]
开发者ID:SEVEZ,项目名称:zMappedWrapDeformer,代码行数:10,代码来源:zMappedWrapDeformer.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python cmds.delete函数代码示例发布时间:2022-05-27
下一篇:
Python cmds.cutKey函数代码示例发布时间: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