Go to: Synopsis. Return value. Related. Flags. Python examples.

Synopsis

polySelectConstraint([angle=int], [anglebound=[angle, angle]], [border=boolean], [convexity=int], [crease=boolean], [disable=boolean], [dist=int], [distaxis=[float, float, float]], [distbound=[float, float]], [distpoint=[float, float, float]], [edgeDistance=uint], [geometricarea=int], [geometricareabound=[float, float]], [holes=int], [length=int], [lengthbound=[float, float]], [max2dAngle=float], [max3dAngle=float], [mode=int], [nonmanifold=int], [order=int], [orderbound=[int, int]], [orient=int], [orientaxis=[float, float, float]], [orientbound=[float, float]], [planarity=int], [propagate=int], [random=int], [randomratio=float], [shell=boolean], [size=int], [smoothness=int], [stateString=boolean], [textured=int], [texturedarea=int], [texturedareabound=[float, float]], [textureshared=int], [topology=int], [type=int], [visibility=int], [visibilityangle=angle], [visibilitypoint=[float, float, float]], [where=int], [wholeSensitive=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

polySelectConstraint is undoable, queryable, and NOT editable.

Changes the global polygonal selection constraints.

Return value

None

In query mode, return type is based on queried flag.

Related

polyInstallAction, polyListComponentConversion, polySelectConstraintMonitor

Flags

angle, anglebound, border, convexity, crease, disable, dist, distaxis, distbound, distpoint, edgeDistance, geometricarea, geometricareabound, holes, length, lengthbound, max2dAngle, max3dAngle, mode, nonmanifold, order, orderbound, orient, orientaxis, orientbound, planarity, propagate, random, randomratio, shell, size, smoothness, stateString, textured, texturedarea, texturedareabound, textureshared, topology, type, visibility, visibilityangle, visibilitypoint, where, wholeSensitive
Long name (short name) Argument types Properties
wholeSensitive(ws) boolean createquery
Tells how to select faces : either
by picking anywhere inside the face (if true)
or by picking on the face center marker (if false).
disable(dis) boolean create
Toggles off all 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.
stateString(sts) boolean query
Query only flag. Returns the MEL command that would restore all the current settings.
type(t) int createquery

0x0000(none)
0x0001(vertex)
0x8000(edge)
0x0008(face)
0x0010(texture coordinates)
shell(sh) boolean createquery
If true, selection will be extended to all connected components so that the whole piece of object is selected.
border(bo) boolean createquery
If true, selection will be extended to all connected border components so that the whole "loop" is selected.
crease(cr) boolean createquery
If true, selection will be extended to all connected creased components.
propagate(pp) int createquery
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.
mode(m) int createquery
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.
where(w) int createquery
0(off) 1(on border) 2(inside).
nonmanifold(nm) int createquery
0(off) 1(on)
smoothness(sm) int createquery
0(off) 1(hard) 2(smooth).
max2dAngle(m2a) float create
Maximum angle between two consecutive edges in the 2d tangent plane for "Contiguous Edges" propagate mode.
max3dAngle(m3a) float create
Maximum angle between two consecutive edges in 3d space for "Contiguous Edges" propagate mode.
edgeDistance(ed) uint create
Maximum distance (number of edges) to extend the edge selection for "Contiguous Edges" propagate mode. 0 means to ignore the distance constraint.
size(sz) int createquery
0(off) 1(triangles) 2(quads) 3(nsided).
planarity(p) int createquery
0(off) 1(non planar) 2(planar).
convexity(c) int createquery
0(off) 1(concave) 2(convex).
holes(h) int createquery
0(off) 1(holed) 2(non holed).
textured(tx) int createquery
0(off) 1(mapped) 2(unmapped).
topology(tp) int createquery
0(off) 1(non triangulatable) 2(lamina) 3(non triangulatable and lamina)
length(l) int createquery
0(off) 1(on).
lengthbound(lb) [float, float] createquery
min and max lengths.
angle(a) int createquery
0(off) 1(on).
anglebound(ab) [angle, angle] createquery
min and max angles.
For vertices : angle between the 2 edges owning the vertex.
For edges : angle between the 2 faces owning the edge.
geometricarea(ga) int createquery
0(off) 1(on).
geometricareabound(gab) [float, float] createquery
min and max areas.
texturedarea(ta) int createquery
0(off) 1(Area specified is unsigned) 2(Area specified is signed).
texturedareabound(tab) [float, float] createquery
min and max areas.
textureshared(ts) int createquery
0(off) 1(on). This option will select any uvs on the currentMap which are shared by more than one vertex
dist(d) int createquery
0(off) 1(to point) 2(to axis) 3(to plane).
distbound(db) [float, float] createquery
min and max distances.
distpoint(dp) [float, float, float] createquery
point. (Axis/plane origin in case of distance to axis/plane).
distaxis(da) [float, float, float] createquery
axis. (Normal to the plane in case of distance to plane).
orient(o) int createquery
0(off) 1(orientation) 2(direction).
orientbound(ob) [float, float] createquery
min and max angles.
orientaxis(oa) [float, float, float] createquery
axis.
order(order) int createquery
0(off) 1(on).
orderbound(orb) [int, int] createquery
min and max orders. number of owning edges.
visibility(v) int createquery
0(off) 1(on).
visibilityangle(va) angle createquery
angle [0,360].
visibilitypoint(vp) [float, float, float] createquery
point.
random(r) int createquery
0(off) 1(on).
randomratio(rr) float createquery
ratio [0,1].

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

cmds.selectMode( co=True )

# <b>Propagation</b>

cmds.polyPlane( n='plg', w=5, h=5 )
cmds.delete( 'plg.f[20:29]' )
cmds.selectType( pf=True )
cmds.polySelectConstraint( sh=True ) # next mouse selections will propagate to all shell
cmds.polySelectConstraint( sh=False )
cmds.polySelectConstraint( bo=True ) # next mouse selections will propagate along border
cmds.polySelectConstraint( bo=False )
cmds.polySelectConstraint( cr=True ) # next mouse selections will propagate to all connected creased components
cmds.polySelectConstraint( cr=False )

cmds.select( 'plg.f[54:55]' )
cmds.polySelectConstraint( pp=1 )
cmds.polySelectConstraint( pp=1 ) # to get more and more
cmds.polySelectConstraint( pp=1 )
cmds.polySelectConstraint( pp=2 ) # to get less
cmds.polySelectConstraint( pp=3 ) # to get selection border
cmds.delete( 'plg' )

#<b>Properties</b>

#location
cmds.polyPlane( n='plg', w=5, h=5 )
cmds.selectType( pv=True )
cmds.polySelectConstraint( m=3, t=1, w=1 ) # to get border vertices
cmds.polySelectConstraint( m=3, t=1, w=2 ) # to get inner vertices
cmds.polySelectConstraint( w=0 ) # turn off location constraint
cmds.delete( 'plg' )

#edge smoothness
cmds.polyCylinder( n='plg' )
cmds.selectType( pe=True )
cmds.polySelectConstraint( m=3, t=0x8000, sm=1 ) # to get hard edges
cmds.polySelectConstraint( m=3, t=0x8000, sm=2 ) # to get soft edges
cmds.polySelectConstraint( sm=0 ) # turn off edge smoothness constraint
cmds.delete( 'plg' )

#face size
cmds.polyCylinder( n='plg', sz=1 )
cmds.delete( 'plg.f[40:59]' )
cmds.polyCloseBorder( 'plg.e[27]' )
cmds.selectType( pf=True )
cmds.polySelectConstraint( m=3, t=8, sz=1 ) # to get triangles
cmds.polySelectConstraint( m=3, t=8, sz=2 ) # to get quads
cmds.polySelectConstraint( m=3, t=8, sz=3 ) # to get N-sided
cmds.polySelectConstraint( sz=0 ) # turn off face size constraint
cmds.delete( 'plg' )

#face planarity
#    polyPlane -n plg -w 5 -h 5; polyMoveVertex -ltz 1 plg.vtx[79] plg.vtx[85];
cmds.selectType( pf=True )
cmds.polySelectConstraint( m=3, t=8, p=1 ) # to get non-planar faces
cmds.polySelectConstraint( m=3, t=8, p=2 ) # to get planar faces
cmds.polySelectConstraint( p=0 ) # turn off face planarity constraint
cmds.delete( 'plg' )

#face convexity
cmds.polyPlane( n='plg', w=5, h=5 )
cmds.delete( 'plg.f[51]', 'plg.f[61]', 'plg.f[52:53]' )
cmds.polyCloseBorder( 'plg.e[146]' )
cmds.selectType( pf=True )
cmds.polySelectConstraint( m=3, t=8, c=1 )# to get non-convex faces
cmds.polySelectConstraint( m=3, t=8, c=2 )# to get convex faces
cmds.polySelectConstraint( c=0 )#  turn off face convexity constraint
cmds.delete( 'plg' )

#face holes
cmds.polyCreateFacet( n='plg', p=[(-2, 2, 0), (-2, -2, 0), (2, -2, 0), (2, 2, 0)] )
cmds.polyAppend( a=[2, (6, -2, 0), (6, 2, 0), (), (3, 1, 0), (3, -1, 0), (5, 0, 0)] )
cmds.selectType( pf=True )
cmds.polySelectConstraint( m=3, t=8, h=1 )# to get holed faces
cmds.polySelectConstraint( m=3, t=8, h=2 )# to get non-holed faces
cmds.polySelectConstraint( h=0 )# turn off hole constraint
cmds.delete( 'plg' )

#face mapping
cmds.polyPlane( n='plg', w=5, h=5 )
cmds.polyMapDel( 'plg.f[60:69]' )
cmds.selectType( pf=True )
cmds.polySelectConstraint( m=3, t=8, tx=1 ) # to get mapped faces
cmds.polySelectConstraint( m=3, t=8, tx=2 ) # to get non-mapped faces
cmds.polySelectConstraint( tx=0 ) # turn off face mapping constraint
cmds.delete( 'plg' )

#face topology
cmds.polyCreateFacet( n='plg', p=((-3, 3, 0),(-3, -3, 0),(3, -3, 0),(3, 3, 0)) )
cmds.polyAppend( a= [2, (8, -3, 0), (8, 3, 0)] )
cmds.polyAppend( a= (4, 6, 5 ) )
cmds.polyAppend( a =[0, (-7, 2, 0),(-7, -1, 0),(-8, 2, 0),(-5, 4, 0)] )
cmds.selectType( pf=True)
cmds.polySelectConstraint( m=3, t=8, tp=1 ) # to get non triangulatable faces
cmds.polySelectConstraint( m=3, t=8, tp=2 ) # to get lamina faces
cmds.polySelectConstraint( tp=0 ) # turn off the face topology constraint
cmds.delete( 'plg' )

#<b>Length</b>
cmds.polyCylinder( n='plg', sz=1, h=3 )
cmds.selectType( pe=True )
cmds.polySelectConstraint( m=3, t=0x8000, l=True, lb=(2, 4) ) # to get edges of length 2 to 4 units
cmds.polySelectConstraint( m=3, t=0x8000, l=True, lb=(1, 2) ) # to get edges of length 1 to 2 units
cmds.polySelectConstraint( l=False ) # turn off the length constraint
cmds.delete( 'plg' )

#<b>Angle</b>
cmds.polyCube( n='plg', w=5, h=5, d=5 )
cmds.polyBevel( 'plg.e[7]', sg=1 )
cmds.polyBevel( 'plg.e[9]', sg=3 )
cmds.selectType( pe=True )
cmds.polySelectConstraint( m=3, t=0x8000, a=True, ab=(0, 89) ) # to get edges with angle between 0-89
cmds.polySelectConstraint( m=3, t=0x8000, a=True, ab=(45, 89) ) # to get edges with angle between 45-89
cmds.polySelectConstraint( a=False ) # turn off angle constraint
cmds.delete( 'plg' )

#<b>3D Area</b>
cmds.polyPlane( n='plg', w=5, h=5 )
cmds.polyMoveFacet( 'plg.f[70:79]', ls=(.5, .5, 0) )
cmds.selectType( pf=True )
cmds.polySelectConstraint( m=3, t=8, ga=True, gab=(0, 0.2) ) # to get faces with area between 0 and 0.2
cmds.polySelectConstraint( m=3, t=8, ga=True, gab=(0.2, 0.3) ) # to get faces with area between 0 and 0.2
cmds.polySelectConstraint( ga=False ) # turn off 3D area constraint
cmds.delete( 'plg' )

#<b>2D area</b>
cmds.polyCylinder( n='plg' )
cmds.selectType( pf=True )
cmds.polySelectConstraint( m=3, t=8, ta=True, tab=(0, 0.5) ) # to get face with texture area between 0-0.5
cmds.polySelectConstraint( ta=True ) # turn off the 2D area constraint
cmds.delete( 'plg' )

#<b>Distance</b>
cmds.polyPlane( n='plg', w=5, h=5 )
cmds.selectType( pv=True )
cmds.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
cmds.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
cmds.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
cmds.polySelectConstraint( d=0 )# turn off the distance constraint
cmds.delete( 'plg' )

#<b>Orientation</b>
cmds.polySphere( n='plg' )
cmds.selectType( pv=True' )
cmds.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
cmds.polySelectConstraint( m=3, t=1, o=2, ob=(0, 30), oa=(0, 1, 0) )
cmds.polySelectConstraint( o=0 )# turn off the orintation constraint
cmds.delete( 'plg' )

#<b>Order (Neighbor)</b>
cmds.polyPlane( n='plg', w=5, h=5 )
cmds.selectType( pv=True )
cmds.polySelectConstraint( m=3, t=1, order=True, orb=(0, 2) ) # to get vertices with 0 to 2 neighbors
cmds.polySelectConstraint( order=False ) # turn off the order (neighbor) constraint
cmds.delete( 'plg' )

#<b>Visibility</b>
cmds.polySphere( n='plg' )
cmds.selectType( pv=True )
cmds.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
cmds.polySelectConstraint( v=False ) # turn off the visbility constraint
cmds.delete( 'plg' )

#<b>Random</b>
cmds.polyPlane( n='plg', w=5, h=5 )
cmds.selectType( pv=True )
cmds.polySelectConstraint( m=3, t=1, r=True, rr=.5 )
cmds.polySelectConstraint( r= False ) # turn off the random constraint
cmds.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).