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

Synopsis

polySelectConstraint [-angle int] [-anglePropagation boolean] [-angleTolerance float] [-anglebound angle angle] [-border boolean] [-borderPropagation boolean] [-convexity int] [-crease boolean] [-disable] [-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] [-loopPropagation boolean] [-max2dAngle float] [-max3dAngle float] [-mode int] [-nonmanifold int] [-oppositeEdges boolean] [-order int] [-orderbound int int] [-orient int] [-orientaxis float float float] [-orientbound float float] [-planarity int] [-propagate int] [-random int] [-randomratio float] [-returnSelection boolean] [-ringPropagation boolean] [-shell boolean] [-size int] [-smoothness int] [-stateString] [-textured int] [-texturedarea int] [-texturedareabound float float] [-textureshared int] [-topology int] [-type int] [-uvBorderSelection boolean] [-uvConstraint boolean] [-uvEdgeLoopPropagation boolean] [-uvEdgeRingPropagation boolean] [-uvFaceOrientation int] [-uvShell boolean] [-visibility int] [-visibilityangle angle] [-visibilitypoint float float float] [-where int] [-wholeSensitive boolean]

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, anglePropagation, angleTolerance, anglebound, border, borderPropagation, convexity, crease, disable, dist, distaxis, distbound, distpoint, edgeDistance, geometricarea, geometricareabound, holes, length, lengthbound, loopPropagation, max2dAngle, max3dAngle, mode, nonmanifold, oppositeEdges, order, orderbound, orient, orientaxis, orientbound, planarity, propagate, random, randomratio, returnSelection, ringPropagation, shell, size, smoothness, stateString, textured, texturedarea, texturedareabound, textureshared, topology, type, uvBorderSelection, uvConstraint, uvEdgeLoopPropagation, uvEdgeRingPropagation, uvFaceOrientation, uvShell, visibility, visibilityangle, visibilitypoint, where, wholeSensitive
Long name (short name) Argument types Properties
-angle(-a) int createquery
0(off) 1(on).
-anglePropagation(-ap) boolean createquery
If true, selection will be extended to all connected components whose normal is close to any of the normals of the original selection (see angleTolerance)
-angleTolerance(-at) float createquery
When angle propagation is turned on, this controls what is the maximum difference of the normal vectors where the selection propagates.
-anglebound(-ab) angle angle createquery
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) boolean createquery
Use "-uvConstraint true" to edit/query UV view constraint. If true, selection will be extended to all connected border components so that the whole "loop" is selected. It also removes all nonborder components from the existing selection (compatibility mode)
-borderPropagation(-bp) boolean createquery
If true, selection will be extended to all connected border components so that the whole "loop" is selected.
-convexity(-c) int createquery
0(off) 1(concave) 2(convex).
-crease(-cr) boolean createquery
If true, selection will be extended to all connected creased components.
-disable(-dis) 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.
-dist(-d) int createquery
0(off) 1(to point) 2(to axis) 3(to plane).
-distaxis(-da) float float float createquery
axis. (Normal to the plane in case of distance 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).
-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.
-geometricarea(-ga) int createquery
0(off) 1(on).
-geometricareabound(-gab) float float createquery
min and max areas.
-holes(-h) int createquery
0(off) 1(holed) 2(non holed).
-length(-l) int createquery
0(off) 1(on).
-lengthbound(-lb) float float createquery
min and max lengths.
-loopPropagation(-lp) boolean createquery
If true, edge selection will be extended to a loop.
-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.
-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.
-nonmanifold(-nm) int createquery
0(off) 1(on)
-oppositeEdges(-oe) boolean create
Use the opposite edges
-order(-or) int createquery
0(off) 1(on).
-orderbound(-orb) int int createquery
min and max orders. number of owning edges.
-orient(-o) int createquery
0(off) 1(orientation) 2(direction).
-orientaxis(-oa) float float float createquery
axis.
-orientbound(-ob) float float createquery
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.
-planarity(-p) int createquery
0(off) 1(non planar) 2(planar).
-propagate(-pp) int createquery
0(Off) 1(More) 2(Less) 3(Border) 4(Contiguous Edges) 5(Grow Along Loop) 6(Shrink Along Loop).
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.
Grow Along Loop: Will grow current selection along loop, support face, edge, vertex and UV.
Shrink Along Loop: Will shrink current selection along loop, support face, edge, vertex and UV.
-random(-r) int createquery
0(off) 1(on).
-randomratio(-rr) float createquery
ratio [0,1].
-returnSelection(-rs) boolean create
If true, current selection will not be modified, instead the new selection will be returned as result.
-ringPropagation(-rp) boolean createquery
If true, edge selection will be extended to a ring.
-shell(-sh) boolean createquery
If true, selection will be extended to all connected components so that the whole piece of object is selected.
-size(-sz) int createquery
0(off) 1(triangles) 2(quads) 3(nsided).
-smoothness(-sm) int createquery
0(off) 1(hard) 2(smooth).
-stateString(-sts) query
Query only flag. Returns the MEL command that would restore all the current settings.
-textured(-tx) int createquery
0(off) 1(mapped) 2(unmapped).
-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
-topology(-tp) int createquery
0(off) 1(non triangulatable) 2(lamina) 3(non triangulatable and lamina)
-type(-t) int createquery

0x0000(none)
0x0001(vertex)
0x8000(edge)
0x0008(face)
0x0010(texture coordinates)
-uvBorderSelection(-ubs) boolean createquery
This flag only works on UV view If true, selection will be extended to all UV border components It also removes all components not on UV border from the existing selection
-uvConstraint(-uvc) boolean create
If true, applicable constraint flags will work on UV view.

In query mode, this flag can accept a value.

-uvEdgeLoopPropagation(-ulp) boolean createquery
Use "-uvConstraint true" to edit/query UV view constraint. If true, UV edge selection will be extended to a loop.
-uvEdgeRingPropagation(-urp) boolean createquery
This flag only works on UV view If true, UV edge selection will be extended to a ring.
-uvFaceOrientation(-ufo) int createquery
This flag only works on UV view 0(Off) 1(Front Face) 2(Back Face).
-uvShell(-uv) boolean createquery
If true, selection will be extended to all connected components in UV space
-visibility(-v) int createquery
0(off) 1(on).
-visibilityangle(-va) angle createquery
angle [0,360].
-visibilitypoint(-vp) float float float createquery
point.
-where(-w) int createquery
0(off) 1(on border) 2(inside).
-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).

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 be used more than once in a command.

MEL examples

   selectMode -co;

// <b>Propagation</b>

   polyPlane -n plg -w 5 -h 5; delete plg.f[20:29]; selectType -pf true;
   polySelectConstraint -sh true; // next mouse selections will propagate to all shell
   polySelectConstraint -sh false;
   polySelectConstraint -bo true; // next mouse selections will propagate along border
   polySelectConstraint -bo false;
   polySelectConstraint -cr true; // next mouse selections will propagate to all connected creased components
   polySelectConstraint -cr false;

   select plg.f[54:55]; polySelectConstraint -pp 1;
   polySelectConstraint -pp 1; polySelectConstraint -pp 1; // to get more and more
   polySelectConstraint -pp 2; // to get less
   polySelectConstraint -pp 3; // to get selection border
   delete plg;

//<b>Propagation along loop </b>
	polyPlane -n plg -w 5 -h 5;
	select plg.f[42:43] plg.f[53] plg.f[76];
	polySelectConstraint -pp 5; //grow face selection along loop
	polySelectConstraint -pp 6; //shrink face selection along loop
	delete plg;

	polyPlane -n plg -w 5 -h 5;
	select plg.e[113] plg.e[115:116];
	polySelectConstraint -pp 5; //grow edge selection along loop
	polySelectConstraint -pp 6; //shrink edge selection along loop
	delete plg;

	polyPlane -n plg -w 5 -h 5;
	select plg.vtx[59:61];
	polySelectConstraint -pp 5; //grow vertex selection along loop
	polySelectConstraint -pp 6; //shrink vertex selection along loop
	delete plg;

	polyPlane -n plg -w 5 -h 5;
	select plg.map[71] plg.map[59:60];
	polySelectConstraint -pp 5; // grow UV selection along loop
	polySelectConstraint -pp 6; // shrink UV selection along loop
	delete plg;

//<b>Properties</b>

//location
   polyPlane -n plg -w 5 -h 5; selectType -pv true;
   polySelectConstraint -m 3 -t 1 -w 1; // to get border vertices
   polySelectConstraint -m 3 -t 1 -w 2; // to get inner vertices
   polySelectConstraint -w 0;           // turn off location constraint
   delete plg;

//edge smoothness
   polyCylinder -n plg; selectType -pe true;
   polySelectConstraint -m 3 -t 0x8000 -sm 1; // to get hard edges
   polySelectConstraint -m 3 -t 0x8000 -sm 2; // to get soft edges
   polySelectConstraint -sm 0;                   // turn off edge smoothness constraint
   delete plg;

//face size
   polyCylinder -n plg -sz 1; delete plg.f[40:59]; polyCloseBorder plg.e[27];
   selectType -pf true;
   polySelectConstraint -m 3 -t 8 -sz 1; // to get triangles
   polySelectConstraint -m 3 -t 8 -sz 2; // to get quads
   polySelectConstraint -m 3 -t 8 -sz 3; // to get N-sided
   polySelectConstraint -sz 0;              // turn off face size constraint
   delete plg;

//face planarity
//    polyPlane -n plg -w 5 -h 5; polyMoveVertex -ltz 1 plg.vtx[79] plg.vtx[85];
   selectType -pf true;
   polySelectConstraint -m 3 -t 8 -p 1; // to get non-planar faces
   polySelectConstraint -m 3 -t 8 -p 2; // to get planar faces
   polySelectConstraint -p 0;             // turn off face planarity constraint
   delete plg;

//face convexity
   polyPlane -n plg -w 5 -h 5; delete plg.f[51] plg.f[61] plg.f[52:53];
   polyCloseBorder plg.e[146];    selectType -pf true;
   polySelectConstraint -m 3 -t 8 -c 1; // to get non-convex faces
   polySelectConstraint -m 3 -t 8 -c 2; // to get convex faces
   polySelectConstraint -c 0;             //  turn off face convexity constraint
   delete plg;

//face holes
   polyCreateFacet -n plg -p -2 2 0 -p -2 -2 0 -p 2 -2 0 -p 2 2 0 ;
   polyAppend -ed 2 -p 6 -2 0 -p 6 2 0 -hl -p 3 1 0 -p 3 -1 0 -p 5 0 0 ;
   selectType -pf true;
   polySelectConstraint -m 3 -t 8 -h 1; // to get holed faces
   polySelectConstraint -m 3 -t 8 -h 2; // to get non-holed faces
   polySelectConstraint -h 0;           // turn off hole constraint
   delete plg;

//face mapping
   polyPlane -n plg -w 5 -h 5; polyMapDel plg.f[60:69];
   selectType -pf true;
   polySelectConstraint -m 3 -t 8 -tx 1; // to get mapped faces
   polySelectConstraint -m 3 -t 8 -tx 2; // to get non-mapped faces
   polySelectConstraint -tx 0;              // turn off face mapping constraint
   delete plg;

//face topology
   polyCreateFacet -n plg -p -3 3 0 -p -3 -3 0 -p 3 -3 0 -p 3 3 0 ;
   polyAppend -ed 2 -p 8 -3 0 -p 8 3 0 ;
   polyAppend -ed 4 -ed 6 -ed 5;
   polyAppend -ed 0 -p -7 2 0 -p -7 -1 0 -p -8 2 0 -p -5 4 0 ;
   selectType -pf true;
   polySelectConstraint -m 3 -t 8 -tp 1; // to get non triangulatable faces
   polySelectConstraint -m 3 -t 8 -tp 2; // to get lamina faces
   polySelectConstraint -tp 0;           // turn off the face topology constraint
   delete plg;

//<b>Length</b>
   polyCylinder -n plg -sz 1 -h 3; selectType -pe true;
   polySelectConstraint -m 3 -t 0x8000 -l on -lb 2 4;  // to get edges of length 2 to 4 units
   polySelectConstraint -m 3 -t 0x8000 -l on -lb 1 2;  // to get edges of length 1 to 2 units
   polySelectConstraint -l off;                        // turn off the length constraint
   delete plg;

//<b>Angle</b>
   polyCube -n plg -w 5 -h 5 -d 5; polyBevel -sg 1 plg.e[7];
   polyBevel -sg 3 plg.e[9]; selectType -pe true;
   float $minAngle = 0.0;
   float $maxAngle = 89.0;
   if ("radian" == `currentUnit -q -angle -fullName`)
   {
		$maxAngle = `deg_to_rad $maxAngle`;
   }
   polySelectConstraint -m 3 -t 0x8000 -a on -ab $minAngle $maxnAngle; // to get edges with angle between 0-89

   $minAngle = 45.0;
   $maxAngle = 89.0;
   if ("radian" == `currentUnit -q -angle -fullName`)
   {
		$minAngle = `deg_to_rad $minAngle`;
		$maxAngle = `deg_to_rad $maxAngle`;
   }
   polySelectConstraint -m 3 -t 0x8000 -a on -ab $minAngle $maxnAngle;// to get edges with angle between 45-89
   polySelectConstraint -a off;                        // turn off angle constraint
   delete plg;

//<b>3D Area</b>
   polyPlane -n plg -w 5 -h 5; polyMoveFacet -ls .5 .5 0 plg.f[70:79];
   selectType -pf true;
   polySelectConstraint -m 3 -t 8 -ga on -gab 0 0.2;    // to get faces with area between 0 and 0.2
   polySelectConstraint -m 3 -t 8 -ga on -gab 0.2 0.3;    // to get faces with area between 0 and 0.2
   polySelectConstraint -ga off;                        // turn off 3D area constraint
   delete plg;

//<b>2D area</b>
   polyCylinder -n plg; selectType -pf true;
   polySelectConstraint -m 3 -t 8 -ta on -tab 0 0.5;    // to get face with texture area between 0-0.5
   polySelectConstraint -ta off;                        // turn off the 2D area constraint
   delete plg;

//<b>Distance</b>
   polyPlane -n plg -w 5 -h 5; selectType -pv true;
   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
   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
   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
   polySelectConstraint -d 0;                                // turn off the distance constraint
   delete plg;

//<b>Orientation</b>
   polySphere -n plg; selectType -pv true;
   float $minAngle = 0.0;
   float $maxAngle = 30.0;
   if ("radian" == `currentUnit -q -angle -fullName`)
   {
		$maxAngle = `deg_to_rad $maxAngle`;
   }
    // to get vertices oriented between 0-30 degree to a given axis
   polySelectConstraint -m 3 -t 1 -o 1 -ob $minAngle $maxnAngle -oa 0 1 0;
   polySelectConstraint -m 3 -t 1 -o 2 -ob $minAngle $maxnAngle -oa 0 1 0;
   polySelectConstraint -o 0;                                // turn off the orintation constraint
   delete plg;

//<b>Order (Neighbor)</b>
   polyPlane -n plg -w 5 -h 5; selectType -pv true;
   polySelectConstraint -m 3 -t 1 -or on -orb 0 2;  // to get vertices with 0 to 2 neighbors
   polySelectConstraint -or off;                     // turn off the order (neighbor) constraint
   delete plg;

//<b>Visibility</b>
   polySphere -n plg; selectType -pv true;
   polySelectConstraint -m 3 -t 1 -v on -va 60 -vp 10 0 0 ; // to get vertices in the 60 degree angle
                                                          // from a given point
   polySelectConstraint -v off;                             // turn off the visbility constraint
   delete plg;

//<b>Random</b>
   polyPlane -n plg -w 5 -h 5; selectType -pv true;
   polySelectConstraint -m 3 -t 1 -r on -rr .5;
   polySelectConstraint -r off;                            // turn off the random constraint
   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).