Go to: Synopsis. Return value. Flags. Python examples.
snapMode([curve=boolean], [distanceIncrement=linear], [edgeMagnet=uint], [edgeMagnetTolerance=float], [grid=boolean], [liveFaceCenter=boolean], [livePoint=boolean], [meshCenter=boolean], [pixelCenter=boolean], [pixelSnap=boolean], [point=boolean], [tolerance=uint], [useTolerance=boolean], [uvTolerance=uint], [viewPlane=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
snapMode is undoable, queryable, and NOT editable.
The snapMode command is used to control snapping. It toggles the
snapping modes in effect and sets information used for snapping.
boolean | if command is a query |
In query mode, return type is based on queried flag.
curve, distanceIncrement, edgeMagnet, edgeMagnetTolerance, grid, liveFaceCenter, livePoint, meshCenter, pixelCenter, pixelSnap, point, tolerance, useTolerance, uvTolerance, viewPlane
Long name (short name) |
Argument types |
Properties |
|
curve(c)
|
boolean
|
|
|
distanceIncrement(dsi)
|
linear
|
|
|
Set the distance for the snapping to objects such as a lines or planes.
|
|
edgeMagnet(em)
|
uint
|
|
|
Number of extra magnets to snap onto, regularly spaced
along the edge.
|
|
edgeMagnetTolerance(emt)
|
float
|
|
|
Precision for edge magnet snapping.
|
|
grid(gr)
|
boolean
|
|
|
liveFaceCenter(lfc)
|
boolean
|
|
|
While moving on live polygon objects, snap to its
face centers.
|
|
livePoint(lp)
|
boolean
|
|
|
While moving on live polygon objects, snap to its
vertices.
|
|
meshCenter(mc)
|
boolean
|
|
|
While moving, snap on the center of the mesh that intersect the line from the camera to the cursor.
|
|
pixelCenter(pc)
|
boolean
|
|
|
Snap UV to the center of the pixel instead of the corner.
|
|
pixelSnap(ps)
|
boolean
|
|
|
Snap UVs to the nearest pixel center or corner.
|
|
point(p)
|
boolean
|
|
|
tolerance(t)
|
uint
|
|
|
Tolerance defines the size of the square region
in which points must lie in order to be snapped to. The
tolerance value is the distance from the cursor position
to the boundary of the square (in all four directions).
|
|
useTolerance(ut)
|
boolean
|
|
|
If useTolerance is set, then point snapping
is limited to points that are within a square region
surrounding the cursor position. The size of the square
is determined by the tolerance value.
|
|
uvTolerance(uvt)
|
uint
|
|
|
uvTolerance defines the size of the square region
in which points must lie in order to be snapped to, in the
UV Editor. The tolerance value is the distance
from the cursor position to the boundary of the square
(in all four directions).
|
|
viewPlane(vp)
|
boolean
|
|
|
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.
|
import maya.cmds as cmds
# Turn curve snapping on
cmds.snapMode( curve=True )
# Returns true if point snapping is on
cmds.snapMode( q=True, point=True )