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

Python cmds.polySelectConstraint函数代码示例

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

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



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

示例1: selectNsidesFaces

def selectNsidesFaces():
	"""
	Selects nsides faces.
	"""

	cmds.polySelectConstraint(m=3, t=8, sz=3)
	cmds.polySelectConstraint(dis=True)
开发者ID:KelSolaar,项目名称:Snippets,代码行数:7,代码来源:selectionConstraints.py


示例2: _exportMeshes

	def _exportMeshes(self):
		mc.currentTime(mc.playbackOptions(q=True, ast=True))
		
		# export all
		if self.accessMode == MPxFileTranslator.kExportAccessMode:
			meshes = self._getMeshes(mc.ls(typ='mesh'))
			
		# export selection
		elif self.accessMode == MPxFileTranslator.kExportActiveAccessMode:
			transformObjs = mc.ls(sl=1)
			if not len(transformObjs):
				print 'ERROR: Nothing Selected - please select an object and try again'
				raise ThreeJsError('ERROR: Nothing Selected: {0}'.format(self.accessMode))
			meshes = self._getMeshes(transformObjs)
		else:
			raise ThreeJsError('Unsupported access mode: {0}'.format(self.accessMode))
			
		for mesh in meshes:
			#print mesh
			mc.currentTime(mc.playbackOptions(q=True, ast=True))
			
			mc.polySelectConstraint(dis=True)
			mc.select(mesh)
			sel = MSelectionList()
			MGlobal.getActiveSelectionList(sel)
			mDag = MDagPath() 
			mComp = MObject()
			sel.getDagPath(0, mDag, mComp)
			self.gotoBindPose()
			self._exportMesh(mDag, mComp, mesh)
			self._exportBones(mesh,mDag)
开发者ID:jherbst,项目名称:ThreeJsExporter,代码行数:31,代码来源:threeJsFileTranslator2.1.py


示例3: run

def run():
    """Detect overlapping (lamina) faces. Lamina faces are faces that share all of their edges. 
    ---
    Returns True/False, the number of isolated vertices and a list of the isolated vertices
    has_isolatedvertices2() -> (boolean, int, [mesh:v[id],])
    """
    t0 = float(time.time())
    verbose = cmds.optionVar(query='checkmateVerbosity')
    result=False
    # meshes = cmds.ls(type='mesh')
    meshes = [x for x in cmds.ls(typ='mesh', noIntermediate=True) if not cm.tests.shapes.mesh.isEmpty(x)]
    try:
        cmds.select(meshes)
    except TypeError:
    	print "# Warning: No meshes in scene"
    cmds.selectType( pf=True ) 
    cmds.polySelectConstraint(
        mode=3, # all and next
        type=0x0008, # faces
        topology=2, # lamina
        )
    sel=cmds.ls(sl=True, fl=True)
    result =  (len(sel) > 0) or False
    cmds.polySelectConstraint(disable=True)
    try:
        cmds.select(sel)
    except TypeError:
    	pass 
    # print execution time
    print '%-24s : %.6f seconds' % ('f.lamina.run()', (float(time.time())-t0))
    return (result, len(sel), sel)
开发者ID:Kif11,项目名称:turbosquid_maya_publisher,代码行数:31,代码来源:lamina.py


示例4: selectLaminaFaces

def selectLaminaFaces():
	"""
	Selects the lamina faces.
	"""

	cmds.polySelectConstraint(m=3, t=8, tp=2)
	cmds.polySelectConstraint(m=0)
开发者ID:KelSolaar,项目名称:Snippets,代码行数:7,代码来源:selectionConstraints.py


示例5: selectBorderEdges

def selectBorderEdges():
	"""
	Selects the border edges.
	"""

	cmds.polySelectConstraint(m=3, t=0x8000, w=1)
	cmds.polySelectConstraint(m=0)
开发者ID:KelSolaar,项目名称:Snippets,代码行数:7,代码来源:selectionConstraints.py


示例6: selectHardEdges

def selectHardEdges():
	"""
	Selects the hard edges.
	"""

	cmds.polySelectConstraint(m=3, t=0x8000, sm=1)
	cmds.polySelectConstraint(m=0)
开发者ID:KelSolaar,项目名称:Snippets,代码行数:7,代码来源:selectionConstraints.py


示例7: selectNonManifoldVertices

def selectNonManifoldVertices():
	"""
	Selects the non manifold vertices.
	"""

	cmds.polySelectConstraint(m=3, t=1, nonmanifold=True)
	cmds.polySelectConstraint(m=0)
开发者ID:KelSolaar,项目名称:Snippets,代码行数:7,代码来源:selectionConstraints.py


示例8: degenerate

def degenerate():
    """Detect Isolated Vertices. Isolated vertices are vertices that are not 
    connected to another vertex by two edges.
    --
    returns True/False, the number of isolated vertices and a list of the 
    isolated vertices
    has_isolatedvertices() -> (boolean, int, [mesh:v[id],])
    """
    t0 = float(time.time())
    verbose = cmds.optionVar(query='checkmateVerbosity')
    result=False
    # meshes = cmds.ls(type='mesh')
    meshes = [x for x in cmds.ls(typ='mesh', noIntermediate=True) if not cm.tests.shapes.mesh.isEmpty(x)]
    try:
        cmds.select(meshes)
    except TypeError:
    	print "# Warning: No meshes in scene"
    cmds.selectType( pf=True ) 
    cmds.polySelectConstraint(
        mode=3, # all and next
        type=0x0001, # vertices
        where=2, # inside
        order=2, # neighbours
        orderbound=[0,1] # min and max neighbours
        )
    sel=cmds.ls(sl=True, fl=True)
    cmds.polySelectConstraint(disable=True)
    result =  (len(sel) > 0) or False
    print '%-24s : %.6f seconds' % ('isolated.run()', (float(time.time())-t0)) 
    return (result, len(sel), sel)
开发者ID:Kif11,项目名称:turbosquid_maya_publisher,代码行数:30,代码来源:isolated.py


示例9: run

def run():
    """Detect Isolated Vertices. Isolated vertices are the result of deleting 
    edges with Delete rather than with the Delete Edge/Vertex. Using Delete 
    leaves the vertices in place that connected the deleted edge(s). This test 
    ignores vertices on borders, where having such vertices is not a problem.
    ---
    returns True/False, the number of isolated vertices and a list of the 
    isolated vertices
    has_isolatedvertices2() -> (boolean, int, list)
    """
    t0 = float(time.time())
    verbose = cmds.optionVar(query='checkmateVerbosity')
    result=False
    # meshes = cmds.ls(type='mesh')
    meshes = [x for x in cmds.ls(typ='mesh', noIntermediate=True) if not cm.tests.shapes.mesh.isEmpty(x)]
    try:
        cmds.select(meshes)
    except TypeError:
    	print "# Warning: No meshes in scene"
    cmds.selectType( pf=True ) 
    cmds.polySelectConstraint(
        mode=3, # all and next
        type=0x0001, # vertices
        where=2, # inside
        order=2, # neighbours
        orderbound=[2,2] # min and max neighbours
        )
    sel=cmds.ls(sl=True, fl=True)
    cmds.polySelectConstraint(disable=True)
    result =  (len(sel) > 0) or False
    print '%-24s : %.6f seconds' % ('vtx.isolated.run()', (float(time.time())-t0)) 
    return (result, len(sel), sel)
开发者ID:Kif11,项目名称:turbosquid_maya_publisher,代码行数:32,代码来源:isolated.py


示例10: createCurves

def createCurves() :
    
    #get border edges
    cmds.polySelectConstraint(m=3, t=0x8000, w=1)

    borderEdges = cmds.ls(sl=True, fl=True)

    cmds.polySelectConstraint(dis=True)
    
    #create curves
    
    curveList = []
    
    for eachBorder in borderEdges :
        cmds.select(eachBorder, r=True)
        edgeLoopBorder = cmds.pickWalk(d='right', type='edgeloop')
        edgeLoopBorders = cmds.ls(sl=True, fl=True)
        createCurve=mel.eval("polyToCurve -form 0 -degree 1;")
        curveList.append(createCurve[0])
        
        for edgeLo in edgeLoopBorders :
            borderEdges.remove(edgeLo)
        
        cmds.select(createCurve, r=True)
        mel.eval("DeleteHistory;")
        
    for eachCurve in curveList :
        index = curveList.index(eachCurve)
        cutBirailCurves(eachCurve, index)
开发者ID:AndresMWeber,项目名称:aw,代码行数:29,代码来源:marvelousToMaya.py


示例11: selectZeroGeometryAreaFaces

def selectZeroGeometryAreaFaces():
	"""
	Selects the zero geometry area faces.
	"""

	cmds.polySelectConstraint(m=3, t=8, ga=True, gab=(0, 0.001))
	cmds.polySelectConstraint(m=0)
开发者ID:KelSolaar,项目名称:Snippets,代码行数:7,代码来源:selectionConstraints.py


示例12: selectStarVertices

def selectStarVertices():
	"""
	Selects star vertices.
	"""

	cmds.polySelectConstraint(m=3, t=1, order=True, orb=(5, 65535))
	cmds.polySelectConstraint(dis=True)
开发者ID:KelSolaar,项目名称:Snippets,代码行数:7,代码来源:selectionConstraints.py


示例13: run

def run():
    """Detect faces without uvs.  
    ---
    Show associated geometry for missingUVS
    returns True/False, the number of isolated vertices and a list of the isolated vertices
    has_unmappedfaces() -> (boolean, int, [mesh:v[id],])
    """
    t0 = float(time.time())
    verbose = cmds.optionVar(query='checkmateVerbosity')
    result=False
    # meshes = cmds.ls(type='mesh')
    meshes = [x for x in cmds.ls(typ='mesh', noIntermediate=True) if not cm.tests.shapes.mesh.isEmpty(x)]
    try:
        cmds.select(meshes)
    except TypeError:
    	print "# Warning: No meshes in scene"
    cmds.selectType( pf=True ) 
    cmds.polySelectConstraint(
        mode=3, # all and next
        type=0x0008, # faces
        textured=2, # unmapped
        )
    sel=cmds.ls(sl=True, fl=True)
    result =  (len(sel) > 0) or False
    cmds.polySelectConstraint(disable=True)
    try:
        cmds.select(sel)
    except TypeError:
    	pass 
    # print execution time
    print '%-24s : %.6f seconds' % ('uv.missing.run()', (float(time.time())-t0))
    return (result, len(sel), sel)
开发者ID:Kif11,项目名称:turbosquid_maya_publisher,代码行数:32,代码来源:missing.py


示例14: tear_down

    def tear_down(self):
        if self.mode == self.HILITED:
            cmds.polySelectConstraint(disable=True)

        if self.add:
            cmds.select(list(self.old_selection), add=True)
        self.label.close()
开发者ID:arubertoson,项目名称:maya-mamselect,代码行数:7,代码来源:coplanar.py


示例15: selectTrianglesFaces

def selectTrianglesFaces():
	"""
	Selects triangles faces.
	"""

	cmds.polySelectConstraint(m=3, t=8, sz=1)
	cmds.polySelectConstraint(dis=True)
开发者ID:KelSolaar,项目名称:Snippets,代码行数:7,代码来源:selectionConstraints.py


示例16: addShader

def addShader(face, shader):
    cmds.select(face)
    cmds.polySelectConstraint(pp=1)
    selection = cmds.ls(sl=True)
    selection.remove(face)
    faces = selection[0]
    cmds.sets(faces, e=True, forceElement=shader+"SG")
开发者ID:agentqwerty,项目名称:python_scripts,代码行数:7,代码来源:city_builder.py


示例17: expandSelection

def expandSelection():
    '''Expands current component selection to its max bounds'''
    oldSize = len(cmds.filterExpand(sm=[28,29,31,32,33,34,35]))
    while(1):
        cmds.polySelectConstraint(pp=1,t=0x00100)
        newSize = len(cmds.filterExpand(sm=[28,29,31,32,33,34,35]))
        if oldSize == newSize: break
        oldSize = newSize
开发者ID:rocktavious,项目名称:DevToolsLib,代码行数:8,代码来源:mayaUtils.py


示例18: _setup_hilited

 def _setup_hilited(self):
     cmds.polySelectConstraint(
         type=0x0008,
         mode=3,
         orient=1,
         orientbound=[0, self.threshold],
         orientaxis=self.normal
     )
开发者ID:arubertoson,项目名称:maya-mamselect,代码行数:8,代码来源:coplanar.py


示例19: searchConcaveFaces

 def searchConcaveFaces(self, mesh):
     cmds.select(mesh, r=True)
     mel.eval("PolySelectConvert 1")
     cmds.polySelectConstraint(mode=3, convexity=1, type=8)
     cmds.polySelectConstraint(mode=0, convexity=0, type=8)
     concaveFacesList = cmds.ls(sl=True, fl=True, r=True)
     cmds.select(d=True)
     return concaveFacesList
开发者ID:kidintwo3,项目名称:miChecker,代码行数:8,代码来源:command.py


示例20: run

def run(*args, **kwargs):
    """8a. Extra. Find faces with 0 surface area. These look like edges, 
    but cause shading problems  
    ---
    returns True/False, the number of 0 area faces
    and a list of faces.
    has_zeroareafaces -> (boolean, int, [mesh:f[id],])
    """
    t0 = float(time.time())
    valid_kwargs = ['verbose']
    for k, v in kwargs.iteritems():
        if k not in valid_kwargs:
            raise TypeError("Invalid keyword argument %s" % k)  
    result = False
    err = list()
    verbose = False
    # verbose defaults to False if verbose option not set in menu 
    # or specified in cmdline
    try:
        verbose = kwargs['verbose']
    except KeyError:
    	verbose = False
    	if cmds.optionVar(exists='checkmateVerbosity'):
    		verbose = cmds.optionVar(query='checkmateVerbosity')
    else:
        verbose = False
    
    result=False
    meshes = cmds.ls(type='mesh', noIntermediate=True, long=True)
    if verbose: print 'before: ',  meshes
    meshes = [x for x in meshes if not cm.tests.shapes.mesh.isEmpty(x)]
    if verbose: print 'after :', meshes
    try:
        cmds.select(meshes)
    except TypeError:
    	print "# Warning: No meshes in scene"
    if verbose: print 'line 805'	
    cmds.selectType( pf=True ) 
    if verbose: print 'line 807'	
    cmds.polySelectConstraint(
        mode=3, # all and next
        type=0x0008, # faces
        geometricarea=True,
        geometricareabound = [0.0, 0.00001], # zero area
        )
    if verbose: print 'line 814'	
    
    sel=cmds.ls(sl=True, fl=True)
    result =  (len(sel) > 0) or False
    cmds.polySelectConstraint(disable=True)
    try:
        cmds.select(sel)
    except TypeError:
    	pass 
    print '%-24s : %.6f seconds' % ('f.area.run()', (float(time.time())-t0)) 
    return (result, len(sel), sel)
开发者ID:Kif11,项目名称:turbosquid_maya_publisher,代码行数:56,代码来源:area.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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