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

Python cmds.select函数代码示例

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

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



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

示例1: m

def m(p, _t=None):
    if not _t:
        _t = mc.ls(sl=1)

    for i in range (0,len(_t)):
        mc.select(_t[i])
        mc.move(p[0],p[1],p[2])
开发者ID:n1ckfg,项目名称:MayaToolbox,代码行数:7,代码来源:mayatoolbox_main.py


示例2: edgeLoopWeights

def edgeLoopWeights(edgeList):
    """
    """
    # Check Edge List
    if not edgeList: raise Exception('Invalid or empty edge list!')
    edgeList = cmds.filterExpand(edgeList, ex=True, sm=32) or []
    if not edgeList: raise Exception('Invalid edge list! List of polygon edges required...')

    # Get Mesh from Edges
    mesh = list(set(cmds.ls(edgeList, o=True) or []))
    if len(mesh) > 1:
        raise Exception('Edges from multiple mesh shapes were supplied! ' + str(mesh))
    mesh = mesh[0]

    for edge in edgeList:
        # Get Edge ID
        edgeID = glTools.utils.component.index(edge)

        # Get Vertices from Edge
        edgeVerts = cmds.polyListComponentConversion(edge, fe=True, tv=True)

        # Get Average Vertex Weights
        cmds.select(edgeVerts)
        glTools.tools.copyPasteWeights.averageWeights()

        # Select Edge Loop Vertices
        cmds.polySelect(mesh, edgeLoop=edgeID)
        loopEdges = cmds.ls(sl=1, fl=1)
        loopVerts = cmds.polyListComponentConversion(loopEdges, fe=True, tv=True)
        cmds.select(loopVerts)
        glTools.tools.copyPasteWeights.pasteWeights()

    # Return Result
    return mesh
开发者ID:bennymuller,项目名称:glTools,代码行数:34,代码来源:skinCluster.py


示例3: orderNextTo

def orderNextTo(objects, target):
    '''
    places 'objects'/[objects] next to 'target' in hierarchy and ordering

    I found most of the time I use the get/setOrder stuff to relocate objs to another
    with parenting and if in world and hierarchy Nr and all that shit.. this does it inline
    '''
    if not isinstance(objects, list):
        objects = [objects]
    handledObjs = []
    targetParent = m.listRelatives(target, parent=True, fullPath=True)
    targetNr = getOrder(target)
    # handle each object on its own no matter how its parented
    for o in objects:
        oParent = m.listRelatives(o, parent=1, fullPath=1)
        if oParent != targetParent:
            if targetParent:
                o = m.parent(o, targetParent)[0]
            else:
                o = m.parent(o, world=1)[0]
        # else if in same hierarchy already decrease count if obj is before target
        elif getOrder(o) <= targetNr:
            targetNr -= 1
        handledObjs.append(o)
    setOrder(handledObjs, targetNr + 1)
    m.select(handledObjs)
    return handledObjs
开发者ID:ewerybody,项目名称:melDrop,代码行数:27,代码来源:scene.py


示例4: checkSelObj

 def checkSelObj(self):
     """检查选中的物体是否为mesh节点
 
     Description:
         选有物体且所选的是mesh节点,返回True
         没选物体或所选物体类型不符合,则返回False
 
     Arguments:
         无
 
     Returns:        
         result = True:通过检查
         result = False:没通过检查,释放所有选择
     """
     selObj = cmds.ls(sl =True)
     lenOfSel = len(selObj)
     result = True
     if lenOfSel < 1:
         cmds.confirmDialog(title = "Warning", message = "Please Select Objects!", button = "OK", defaultButton = "OK")
         result = False
     else:
         for eachObj in selObj:
             if cmds.nodeType(eachObj) != "transform":
                 cmds.confirmDialog(title = "Warning", message = "There Has An Object With Incorrect Type!", button = "OK", defaultButton = "OK")
                 cmds.select(deselect = True)  #去除所有选择
                 result = False
                 break
     
     return result
开发者ID:chloechan,项目名称:clothAndHair,代码行数:29,代码来源:clothAndHairTools.py


示例5: crear

	def crear(self):
			
		#Tipo 1
		if(self.edififio_seleccionado == 0):
			cmds.polyCube(w = self.anchura, d = self.Largo, h = self.Anchura_random, n =  str(self.EdificioName))
			
		#Tipo 2
		elif(self.edififio_seleccionado == 1):
		
			cmds.polyCube(w = self.anchura, d = self.Largo, h = self.Anchura_random, n =  str(self.EdificioName))
			
			#Modificamos las caras aleatoriamente
			for i in range(0, random.randrange(0,3)):
				cmds.polyExtrudeFacet(str(self.EdificioName) + ".f[1]", kft = False, ls = (0.8, 0.8, 0))
				cmds.polyExtrudeFacet(str(self.EdificioName) + ".f[1]", kft = False, ltz = 30)	
			
		#Tipo 3	
		else:
			cmds.polyCube(w = self.anchura, d = self.Largo, h = self.Anchura_random, sx = self.xDiv, sy = self.yDiv, sz = self.zDiv, n = str(self.EdificioName))			
			
			sides = []
			
			#Seleccionamos el edificio
			for i in range(0, 8):
				if(i != 1 and i != 3):
					sides.append(str(self.EdificioName) + ".f[" + str(self.xDiv * self.yDiv * i) + ":" + str((self.xDiv * self.yDiv * (i+1)) - 1) + "]")
			
			#Modificamos las caras para generar ventanas
			cmds.polyExtrudeFacet(sides[0], sides[1], sides[2], sides[3], sides[4], sides[5], kft = False, ls = (0.8, 0.8, 0))
			windows = cmds.ls(sl = True)
			cmds.polyExtrudeFacet(windows[1], windows[2], windows[3], kft = False, ltz = -0.2)
			cmds.select( self.EdificioName)
开发者ID:Milpoder,项目名称:PFG-ContentGeneration,代码行数:32,代码来源:Tercero.py


示例6: filterSelection

    def filterSelection(self):
        """
            from a raw list of items, returns 1 dict containing:
            {[meshes], [cameras], [locators], [lights]}
        """
        # get current selection
        cmds.select(hi = True)
        selection = [str(item) for item in cmds.ls(sl = True)]

        # fill the items dict from the raw selection
        items = {}
        # meshes
        items['meshes'] = [cmds.listRelatives(node, p=True, fullPath=True)[0] \
                    for node in selection if cmds.nodeType(node) == "mesh"]
        # cameras
        items['cameras'] = [cmds.listRelatives(node, p=True, fullPath=True)[0] \
                    for node in selection if cmds.nodeType(node) == "camera"]
        # locators
        items['locators'] = [cmds.listRelatives(node, p=True, fullPath=True)[0] \
                    for node in selection if cmds.nodeType(node) == "locator"]
        # lights
        items['lights'] = [cmds.listRelatives(node, p=True, fullPath=True)[0] \
                    for node in selection if 'Light' in cmds.nodeType(node)]

        return items
开发者ID:manymax21,项目名称:dmptools,代码行数:25,代码来源:utils.py


示例7: mirrorJoints

    def mirrorJoints(self, topJoint = '', prefix = ['l_', 'r_']):
        """
        mirroring joint, top node needs to contain 'l_' as prefix
        """

        lPrefix = prefix[0]
        rPrefix = prefix[1]
        
        cmds.select(cl = True)
        cmds.joint(n = 'temp_jnt')
        cmds.select(topJoint, r = True)
        cmds.select('temp_jnt', tgl = True)
        self.toggleSelect(topJoint, 'temp_jnt')
        cmds.parent()
        
        cmds.select(topJoint, r = True)
        cmds.mirrorJoint(mirrorYZ = True, mirrorBehavior  = True, myz = True, searchReplace =  prefix)
        
        rJoint = rPrefix + topJoint.split(lPrefix)[-1]
        cmds.select(topJoint, rJoint)
        cmds.parent(w = True)
        
        cmds.delete('temp_jnt')
        
        return rJoint
开发者ID:darkuress,项目名称:arFace,代码行数:25,代码来源:Util.py


示例8: __init__

 def __init__(self, start_face):
     self.start_face = start_face
     cmds.select(self.start_face)
     self.start_face_sel = cmds.ls(sl=True)
     self.slice_point = self.start_face_sel[0].find('.')
     self.geom_name = self.start_face_sel[0][:int(self.slice_point)]
     self.ordered_list = [self.start_face]
开发者ID:XJZeng,项目名称:Maya-Select_Faces_In_Multiples,代码行数:7,代码来源:selectAltFaces_v_3.02.py


示例9: orientJoints

 def orientJoints(s):
     """
     Face joints in the correct direction.
     """
     sel = cmds.ls(sl=True)
     err = cmds.undoInfo(openChunk=True)
     try:
         markers = s.markers
         joints = markers.keys()
         with ReSeat(joints):
             for j in joints:
                 m = markers[j]
                 if cmds.objExists(m.marker) and cmds.objExists(j):
                     with Isolate(j):
                         m.setJoint()
                         try:
                             cmds.makeIdentity(
                                 j,
                                 apply=True,
                                 r=True) # Freeze Rotations
                         except RuntimeError:
                             pass
                 else: # User deleted marker / joint. Stop tracking.
                     m.removeMarker()
                     del markers[j]
             cmds.select(sel, r=True)
     except Exception as err:
         raise
     finally:
         cmds.undoInfo(closeChunk=True)
         if err: cmds.undo()
开发者ID:internetimagery,项目名称:twinSkeleton,代码行数:31,代码来源:fixorient.py


示例10: mirror_chain

    def mirror_chain(self, side = None):
        #create one temporary joint at the origin
        tmp_jnt = cmds.joint(position = [0, 0, 0])

        #parent the chain to that joint
        cmds.parent(self.fk_joint_names[0], tmp_jnt)

        #mirror the chain and rename the mirrored side
        if side == 'L':
            self.mirrored_fk_joint_names = cmds.mirrorJoint(self.fk_joint_names[0], mirrorYZ = 1, mirrorBehavior = 1, searchReplace = (side, 'R'))
        elif side == 'l':
            self.mirrored_fk_joint_names = cmds.mirrorJoint(self.fk_joint_names[0], mirrorYZ = 1, mirrorBehavior = 1, searchReplace = (side, 'r'))
        elif side == 'R':
            self.mirrored_fk_joint_names = cmds.mirrorJoint(self.fk_joint_names[0], mirrorYZ = 1, mirrorBehavior = 1, searchReplace = (side, 'L'))
        elif side == 'r':
            self.mirrored_fk_joint_names = cmds.mirrorJoint(self.fk_joint_names[0], mirrorYZ = 1, mirrorBehavior = 1, searchReplace = (side, 'l'))
        else:
            self.mirrored_fk_joint_names = cmds.mirrorJoint(self.fk_joint_names[0], mirrorYZ = 1, mirrorBehavior = 1)

        #unparent the chain and delete the temporary joint
        cmds.parent(self.fk_joint_names[0], self.mirrored_fk_joint_names[0], world = 1)        
        cmds.delete(tmp_jnt)

        cmds.select(clear = 1)        
        return self.mirrored_fk_joint_names
开发者ID:AtonLerin,项目名称:AutoRigger,代码行数:25,代码来源:jointchain.py


示例11: cutSkin

def cutSkin(mesh, weightThreshold=0.25, reducePercent=None, parentShape=False):
    """
    Extract a per influence proxy mesh from a skinned mesh based on influence weights.
    @param mesh: Mesh to extract faces from
    @type mesh: str
    @param weightThreshold: Influence to use to extract faces
    @type weightThreshold: float
    @param reducePercent: Influence to use to extract faces
    @type reducePercent: int or None
    """
    # Initialize
    startTime = cmds.timerX()
    cmds.undoInfo(state=False)

    # Get Skin Info
    skin = glTools.utils.skinCluster.findRelatedSkinCluster(mesh)
    if not skin:
        print('Cut Skin: Mesh "" has no skinCluster! Skipping...')
        return None

    # Prune Weights
    glTools.utils.skinCluster.lockSkinClusterWeights(skin, lock=False, lockAttr=False)
    pruneWts = glTools.utils.mathUtils.distributeValue(10, rangeStart=0.001, rangeEnd=weightThreshold)
    cmds.select(mesh)
    for wt in pruneWts:
        try:
            mel.eval('doPruneSkinClusterWeightsArgList 1 {"' + str(wt) + '"}')
        except Exception, e:
            print('Prune weight FAILED (' + mesh + ')! ' + str(e))
            break
开发者ID:bennymuller,项目名称:glTools,代码行数:30,代码来源:cutSkin.py


示例12: csvWrite

def csvWrite():
    """ This is the path where the csv will be written.  Change this to a path on your local machine. """
    path = "R:/System/CSV_files/armCsv.csv" 
    
    """ Open the csv in maya for writing """
    writer = csv.writer(open(path, 'wb'), delimiter=',')
    
    """ Create a new list based off your selection """
    selectionList = cmds.ls(sl=True)
   
    """ Clear the selection """
    cmds.select(clear=True)
  
    for selection in selectionList:
        """ An empty list to hold both the joint names and the positions """
        jointInfo = []
  
        pos = cmds.xform(selection, q=True, t=True, ws=True)
       
        """ Append the name of the locator and it's position to a new list"""  
        """ I am splitting the positions into seperate variables to make things easier when I try read them later """     
        jointInfo.append(selection)
        jointInfo.append(pos[0])
        jointInfo.append(pos[1])
        jointInfo.append(pos[2])
        """ At this point you could use the joint info to build joints """
        """ Write the data to csv """
        writer.writerow(jointInfo)

    """ Print the joint info so you can see what is happening """
    print jointInfo
开发者ID:griffinanimator,项目名称:GTOOLS,代码行数:31,代码来源:csv_utils.py


示例13: export_static_ogre

def export_static_ogre(*args):
	export_dir = get_export_dir()
	objects = get_objects()
	ogre_mesh_files = []
	if (cmds.file(q=True, sceneName=True)==''):
		print 'Not a valid scene. Try saving it.'
		return False

	if not export_dir:
		print ("Empty Scene? unable to export.")

	else:
		print ('Export Directory:\n  %s\nOgre files\n' % export_dir)
		for ob in objects:
			name = ob
			if cmds.nodeType(ob) == 'transform':
				name = cmds.listRelatives(ob)[0]
			cmds.select(ob, r=True)
			_path = os.path.abspath( export_dir + ('/%s.mesh' % name) )
			ogre_path = _path.replace(os.sep, '/')
			# print ('select %s' % ob)
			print ('     %s' % ogre_path)

			ogre_mesh_files.append(ogre_path)
					  # 'ogreExport -sel -obj -lu mm -scale 1 -mesh \"aaa.mesh\" -shared -v -n -c -t -tangents TANGENT -tangentsplitmirrored;''
			command = 'ogreExport -sel -obj -lu mm -scale 0.1 -mesh \"%s\" -shared -n -c -t -tangents TANGENT -tangentsplitmirrored;' % ogre_path
			mm.eval(command)
		
		cmds.select(objects)
		print 'fixing materials'
		fix_xml_material_names(ogre_mesh_files)
开发者ID:adityavs,项目名称:worldforge_pipeline,代码行数:31,代码来源:wf_pipeline.py


示例14: select_samename_node

def select_samename_node(name):
    sel = cmds.ls(sl=True)
    cmds.select(cl=True)
    sel_hr = cmds.listRelatives(sel, ad=True) + sel
    for node in sel_hr:
        if node.count(name):
            cmds.select(node, add=True)
开发者ID:k0k0c,项目名称:scripts,代码行数:7,代码来源:mayaLgtTmp.py


示例15: _finger_hydraulics

    def _finger_hydraulics(self):
        """Connects the finger hydraulics."""
        for side in ['L', 'R']:
            for finger in ['pointer', 'middle', 'ring']:
                start_jnt = '%s_%sBase_result_%s' % (side, finger, self.nc.joint)
                end_jnt = '%s_%s1_result_%s' % (side, finger, self.nc.joint)

                if finger == 'ring':
                    finger = 'pinky'
                # END if

                start_hydraulic = '%s_%sHydraulicsStart_%s_%s' % (side, finger, self.nc.joint, self.nc.group)
                mid_hydraulic = '%s_%sHydraulicsMid_%s_%s' % (side, finger, self.nc.joint, self.nc.group)
                end_hydraulic = '%s_%sHydraulicsEnd_%s_%s' % (side, finger, self.nc.joint, self.nc.group)

                cmds.select(cl=True)
                start_offset = cmds.group(n='%s_%sBaseOffset_%s' % (side, finger, self.nc.group), empty=True)
                cmds.select(cl=True)
                end_offset = cmds.group(n='%s_%s2Offset_%s' % (side, finger, self.nc.group), empty=True)

                self.c.snap_a_to_b(start_offset, start_hydraulic)
                self.c.snap_a_to_b(end_offset, end_hydraulic)
                cmds.parent(start_offset, start_jnt)
                cmds.parent(end_offset, end_jnt)

                cmds.parent(start_hydraulic, start_offset)
                cmds.parent(end_hydraulic, end_offset)

                try:
                    cmds.parent(mid_hydraulic, '%s_hand_%s' % (side, self.nc.group))
                except Exception as err:
                    print err
开发者ID:jonntd,项目名称:Rigganator,代码行数:32,代码来源:dave.py


示例16: select_node_by_type

def select_node_by_type(nodeType):
    sel = cmds.ls(sl=True, l=True)
    sel_ad = cmds.listRelatives(sel, ad=True, f=True) + sel
    cmds.select(cl=True)
    for node in sel_ad:
        if cmds.nodeType(node) == nodeType:
            cmds.select((cmds.listRelatives(node, p=True)), add=True)
开发者ID:k0k0c,项目名称:scripts,代码行数:7,代码来源:mayaLgtTmp.py


示例17: selectNode

def selectNode():
    """
    Select node from reference edits UI.
    """
    # Get Selected Ref Node
    refNode = cmds.textScrollList('refEdits_refListTSL', q=True, si=True)
    if not refNode: return
    refNS = glTools.utils.reference.getNamespace(refNode[0]) + ':'

    # Get Selected Nodes
    nodeList = cmds.textScrollList('refEdits_nodeListTSL', q=True, si=True)
    if not nodeList: return

    # Select Nodes
    selNodes = []
    for node in nodeList:

        # Check Node
        editNode = node
        if not cmds.objExists(node): node = node.split('|')[-1]
        if not cmds.objExists(node): node = refNS + node
        if not cmds.objExists(node): raise Exception('Reference edit node "' + editNode + '" not found!')

        # Append to Selection List
        selNodes.append(node)

    # Select Node
    if selNodes: cmds.select(selNodes)
开发者ID:bennymuller,项目名称:glTools,代码行数:28,代码来源:removeReferenceEdits.py


示例18: _publish_gpu_for_item

    def _publish_gpu_for_item(self, item, output, work_template, primary_publish_path, sg_task, comment, thumbnail_path, progress_cb):
        """
        Export a gpu cache for the specified item and publish it  to Shotgun.
        """
        group_name = item["name"].strip("|")
        debug(app = None, method = '_publish_gpu_for_item', message = 'group_name: %s' % group_name, verbose = False)
        tank_type = output["tank_type"]
        publish_template = output["publish_template"]        
                
        # get the current scene path and extract fields from it using the work template:
        scene_path = os.path.abspath(cmds.file(query=True, sn= True))
        fields = work_template.get_fields(scene_path)
        publish_version = fields["version"]

        # update fields with the group name:
        fields["grp_name"] = group_name

        ## create the publish path by applying the fields with the publish template:
        publish_path = publish_template.apply_fields(fields)
        #'@asset_root/publish/gpu/{name}[_{grp_name}].v{version}.abc'
        gpuFileName = os.path.splitext(publish_path)[0].split('\\')[-1] 
        fileDir = '/'.join(publish_path.split('\\')[0:-1])
        debug(app = None, method = '_publish_gpu_for_item', message = 'gpuFileName: %s' % gpuFileName, verbose = False)
        
        ## Now fix the shaders
        shd.fixDGForGPU()
        
        if cmds.objExists('CORE_ARCHIVES_hrc'):
            cmds.setAttr('CORE_ARCHIVES_hrc.visiblity', 0)
        
        if cmds.objExists('ROOT_ARCHIVES_DNT_hrc'):
            cmds.setAttr('ROOT_ARCHIVES_DNT_hrc.visiblity', 0)
                                       
        ## build and execute the gpu cache export command for this item:
        try:
            print '====================='
            print 'Exporting gpu now to %s\%s' % (fileDir, gpuFileName)
            #PUT THE FILE EXPORT COMMAND HERE
            cmds.select(clear = True)
            for geo in cmds.listRelatives(group_name, children = True):
                if 'geo_hrc' in geo:
                    geoGroup = str(group_name)
                    debug(app = None, method = '_publish_gpu_for_item', message = 'geoGroup: %s' % geoGroup, verbose = False)
                
            cmds.select(geoGroup)
            
            debug(app = None, method = '_publish_gpu_for_item', message = 'geoGroup: %s' % geoGroup, verbose = False)
            debug(app = None, method = '_publish_gpu_for_item', message = "gpuCache -startTime 1 -endTime 1 -optimize -optimizationThreshold 40000 -directory \"%s\" -fileName %s %s;" % (fileDir, gpuFileName, geoGroup), verbose = False)
            
            mel.eval("gpuCache -startTime 1 -endTime 1 -optimize -optimizationThreshold 40000 -directory \"%s\" -fileName %s %s;" % (fileDir, gpuFileName, geoGroup))

            print 'Finished gpu export...'
            print '====================='
            
            if cmds.objExists('dgSHD'):            
                ## Now reconnect the FileIn nodes
                for key, var in filesDict.items():
                    cmds.connectAttr('%s.outColor' % key, '%s.color' % var)
        except Exception, e:
            raise TankError("Failed to export gpu cache file")
开发者ID:vipul-rathod,项目名称:lsapipeline,代码行数:60,代码来源:maya_asset_secondary_publish.py


示例19: confirmJoints

    def confirmJoints(self):
        """   
        draw joints in locator position
        """

        #- Getting Ball and Toe Location
        self.leftHipPos = cmds.xform('l_hip_Adjust_ctl', q = True, ws = True, t = True)
        self.leftKneePos = cmds.xform('l_knee_Adjust_ctl', q = True, ws = True, t = True)
        self.leftAnklePos = cmds.xform('l_ankle_Adjust_ctl', q = True, ws = True, t = True)
        self.leftBallPos = cmds.xform('l_ball_Adjust_ctl', q = True, ws = True, t = True)
        self.leftToePos = cmds.xform('l_toe_Adjust_ctl', q = True, ws = True, t = True)
        self.leftHeelPos = cmds.xform('l_heel_PivotPosition', q = True, ws = True, t = True)
        self.leftSideInPos = cmds.xform('l_sidein_PivotPosition', q = True, ws = True, t = True)
        self.leftSideOutPos = cmds.xform('l_sideout_PivotPosition', q = True, ws = True, t = True)
        
        #duplicate pivots
        cmds.duplicate('l_heel_PivotPosition', n = 'r_heel_PivotPosition', rr =  True)
        cmds.xform('r_heel_PivotPosition', t = [-self.leftHeelPos[0], self.leftHeelPos[1], self.leftHeelPos[2]])
        cmds.duplicate('l_sidein_PivotPosition', n = 'r_sidein_PivotPosition', rr =  True)
        cmds.xform('r_sidein_PivotPosition', t = [-self.leftSideInPos[0], self.leftSideInPos[1], self.leftSideInPos[2]])
        cmds.duplicate('l_sideout_PivotPosition', n = 'r_sideout_PivotPosition', rr =  True)
        cmds.xform('r_sideout_PivotPosition', t = [-self.leftSideOutPos[0], self.leftSideOutPos[1], self.leftSideOutPos[2]])
        
        cmds.select(cl = True)
        print 'leg Parts : ' , self.legParts
        for elem in self.legElement :
            jointPos = cmds.xform(self.left + elem + '_Adjust_ctl', t = True, q = True, ws = True)
            cmds.joint(n = '%s%s_jnt' %(self.left, elem), p = jointPos)
            
        #- orient joint
        cmds.joint(self.lHipJnt, e = True, oj = 'xzy', secondaryAxisOrient = 'yup', ch = True, zso = True)

        #- delete position locators
        cmds.delete(self.legParts)
开发者ID:darkuress,项目名称:arNew,代码行数:34,代码来源:legSetup.py


示例20: orderedVertsEdgeLoop

 def orderedVertsEdgeLoop(cls):
     """
     #select 2 adjasent vertices ( corner and direction vertex)
     #list vertexes on edge loop( for curves )   
     """
     myVert = cmds.ls( os=1, fl=1 )
     if len(myVert)==2:
         firstVert = myVert[0]
         secondVert = myVert[1]
         
         cmds.select (firstVert,secondVert, r =1)
         mel.eval('ConvertSelectionToContainedEdges')        
         firstEdge = cmds.ls( sl=1 )[0]
         
         cmds.polySelectSp( firstEdge, loop =1 )
         edges = cmds.ls( sl=1, fl=1 )
         edgeDict = cls.getEdgeVertDict(edges) #{edge: [vert1, vert2], ...}
         ordered = [firstVert, secondVert]
         for i in range( len(edges)-2 ):            
             del edgeDict[firstEdge]
             #print edgeDict
             for x, y in edgeDict.iteritems():
                 if secondVert in y:                    
                     xVerts = y
                     xVerts.remove(secondVert)
                     firstEdge = x
         
             secondVert = xVerts[0]
             ordered.append( secondVert )
         return ordered
     
     else:
         print 'select 2 adjasent vertex!!'            
开发者ID:darkuress,项目名称:arFace,代码行数:33,代码来源:Util.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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