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

Python cmds.aliasAttr函数代码示例

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

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



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

示例1: doAlias

 def doAlias(self,arg):
     """ 
     Set the alias of an attribute
     
     Keyword arguments:
     arg(string) -- name you want to use as an alias
     """     
     assert type(arg) is str or unicode,"Must pass string argument into doAlias"                
     if arg:
         try:
             if arg != self.nameAlias:
                 if mc.aliasAttr(arg,self.nameCombined):
                     self.nameAlias = arg
             else:
                 guiFactory.report("'%s.%s' already has that alias!"%(self.obj.nameShort,self.attr,arg))
                 
         except:
             guiFactory.warning("'%s.%s' failed to set alias of '%s'!"%(self.obj.nameShort,self.attr,arg))
                 
     else:
         if self.nameAlias:
             self.attr = self.nameLong                
             mc.aliasAttr(self.nameCombined,remove=True)
             self.nameAlias = False
             self.updateData()
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:25,代码来源:AttrFactory.py


示例2: addPose

def addPose(tangentBlend, baseGeo='', offsetGeo='', poseName=''):
    """
    @param tangentBlend:
    @param baseGeo:
    @param offsetGeo:
    @param poseName:
    """
    # Define suffix tags
    tangentBlend_baseTag = '_poseBase'
    tangentBlend_offsetTag = '_poseOffset'

    # Get connected geometry
    geo = findAffectedGeometry(tangentBlend)

    # Check pose geometry
    if not baseGeo: baseGeo = duplicateGeo(geo, geo + tangentBlend_baseTag)
    if not offsetGeo: baseGeo = duplicateGeo(geo, geo + tangentBlend_offsetTag)

    # Connect to deformer
    poseIndex = connectPose(baseGeo, offsetGeo, tangentBlend)

    # Alias pose name and set keyable
    if poseName:
        cmds.aliasAttr(poseName, tangentBlend + '.pose[' + str(poseIndex) + '].poseWeight')
        cmds.setAttr(tangentBlend + '.pose[' + str(poseIndex) + '].poseWeight', cb=True)
        cmds.setAttr(tangentBlend + '.pose[' + str(poseIndex) + '].poseWeight', k=True)

    return [baseGeo, offsetGeo]
开发者ID:bennymuller,项目名称:glTools,代码行数:28,代码来源:tangentBlend.py


示例3: add

	def add(self,objectList):
		'''
		Adds the channel state attr to all specified objects
		@param objectList: List of objects to add flags to
		@type objectList: list
		'''
		# Add Channel State Attrs
		for obj in objectList:
			
			# Check obj
			if not mc.objExists(obj):
				raise Exception('Object "'+obj+'" does not exist!')
			if not glTools.utils.transform.isTransform(obj):
				raise Exception('Object "'+obj+'" is not a valid transform!')
			if mc.objExists(obj+'.channelState'):
				print ('Object "'+obj+'" already has a "channelState" attribute! Skipping...')
			
			# Add channelState attr
			#mc.addAttr(obj,ln='channelState',at='enum',en=':Keyable:NonKeyable:Locked:',m=1,dv=-1)
			mc.addAttr(obj,ln='channelState',at='enum',en=':Keyable:NonKeyable:Locked:',m=1)
			
			# Set channelState flag values
			for i in range(len(self.channel)):
				if mc.getAttr(obj+'.'+self.channel[i],l=1):
					# Set Locked State
					mc.setAttr(obj+'.channelState['+str(i)+']',2)
				elif not mc.getAttr(obj+'.'+self.channel[i],k=1):
					# Set NonKeyable State
					mc.setAttr(obj+'.channelState['+str(i)+']',1)
				else:
					# Set Keyable State
					mc.setAttr(obj+'.channelState['+str(i)+']',0)
				# Alias Attribute
				mc.aliasAttr(self.channel[i]+'_state',obj+'.channelState['+str(i)+']')
开发者ID:auqeyjf,项目名称:glTools,代码行数:34,代码来源:channelState.py


示例4: _disconnectAndRemoveAttr

def _disconnectAndRemoveAttr(attr, remove=False):
	"""Disconnects inputs and outputs from the given attribute."""
	
	sel = cmds.ls(sl=True)
	cmds.select(cl=True)
	
	# unlock if needed
	cmds.setAttr(attr, l=False)
	
	# if any connection, disconnect
	srcAttrs = cmds.listConnections(attr, d=False, p=True) or []
	destAttrs = cmds.listConnections(attr, s=False, p=True) or []
	for srcAttr in srcAttrs:
		cmds.disconnectAttr(srcAttr, attr)
	
	for destAttr in destAttrs:
		cmds.disconnectAttr(attr, destAttr)
	
	# remove element
	if remove:
		cmds.removeMultiInstance(attr)
		
		# remove alias
		if cmds.aliasAttr(attr, q=True):
			cmds.aliasAttr(attr, rm=True)
	
	cmds.select(sel or None)
开发者ID:Bumpybox,项目名称:Tapp,代码行数:27,代码来源:ZvRadialBlendShape.py


示例5: setDefaultAttrState

def setDefaultAttrState(objList,attrList,valueList=[]):
	'''
	Set default attribute state values for a specified list of object attributes.
	@param objList: List of objects to store default attribute state values for.
	@type objList: list
	@param attrList: List of attributes to store default attribute state values for.
	@type attrList: list
	@param valueList: List of attributes values to assign to the default attribute states. If empty, use current object attribute values.
	@type valueList: list
	'''
	# Check Object List
	if not objList: return
	if not attrList: return
	if len(attrList) != len(valueList):
		print ('Attribute and value list mis-match! Recording existing attribute values.')
		valueList = []
	
	# Define defaultAttrState attribute name
	defAttr = 'defaultAttrState'
	aliasSuffix = 'defaultState'
	
	# For each object in list
	for obj in objList:
		
		# Check Object
		if not mc.objExists(obj):
			raise Exception('Object "'+obj+'" does not exist!')
		if not mc.attributeQuery(defAttr,n=obj,ex=True):
			addDefaultAttrState([obj])
		
		# For each attribute in list
		for i in range(len(attrList)):
			
			# Get current attribute
			attr = attrList[i]
			attrAlias = attr+'_'+aliasSuffix
			
			# Check attribute
			if not mc.attributeQuery(attr,n=obj,ex=True):
				raise Exception('Object "'+obj+'" has no attribute "'+attr+'"!')
			
			# Get attribute value
			if valueList: value = valueList[i]
			else: value = mc.getAttr(obj+'.'+attr)
			
			# Add default attribute state
			if not mc.attributeQuery(attrAlias,n=obj,ex=True):
				try: index = mc.getAttr(obj+'.'+defAttr,s=True)
				except: print('Error getting multi length from "'+obj+'.'+defAttr+'"')
				mc.setAttr(obj+'.'+defAttr+'['+str(index)+']',0)
				try: mc.aliasAttr(attrAlias,obj+'.'+defAttr+'['+str(index)+']')
				except: print('Error setting attribute alias ("'+attrAlias+'") for node attr "'+obj+'.'+defAttr+'['+str(index)+']"')
			
			# Set default attribute state
			try: mc.setAttr(obj+'.'+attrAlias,value)
			except: print('Unable to set default attr state ("'+attrAlias+'") for object "'+obj+'" to value ('+str(value)+')!')
开发者ID:auqeyjf,项目名称:glTools,代码行数:56,代码来源:defaultAttrState.py


示例6: init_module_trans

	def init_module_trans(self,root_pos):

		ctrl_grp_file = os.environ["mlrig_tool"]+"/controlobjects/blueprint/controlGroup_control.ma"
		cmds.file(ctrl_grp_file, i=True)

		self.module_trans = cmds.rename("controlGroup_control", self.module_namespace+":module_transform")

		cmds.xform(self.module_trans, worldSpace=True, absolute=True, translation=root_pos)

		# mirroring method
		if self.mirrored:

			duplicate_transform = cmds.duplicate(self.original_module+":module_transform", parentOnly=True, name="TEMP_TRANSFORM")[0]
			empty_group = cmds.group(empty=True)
			cmds.parent(duplicate_transform, empty_group, absolute=True)

			scale_attr = ".scaleX"

			if self.mirror_plane == "XZ":

				scale_attr = ".scaleY"

			elif self.mirror_plane == "XY":

				scale_attr = ".scaleZ"

			cmds.setAttr(empty_group+scale_attr, -1)

			parent_constraint = cmds.parentConstraint(duplicate_transform, self.module_trans, maintainOffset=False)
			
			cmds.delete(parent_constraint)
			cmds.delete(empty_group)

			temp_locator = cmds.spaceLocator()[0]
			scale_constraint = cmds.scaleConstraint(self.original_module+":module_transform", temp_locator, maintainOffset=False)[0]

			scale = cmds.getAttr(temp_locator+".scaleX")
			cmds.delete([temp_locator, scale_constraint])

			cmds.xform(self.module_trans, objectSpace=True, scale=[scale, scale, scale])

		utils.add_node_to_container(self.container_name, self.module_trans, ihb=True)

		# Setup global scaling 

		cmds.connectAttr(self.module_trans+".scaleY", self.module_trans+".scaleX")
		cmds.connectAttr(self.module_trans+".scaleY", self.module_trans+".scaleZ")

		cmds.aliasAttr("globalScale", self.module_trans+".scaleY")

		cmds.container(self.container_name, edit=True, publishAndBind=[self.module_trans+".translate", "moduleTransform_T"])
		cmds.container(self.container_name, edit=True, publishAndBind=[self.module_trans+".rotate", "moduleTransform_R"])
		cmds.container(self.container_name, edit=True, publishAndBind=[self.module_trans+".globalScale", "moduleTransform_globalScale"])
开发者ID:firstPeterParker,项目名称:mlRig,代码行数:53,代码来源:blueprint.py


示例7: createTemporaryGroupRepresentation

	def createTemporaryGroupRepresentation(self):
		controlGrpFile = os.environ['RIGGING_TOOL_ROOT'] + '/ControlObjects/Blueprint/controlGroup_control.ma'
		cmds.file(controlGrpFile, i=True)
		
		self.tempGroupTransform = cmds.rename('controlGroup_control', 'Group_tempGroupTransform__')
		
		cmds.connectAttr((self.tempGroupTransform + '.scaleY'),(self.tempGroupTransform + '.scaleX'))
		cmds.connectAttr((self.tempGroupTransform + '.scaleY'),(self.tempGroupTransform + '.scaleZ'))
		
		for attr in ['scaleX', 'scaleZ','visibility']:
			cmds.setAttr((self.tempGroupTransform + '.' + attr), l=True, k=False)
			
		cmds.aliasAttr('globalScale', (self.tempGroupTransform + '.scaleY'))
开发者ID:pouyaz123,项目名称:Python-character-pipeline,代码行数:13,代码来源:groupSelected.py


示例8: createTemporaryGroupRepresentation

 def createTemporaryGroupRepresentation(self):
     #063
     # Import a new transform
     controlGrpFile = os.environ["GEPPETTO"] + "/ControlObjects/Blueprint/controlGroup_control.ma"
     cmds.file(controlGrpFile, i=True)
     # rename the transform
     self.tempGroupTransform = cmds.rename("controlGroup_control", "Group__tempGroupTransform__")
     # Hook all scale attributes to scaleY
     cmds.connectAttr(self.tempGroupTransform+".scaleY", self.tempGroupTransform+".scaleX")
     cmds.connectAttr(self.tempGroupTransform+".scaleY", self.tempGroupTransform+".scaleZ")
     # Lock unused attributes
     for attr in ["scaleX", "scaleZ", "visibility"]:
         cmds.setAttr(self.tempGroupTransform+"."+attr, l=True, k=False)
         
     cmds.aliasAttr("globalScale", self.tempGroupTransform+".scaleY")
开发者ID:griffinanimator,项目名称:MPR,代码行数:15,代码来源:groupSelected.py


示例9: rename

	def rename( self, oldName, newName ):
		'''will rename a blend shape target - if the target doesn't exist, the method does nothing...'''
		names = self.targets
		aliasList = cmd.aliasAttr(self.name,query=True)
		if oldName in names:
			idx = aliasList.index(oldName)
			aliasList[idx] = newName
			for n in range(1,len(aliasList),2): aliasList[n] = self.name +'.'+ aliasList[n]

			#now remove all the alias'
			for name in names: cmd.aliasAttr(self.name +'.'+ name,remove=True)

			#finally rebuild the alias'
			cmdStr = 'aliasAttr ' + ' '.join(aliasList) +';'
			maya.mel.eval(cmdStr)
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:15,代码来源:blendShapeTools.py


示例10: create_temp_grp_representation

	def create_temp_grp_representation(self):

		control_group_file = os.environ["mlrig_tool"]+"/controlobjects/blueprint/controlGroup_control.ma"
		cmds.file(control_group_file, i=True)

		self.temp_group_transform = cmds.rename("controlGroup_control", "Group__tempGroupTransform__")

		cmds.connectAttr(self.temp_group_transform+".scaleY", self.temp_group_transform+".scaleX")
		cmds.connectAttr(self.temp_group_transform+".scaleY", self.temp_group_transform+".scaleZ")

		for attr in ["scaleX", "scaleZ", "visibility"]:

			cmds.setAttr(self.temp_group_transform+"."+attr, keyable=False, lock=True)

		cmds.aliasAttr("globalScale", self.temp_group_transform+".scaleY")
开发者ID:firstPeterParker,项目名称:mlRig,代码行数:15,代码来源:group_selected.py


示例11: loadModuleControl

    def loadModuleControl(self, rootJoint):

        path = environ.ControlObjectsPath + "module_control.ma"
        cmds.file(path, i = True, ignoreVersion = True,  renameAll=True, mergeNamespacesOnClash=True, namespace=':', options='v=0;')

        self.moduleControl = cmds.rename("module_control", self.moduleName + ":module_control")

        cmds.xform(self.moduleControl, ws = True, translation = cmds.xform(rootJoint, q = True, ws = True, a = True, translation = True) )

        cmds.connectAttr(self.moduleControl + '.scaleY', self.moduleControl + '.scaleX')
        cmds.connectAttr(self.moduleControl + '.scaleY', self.moduleControl + '.scaleZ')

        cmds.aliasAttr('globalScale', self.moduleControl + '.scaleY')

        return
开发者ID:jeffhong21,项目名称:scripts,代码行数:15,代码来源:blueprint.py


示例12: getTargetIndex

def getTargetIndex(blendShape, target):
    """
    Get the target index of the specified blendShape and target name
    @param blendShape: Name of blendShape to get target index for
    @type blendShape: str
    @param target: BlendShape target to get the index for
    @type target: str
    """
    # Check blendShape
    if not isBlendShape(blendShape):
        raise Exception('Object "' + blendShape + '" is not a valid blendShape node!')

    # Check target
    if not cmds.objExists(blendShape + '.' + target):
        raise Exception('Blendshape "' + blendShape + '" has no target "' + target + '"!')

    # Get attribute alias
    aliasList = cmds.aliasAttr(blendShape, q=True)
    aliasIndex = aliasList.index(target)
    aliasAttr = aliasList[aliasIndex + 1]

    # Get index
    targetIndex = int(aliasAttr.split('[')[-1].split(']')[0])

    # Return result
    return targetIndex
开发者ID:bennymuller,项目名称:glTools,代码行数:26,代码来源:blendShape.py


示例13: connectInbetween

def connectInbetween(
						blendShapeObject = '' ,
						blendShapeNode = '' ,
						inbetweenBlendShape = '' ,
						targetBlendShapeName = '' ,
						weightValue = ''
					) :
	
	# Add inbetween blend shape.

	aliasAttrList = mc.aliasAttr( blendShapeNode , q=True )

	for each in aliasAttrList :

		if each == targetBlendShapeName :

			idx = aliasAttrList.index( each )
			wStr = str( aliasAttrList[ idx+1 ] )
			wIdx = re.findall( r'\d+' , wStr )[0]

			cmd = 'blendShape -e  -ib -t %s %s %s %s %s;' % (
																blendShapeObject ,
																wIdx ,
																inbetweenBlendShape ,
																weightValue ,
																blendShapeNode
															)
			
			mm.eval( cmd )
开发者ID:myCodeTD,项目名称:pkmel,代码行数:29,代码来源:blendShapeTools.py


示例14: _buildPoseDict

    def _buildPoseDict(self, nodes):
        """
        Build the internal poseDict up from the given nodes. This is the
        core of the Pose System
        """
        if self.metaPose:
            getMetaDict = self.metaRig.getNodeConnectionMetaDataMap  # optimisation

        for i, node in enumerate(nodes):
            key = r9Core.nodeNameStrip(node)
            self.poseDict[key] = {}
            self.poseDict[key]["ID"] = i  # selection order index
            self.poseDict[key]["longName"] = node  # longNode name

            if self.metaPose:
                self.poseDict[key]["metaData"] = getMetaDict(node)  # metaSystem the node is wired too

            channels = r9Anim.getSettableChannels(node, incStatics=True)
            if channels:
                self.poseDict[key]["attrs"] = {}
                for attr in channels:
                    if attr in self.skipAttrs:
                        log.debug("Skipping attr as requested : %s" % attr)
                        continue
                    try:
                        if (
                            cmds.getAttr("%s.%s" % (node, attr), type=True) == "TdataCompound"
                        ):  # blendShape weights support
                            attrs = cmds.aliasAttr(node, q=True)[::2]  # extract the target channels from the multi
                            for attr in attrs:
                                self.poseDict[key]["attrs"][attr] = cmds.getAttr("%s.%s" % (node, attr))
                        else:
                            self.poseDict[key]["attrs"][attr] = cmds.getAttr("%s.%s" % (node, attr))
                    except:
                        log.debug("%s : attr is invalid in this instance" % attr)
开发者ID:vitattoo,项目名称:Red9_StudioPack,代码行数:35,代码来源:Red9_PoseSaver.py


示例15: getObjAttrNames

def getObjAttrNames( obj, attrNamesToSkip=() ):

	#grab attributes
	objAttrs = cmd.listAttr( obj, keyable=True, visible=True, scalar=True ) or []

	#also grab alias' - its possible to pass in an alias name, so we need to test against them as well
	aliass = cmd.aliasAttr( obj, q=True ) or []

	#because the aliasAttr cmd returns a list with the alias, attr pairs in a flat list, we need to iterate over the list, skipping every second entry
	itAliass = iter( aliass )
	for attr in itAliass:
		objAttrs.append( attr )
		itAliass.next()

	filteredAttrs = []
	for attr in objAttrs:
		skipAttr = False
		for skipName in attrNamesToSkip:
			if attr == skipName:
				skipAttr = True
			elif attr.startswith( skipName +'[' ) or attr.startswith( skipName +'.' ):
				skipAttr = True

		if skipAttr:
			continue

		filteredAttrs.append( attr )

	return filteredAttrs
开发者ID:BGCX261,项目名称:zootoolbox-git,代码行数:29,代码来源:animLib.py


示例16: _buildPoseDict

    def _buildPoseDict(self, nodes):
        '''
        Build the internal poseDict up from the given nodes. This is the
        core of the Pose System
        '''
        if self.metaPose:
            getMetaDict=self.metaRig.getNodeConnectionMetaDataMap  # optimisation

        for i,node in enumerate(nodes):
            key=r9Core.nodeNameStrip(node)
            self.poseDict[key]={}
            self.poseDict[key]['ID']=i           # selection order index
            self.poseDict[key]['longName']=node  # longNode name
            
            if self.metaPose:
                self.poseDict[key]['metaData']=getMetaDict(node)  # metaSystem the node is wired too

            channels=r9Anim.getSettableChannels(node,incStatics=True)
            if channels:
                self.poseDict[key]['attrs']={}
                for attr in channels:
                    try:
                        if cmds.getAttr('%s.%s' % (node,attr),type=True)=='TdataCompound':  # blendShape weights support
                            attrs=cmds.aliasAttr(node, q=True)[::2]  # extract the target channels from the multi
                            for attr in attrs:
                                self.poseDict[key]['attrs'][attr]=cmds.getAttr('%s.%s' % (node,attr))
                        else:
                            self.poseDict[key]['attrs'][attr]=cmds.getAttr('%s.%s' % (node,attr))
                    except:
                        log.debug('%s : attr is invalid in this instance' % attr)
开发者ID:nicolasboselli,项目名称:test,代码行数:30,代码来源:Red9_PoseSaver.py


示例17: initialiseModuleTransform

	def initialiseModuleTransform(self, rootPos):
		controlGrpFile = os.environ['RIGGING_TOOL_ROOT'] + '/ControlObjects/Blueprint/controlGroup_control.ma'
		cmds.file(controlGrpFile, i=True)
		
		self.moduleTransform = cmds.rename('controlGroup_control', self.moduleNamespace + ':module_transform')
		
		cmds.xform(self.moduleTransform, worldSpace=True, absolute=True, translation=rootPos)
		
		if self.mirrored:
			duplicateTransform = cmds.duplicate(self.originalModule + ':module_transform', parentOnly=True,name='TEMP_TRANSFORM')[0]
			emptyGroup = cmds.group(empty=True)
			cmds.parent(duplicateTransform, emptyGroup, absolute=True)
			
			scaleAttr = '.scaleX'
			if self.mirrorPlane == 'XZ':
				scaleAttr = '.scaleY'
			elif self.mirrorPlane == 'XY':
				scaleAttr = '.scaleZ'
				
			cmds.setAttr((emptyGroup + scaleAttr), -1)
			
			parentConstraint = cmds.parentConstraint(duplicateTransform, self.moduleTransform, maintainOffset=False)
			cmds.delete(parentConstraint)
			cmds.delete(emptyGroup)
			
			tempLocator = cmds.spaceLocator()[0]
			scaleConstraint = cmds.scaleConstraint(self.originalModule + ':module_transform', tempLocator,maintainOffset=False)[0]
			scale = cmds.getAttr(tempLocator + '.scaleX')
			cmds.delete([tempLocator,scaleConstraint])
			
			cmds.xform(self.moduleTransform, objectSpace=True, scale=[scale,scale,scale])
			
			
		
		utils.addNodeToContainer(self.containerName, self.moduleTransform, ihb=True)
		
		#Setup global scaling
		cmds.connectAttr((self.moduleTransform + '.scaleY'),(self.moduleTransform + '.scaleX'))
		cmds.connectAttr((self.moduleTransform + '.scaleY'),(self.moduleTransform + '.scaleZ'))
		
		cmds.aliasAttr('globalScale', (self.moduleTransform + '.scaleY'))
		
		cmds.container(self.containerName, edit=True, publishAndBind=[(self.moduleTransform + '.translate'),'moduleTransform_T'])
		cmds.container(self.containerName, edit=True, publishAndBind=[(self.moduleTransform + '.rotate'),'moduleTransform_R'])
		cmds.container(self.containerName, edit=True, publishAndBind=[(self.moduleTransform + '.globalScale'),'moduleTransform_globalScale'])
开发者ID:pouyaz123,项目名称:Python-character-pipeline,代码行数:45,代码来源:blueprint.py


示例18: on_btn_builde_clicked

    def on_btn_builde_clicked(self, args=None):
        if args==None:return
        geometry   = str(self.LET_Geometry.text())
        blendShape = str(self.LET_BlendShape.text())
        if not mc.objExists(geometry):return
        if not mc.objExists(blendShape):return 
        
        #buildTargents(geometry, blendShape)
        targentList = mc.aliasAttr(blendShape, q=True)
        targentDict = {}
        for i in range(len(targentList)):
            if i % 2 != 0:continue
            targentDict[targentList[i]] = re.search('\d+', targentList[i+1]).group()
        
    
        #===========================================================
        self.progressBar.setMinimum(0)
        self.progressBar.setMaximum(len(targentDict))
        self.progressLabel.setText('0 / %d'%len(targentDict))
        mc.setAttr('%s.en'%blendShape, 0)
        #===========================================================
        #- builde
        v = 0
        for name, index in targentDict.iteritems():
            targent = mc.duplicate(geometry, n=name)[0]
            buildTargent(blendShape, targent, index)
            
            targentShape = mc.listRelatives(targent, s=True, path=True)
            mc.connectAttr('%s.worldMesh[0]'%targentShape[0], '%s.it[0].itg[%s].iti[6000].igt'%(blendShape, index), f=True)
            
            #--------------------------------------------------------------
            v += 1
            self.progressBar.setValue(v)
            self.progressLabel.setText('%d / %d'%(v, len(targentDict)))
            self.progressName.setText(targent)
            #--------------------------------------------------------------

        #- move 
        targents = targentList[::2]
        targents.sort()
        W = mc.getAttr('%s.bbmx'%geometry)[0][0] - mc.getAttr('%s.bbmn'%geometry)[0][0]
        H = mc.getAttr('%s.bbmx'%geometry)[0][1] - mc.getAttr('%s.bbmn'%geometry)[0][1]
        for i, targent in enumerate(targents):
            for attr in ('tx', 'ty', 'tz', 'rx', 'ry', 'rz', 'sx', 'sy', 'sz'):
                mc.setAttr('%s.%s'%(targent, attr), l=False, k=True, cb=True)
        
            mc.move(W*(i % 15), H*(i // 15 + 1), 0, targent, r=True)
        
        #================================================
        self.progressBar.setMinimum(0)
        self.progressBar.setMaximum(1)
        self.progressLabel.setText('0 / 0')
        self.progressName.setText('{$targent}')
        mc.setAttr('%s.en'%blendShape, 1)
开发者ID:AtonLerin,项目名称:RiggingTeamTools,代码行数:54,代码来源:buildTargents.py


示例19: getTargetIdx

	def getTargetIdx( self, target ):
		'''given a target name this method will return its index in the weight attribute'''
		indicies = []
		aliasList = cmd.aliasAttr(self.name,query=True)
		if aliasList == None:
			raise Exception( "not aliasAttr found on %s"%(self.name,))

		for n in range(0,len(aliasList),2):
			if aliasList[n] == target:
				idx = aliasList[n+1][7:][:-1]
				return int(idx)

		raise AttributeError("target doesn't exist")
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:13,代码来源:blendShapeTools.py


示例20: rename

def rename(attr, name):
    """
	Rename specified attribute
	"""
    # Check attribute
    if not mc.objExists(attr):
        raise Exception('Attribute "' + attr + '" does not exist!')

        # Rename (alias) attribute
    result = mc.aliasAttr(name, attr)

    # Return result
    return result
开发者ID:auqeyjf,项目名称:glTools,代码行数:13,代码来源:attribute.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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