本文整理汇总了Python中maya.cmds.polySelectConstraint函数的典型用法代码示例。如果您正苦于以下问题:Python polySelectConstraint函数的具体用法?Python polySelectConstraint怎么用?Python polySelectConstraint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了polySelectConstraint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: selectNsidesFaces
def selectNsidesFaces():
"""
Selects nsides faces.
"""
cmds.polySelectConstraint(m=3, t=8, sz=3)
cmds.polySelectConstraint(dis=True)
示例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)
示例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)
示例4: selectLaminaFaces
def selectLaminaFaces():
"""
Selects the lamina faces.
"""
cmds.polySelectConstraint(m=3, t=8, tp=2)
cmds.polySelectConstraint(m=0)
示例5: selectBorderEdges
def selectBorderEdges():
"""
Selects the border edges.
"""
cmds.polySelectConstraint(m=3, t=0x8000, w=1)
cmds.polySelectConstraint(m=0)
示例6: selectHardEdges
def selectHardEdges():
"""
Selects the hard edges.
"""
cmds.polySelectConstraint(m=3, t=0x8000, sm=1)
cmds.polySelectConstraint(m=0)
示例7: selectNonManifoldVertices
def selectNonManifoldVertices():
"""
Selects the non manifold vertices.
"""
cmds.polySelectConstraint(m=3, t=1, nonmanifold=True)
cmds.polySelectConstraint(m=0)
示例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)
示例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)
示例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)
示例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)
示例12: selectStarVertices
def selectStarVertices():
"""
Selects star vertices.
"""
cmds.polySelectConstraint(m=3, t=1, order=True, orb=(5, 65535))
cmds.polySelectConstraint(dis=True)
示例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)
示例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()
示例15: selectTrianglesFaces
def selectTrianglesFaces():
"""
Selects triangles faces.
"""
cmds.polySelectConstraint(m=3, t=8, sz=1)
cmds.polySelectConstraint(dis=True)