pymel.core.general.snapMode¶
- snapMode(*args, **kwargs)¶
The snapMode command is used to control snapping. It toggles the snapping modes in effect and sets information used for snapping.
Flags:
Long Name / Short Name Argument Types Properties curve / c bool
Set curve snap mode distanceIncrement / dsi float
Set the distance for the snapping to objects such as a lines or planes. edgeMagnet / em int
Number of extra magnets to snap onto, regularly spaced along the edge. edgeMagnetTolerance / emt float
Precision for edge magnet snapping. grid / gr bool
Set grid snap mode liveFaceCenter / lfc bool
While moving on live polygon objects, snap to its face centers. livePoint / lp bool
While moving on live polygon objects, snap to its vertices. meshCenter / mc bool
While moving, snap on the center of the mesh that intersect the line from the camera to the cursor. pixelCenter / pc bool
Snap UV to the center of the pixel instead of the corner. pixelSnap / ps bool
Snap UVs to the nearest pixel center or corner. point / p bool
Set point snap mode tolerance / t int
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 bool
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 int
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 bool
Set view-plane snap mode Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.snapMode
Example:
import pymel.core as pm # Turn curve snapping on pm.snapMode( curve=True ) # Returns true if point snapping is on pm.snapMode( q=True, point=True ) # Result: False #