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

Synopsis

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.

Return value

booleanif command is a query

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

Flags

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 createquery
Set curve snap mode
point(p) boolean createquery
Set point snap mode
grid(gr) boolean createquery
Set grid snap mode
viewPlane(vp) boolean createquery
Set view-plane snap mode
livePoint(lp) boolean createquery
While moving on live polygon objects, snap to its vertices.
liveFaceCenter(lfc) boolean createquery
While moving on live polygon objects, snap to its face centers.
useTolerance(ut) boolean createquery
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.
tolerance(t) uint createquery
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).
uvTolerance(uvt) uint createquery
uvTolerance defines the size of the square region in which points must lie in order to be snapped to, in the UV Texture Editor. The tolerance value is the distance from the cursor position to the boundary of the square (in all four directions).
edgeMagnet(em) uint createquery
Number of extra magnets to snap onto, regularly spaced along the edge.
edgeMagnetTolerance(emt) float createquery
Precision for edge magnet snapping.
pixelCenter(pc) boolean createquery
Snap UV to the center of the pixel instead of the corner.
meshCenter(mc) boolean createquery
While moving, snap on the center of the mesh that intersect the line from the camera to the cursor.
pixelSnap(ps) boolean createquery
Snap UVs to the nearest pixel center or corner.
distanceIncrement(dsi) linear createquery
Set the distance for the snapping to objects such as a lines or planes.

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

# Turn curve snapping on
cmds.snapMode( curve=True )
# Returns true if point snapping is on
cmds.snapMode( q=True, point=True )