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 ../../../_images/create.gif ../../../_images/query.gif
 
Set curve snap mode
distanceIncrement (dsi) float ../../../_images/create.gif ../../../_images/query.gif
 

Set the distance for the snapping to objects such as a lines or planes.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

edgeMagnet (em) int ../../../_images/create.gif ../../../_images/query.gif
 
Number of extra magnets to snap onto, regularly spaced along the edge.
edgeMagnetTolerance (emt) float ../../../_images/create.gif ../../../_images/query.gif
 
Precision for edge magnet snapping.
grid (gr) bool ../../../_images/create.gif ../../../_images/query.gif
 
Set grid snap mode
liveFaceCenter (lfc) bool ../../../_images/create.gif ../../../_images/query.gif
 
While moving on live polygon objects, snap to its face centers.
livePoint (lp) bool ../../../_images/create.gif ../../../_images/query.gif
 
While moving on live polygon objects, snap to its vertices.
pixelCenter (pc) bool ../../../_images/create.gif ../../../_images/query.gif
 
Snap UV to the center of the pixel instead of the corner.
pixelSnap (ps) bool ../../../_images/create.gif ../../../_images/query.gif
 
Snap UVs to the nearest pixel center or corner.
point (p) bool ../../../_images/create.gif ../../../_images/query.gif
 
Set point snap mode
tolerance (t) int ../../../_images/create.gif ../../../_images/query.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif
 

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).

viewPlane (vp) bool ../../../_images/create.gif ../../../_images/query.gif
 
Set view-plane snap mode

Derived from mel command maya.cmds.snapMode

Example:

import pymel.core as pm

import maya.cmds as cmds

# Turn curve snapping on
pm.snapMode( curve=True )

# Returns true if point snapping is on
pm.snapMode( q=True, point=True )
# Result: False #

Previous topic

pymel.core.general.showHidden

Next topic

pymel.core.general.softSelect

Core

Core Modules

Other Modules

This Page