Changes the global polygonal selection constraints. In query mode, return type is based on queried flag.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
angle (a) | int | ||
|
|||
anglebound (ab) | float, float | ||
min and max angles. The given value should be in the current units that Maya is using. See the examples for how to check the current unit.For vertices : angle between the 2 edges owning the vertex.For edges : angle between the 2 faces owning the edge. |
|||
border (bo) | bool | ||
|
|||
convexity (c) | int | ||
|
|||
crease (cr) | bool | ||
|
|||
disable (dis) | bool | ||
Toggles offall constraints for all component types, but leaves the other constraint parameters.This flag may be used together with other ones toggling some constraints on: if so, all constraints are disabled first (no matter the position of the -disable flag in the command line) then the specified ones are activated. |
|||
dist (d) | int | ||
|
|||
distaxis (da) | float, float, float | ||
|
|||
distbound (db) | float, float | ||
|
|||
distpoint (dp) | float, float, float | ||
|
|||
edgeDistance (ed) | int | ||
|
|||
geometricarea (ga) | int | ||
|
|||
geometricareabound (gab) | float, float | ||
|
|||
holes (h) | int | ||
|
|||
length (l) | int | ||
|
|||
lengthbound (lb) | float, float | ||
|
|||
max2dAngle (m2a) | float | ||
|
|||
max3dAngle (m3a) | float | ||
|
|||
mode (m) | int | ||
0(Off) 1(Next) 2(Current and Next) 3(All and Next).Off : no constraints are used at all.Next : constraints will be used to filter next selections.Current and Next : constraints will be aplied on current selection and then used to filter next selections.All and Next : all items satisfying constraints are selected. |
|||
nonmanifold (nm) | int | ||
|
|||
oppositeEdges (oe) | bool | ||
order (order) | int | ||
|
|||
orderbound (orb) | int, int | ||
|
|||
orient (o) | int | ||
|
|||
orientaxis (oa) | float, float, float | ||
|
|||
orientbound (ob) | float, float | ||
|
|||
planarity (p) | int | ||
|
|||
propagate (pp) | int | ||
0(Off) 1(More) 2(Less) 3(Border) 4(Contiguous Edges).More : will add current selection border to current selection.Less : will remove current selection border from current selection.Border : will keep only current selection border.Contiguous Edges : Add edges aligned with the current edges selected. The direction and number of edges selected is controlled by the -m2a, -m3a, and -ed flags. |
|||
random (r) | int | ||
|
|||
randomratio (rr) | float | ||
|
|||
shell (sh) | bool | ||
|
|||
size (sz) | int | ||
|
|||
smoothness (sm) | int | ||
|
|||
stateString (sts) | bool | ||
|
|||
textured (tx) | int | ||
|
|||
texturedarea (ta) | int | ||
|
|||
texturedareabound (tab) | float, float | ||
|
|||
textureshared (ts) | int | ||
|
|||
topology (tp) | int | ||
|
|||
type (t) | int | ||
|
|||
visibility (v) | int | ||
|
|||
visibilityangle (va) | float | ||
|
|||
visibilitypoint (vp) | float, float, float | ||
|
|||
where (w) | int | ||
|
|||
wholeSensitive (ws) | bool | ||
|
Derived from mel command maya.cmds.polySelectConstraint
Example:
import pymel.core as pm
import maya.cmds as cmds
pm.selectMode( co=True )
# "b"Propagation"/b"
pm.polyPlane( n='plg', w=5, h=5 )
pm.delete( 'plg.f[20:29]' )
pm.selectType( pf=True )
pm.polySelectConstraint( sh=True ) # next mouse selections will propagate to all shell
pm.polySelectConstraint( sh=False )
pm.polySelectConstraint( bo=True ) # next mouse selections will propagate along border
pm.polySelectConstraint( bo=False )
pm.polySelectConstraint( cr=True ) # next mouse selections will propagate to all connected creased components
pm.polySelectConstraint( cr=False )
pm.select( 'plg.f[54:55]' )
pm.polySelectConstraint( pp=1 )
pm.polySelectConstraint( pp=1 ) # to get more and more
pm.polySelectConstraint( pp=1 )
pm.polySelectConstraint( pp=2 ) # to get less
pm.polySelectConstraint( pp=3 ) # to get selection border
pm.delete( 'plg' )
#"b"Properties"/b"
#location
pm.polyPlane( n='plg', w=5, h=5 )
pm.selectType( pv=True )
pm.polySelectConstraint( m=3, t=1, w=1 ) # to get border vertices
pm.polySelectConstraint( m=3, t=1, w=2 ) # to get inner vertices
pm.polySelectConstraint( w=0 ) # turn off location constraint
pm.delete( 'plg' )
#edge smoothness
pm.polyCylinder( n='plg' )
pm.selectType( pe=True )
pm.polySelectConstraint( m=3, t=0x8000, sm=1 ) # to get hard edges
pm.polySelectConstraint( m=3, t=0x8000, sm=2 ) # to get soft edges
pm.polySelectConstraint( sm=0 ) # turn off edge smoothness constraint
pm.delete( 'plg' )
#face size
pm.polyCylinder( n='plg', sz=1 )
pm.delete( 'plg.f[40:59]' )
pm.polyCloseBorder( 'plg.e[27]' )
pm.selectType( pf=True )
pm.polySelectConstraint( m=3, t=8, sz=1 ) # to get triangles
pm.polySelectConstraint( m=3, t=8, sz=2 ) # to get quads
pm.polySelectConstraint( m=3, t=8, sz=3 ) # to get N-sided
pm.polySelectConstraint( sz=0 ) # turn off face size constraint
pm.delete( 'plg' )
#face planarity
# polyPlane -n plg -w 5 -h 5; polyMoveVertex -ltz 1 plg.vtx[79] plg.vtx[85];
pm.selectType( pf=True )
pm.polySelectConstraint( m=3, t=8, p=1 ) # to get non-planar faces
pm.polySelectConstraint( m=3, t=8, p=2 ) # to get planar faces
pm.polySelectConstraint( p=0 ) # turn off face planarity constraint
pm.delete( 'plg' )
#face convexity
pm.polyPlane( n='plg', w=5, h=5 )
pm.delete( 'plg.f[51]', 'plg.f[61]', 'plg.f[52:53]' )
pm.polyCloseBorder( 'plg.e[146]' )
pm.selectType( pf=True )
pm.polySelectConstraint( m=3, t=8, c=1 )# to get non-convex faces
pm.polySelectConstraint( m=3, t=8, c=2 )# to get convex faces
pm.polySelectConstraint( c=0 )# turn off face convexity constraint
pm.delete( 'plg' )
#face holes
pm.polyCreateFacet( n='plg', p=[(-2, 2, 0), (-2, -2, 0), (2, -2, 0), (2, 2, 0)] )
pm.polyAppend( a=[2, (6, -2, 0), (6, 2, 0), (), (3, 1, 0), (3, -1, 0), (5, 0, 0)] )
pm.selectType( pf=True )
pm.polySelectConstraint( m=3, t=8, h=1 )# to get holed faces
pm.polySelectConstraint( m=3, t=8, h=2 )# to get non-holed faces
pm.polySelectConstraint( h=0 )# turn off hole constraint
pm.delete( 'plg' )
#face mapping
pm.polyPlane( n='plg', w=5, h=5 )
pm.polyMapDel( 'plg.f[60:69]' )
pm.selectType( pf=True )
pm.polySelectConstraint( m=3, t=8, tx=1 ) # to get mapped faces
pm.polySelectConstraint( m=3, t=8, tx=2 ) # to get non-mapped faces
pm.polySelectConstraint( tx=0 ) # turn off face mapping constraint
pm.delete( 'plg' )
#face topology
pm.polyCreateFacet( n='plg', p=((-3, 3, 0),(-3, -3, 0),(3, -3, 0),(3, 3, 0)) )
pm.polyAppend( a= [2, (8, -3, 0), (8, 3, 0)] )
pm.polyAppend( a= (4, 6, 5 ) )
pm.polyAppend( a =[0, (-7, 2, 0),(-7, -1, 0),(-8, 2, 0),(-5, 4, 0)] )
pm.selectType( pf=True)
pm.polySelectConstraint( m=3, t=8, tp=1 ) # to get non triangulatable faces
pm.polySelectConstraint( m=3, t=8, tp=2 ) # to get lamina faces
pm.polySelectConstraint( tp=0 ) # turn off the face topology constraint
pm.delete( 'plg' )
#"b"Length"/b"
pm.polyCylinder( n='plg', sz=1, h=3 )
pm.selectType( pe=True )
pm.polySelectConstraint( m=3, t=0x8000, l=True, lb=(2, 4) ) # to get edges of length 2 to 4 units
pm.polySelectConstraint( m=3, t=0x8000, l=True, lb=(1, 2) ) # to get edges of length 1 to 2 units
pm.polySelectConstraint( l=False ) # turn off the length constraint
pm.delete( 'plg' )
#"b"Angle"/b"
pm.polyCube( n='plg', w=5, h=5, d=5 )
pm.polyBevel( 'plg.e[7]', sg=1 )
pm.polyBevel( 'plg.e[9]', sg=3 )
pm.selectType( pe=True )
pm.polySelectConstraint( m=3, t=0x8000, a=True, ab=(0, 89) ) # to get edges with angle between 0-89
pm.polySelectConstraint( m=3, t=0x8000, a=True, ab=(45, 89) ) # to get edges with angle between 45-89
pm.polySelectConstraint( a=False ) # turn off angle constraint
pm.delete( 'plg' )
#"b"3D Area"/b"
pm.polyPlane( n='plg', w=5, h=5 )
pm.polyMoveFacet( 'plg.f[70:79]', ls=(.5, .5, 0) )
pm.selectType( pf=True )
pm.polySelectConstraint( m=3, t=8, ga=True, gab=(0, 0.2) ) # to get faces with area between 0 and 0.2
pm.polySelectConstraint( m=3, t=8, ga=True, gab=(0.2, 0.3) ) # to get faces with area between 0 and 0.2
pm.polySelectConstraint( ga=False ) # turn off 3D area constraint
pm.delete( 'plg' )
#"b"2D area"/b"
pm.polyCylinder( n='plg' )
pm.selectType( pf=True )
pm.polySelectConstraint( m=3, t=8, ta=True, tab=(0, 0.5) ) # to get face with texture area between 0-0.5
pm.polySelectConstraint( ta=True ) # turn off the 2D area constraint
pm.delete( 'plg' )
#"b"Distance"/b"
pm.polyPlane( n='plg', w=5, h=5 )
pm.selectType( pv=True )
pm.polySelectConstraint( m=3, t=1, d=1, db=(0, 5), dp=(5, 0, 0) ) # to get vertices located
# between 0-5 units from a given point
pm.polySelectConstraint( m=3, t=1, d=1, db=(5, 5), dp=(5, 0, 0) ) # to get vertices located
# at exactly 5 units from a given point
pm.polySelectConstraint( m=3, t=1, d=2, db=(5, 6), dp=(5, 0, 0) ) # to get vertices located
# between 5-6 units from a given axis
pm.polySelectConstraint( d=0 )# turn off the distance constraint
pm.delete( 'plg' )
#"b"Orientation"/b"
pm.polySphere( n='plg' )
pm.selectType( pv=True' )
pm.polySelectConstraint( m=3, t=1, o=1, ob=(0, 30), oa=(0, 1, 0) )# to get vertices oriented between
# 0-30 degree to a given axis
pm.polySelectConstraint( m=3, t=1, o=2, ob=(0, 30), oa=(0, 1, 0) )
pm.polySelectConstraint( o=0 )# turn off the orintation constraint
pm.delete( 'plg' )
#"b"Order (Neighbor)"/b"
pm.polyPlane( n='plg', w=5, h=5 )
pm.selectType( pv=True )
pm.polySelectConstraint( m=3, t=1, order=True, orb=(0, 2) ) # to get vertices with 0 to 2 neighbors
pm.polySelectConstraint( order=False ) # turn off the order (neighbor) constraint
pm.delete( 'plg' )
#"b"Visibility"/b"
pm.polySphere( n='plg' )
pm.selectType( pv=True )
pm.polySelectConstraint( m=3, t=1, v=True, va=60, vp=(10, 0, 0) ) # to get vertices in the 60 degree angle from a given point
pm.polySelectConstraint( v=False ) # turn off the visbility constraint
pm.delete( 'plg' )
#"b"Random"/b"
pm.polyPlane( n='plg', w=5, h=5 )
pm.selectType( pv=True )
pm.polySelectConstraint( m=3, t=1, r=True, rr=.5 )
pm.polySelectConstraint( r= False ) # turn off the random constraint
pm.delete( 'plg' )
# NOTE: Make sure you turn off the constraint you have used. Otherwise it may
# affect your next selection (if "i"mode"/i" flag is ON).