Go to: Synopsis. Return value. Related. Flags. Python examples.
toggle(
[objects]
, [above=boolean], [below=boolean], [boundary=boolean], [boundingBox=boolean], [controlVertex=boolean], [doNotWrite=boolean], [editPoint=boolean], [extent=boolean], [facet=boolean], [geometry=boolean], [gl=boolean], [highPrecisionNurbs=boolean], [hull=boolean], [latticePoint=boolean], [latticeShape=boolean], [localAxis=boolean], [newCurve=boolean], [newPolymesh=boolean], [newSurface=boolean], [normal=boolean], [origin=boolean], [point=boolean], [pointDisplay=boolean], [pointFacet=boolean], [rotatePivot=boolean], [scalePivot=boolean], [selectHandle=boolean], [state=boolean], [surfaceFace=boolean], [template=boolean], [uvCoords=boolean], [vertex=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
toggle is undoable, queryable, and NOT editable.
The toggle command is used to toggle the display of various
object features for objects which have these components. For
example, CV and edit point display may be toggled for those
listed NURB curves or surfaces.
Note: This command is not undoable.
boolean | when in the query mode. none otherwise. |
In query mode, return type is based on queried flag.
currentUnit, displayAffected, displayColor, displayCull, displayLevelOfDetail, displayPref, displayRGBColor, displaySmoothness, displayStats, displaySurface, hide, refresh, showHidden
above, below, boundary, boundingBox, controlVertex, doNotWrite, editPoint, extent, facet, geometry, gl, highPrecisionNurbs, hull, latticePoint, latticeShape, localAxis, newCurve, newPolymesh, newSurface, normal, origin, point, pointDisplay, pointFacet, rotatePivot, scalePivot, selectHandle, state, surfaceFace, template, uvCoords, vertex
Long name (short name) |
Argument types |
Properties |
|
above(a)
|
boolean
|
|
|
Toggle state for all objects above listed objects.
|
|
below(b)
|
boolean
|
|
|
Toggle state for all objects below listed objects.
|
|
boundary(bn)
|
boolean
|
|
|
Toggle boundary display of listed mesh objects.
|
|
boundingBox(box)
|
boolean
|
|
|
Toggle or query the bounding box display of listed objects.
|
|
controlVertex(cv)
|
boolean
|
|
|
Toggle CV display of listed curves and surfaces.
|
|
doNotWrite(dnw)
|
boolean
|
|
|
Toggle the "this should be written to the file" state.
|
|
editPoint(ep)
|
boolean
|
|
|
Toggle edit point display of listed curves and surfaces.
|
|
extent(et)
|
boolean
|
|
|
Toggle display of extents of listed mesh objects.
|
|
facet(f)
|
boolean
|
|
|
For use with normal flag. Set the normal display style to facet display.
|
|
geometry(g)
|
boolean
|
|
|
Toggle geometry display of listed objects.
|
|
gl(gl)
|
boolean
|
|
|
Toggle state for all objects
|
|
highPrecisionNurbs(hpn)
|
boolean
|
|
|
Toggle high precision display for Nurbs
|
|
hull(hl)
|
boolean
|
|
|
Toggle hull display of listed curves and surfaces.
|
|
latticePoint(lp)
|
boolean
|
|
|
Toggle point display of listed lattices
|
|
latticeShape(ls)
|
boolean
|
|
|
Toggle display of listed lattices
|
|
localAxis(la)
|
boolean
|
|
|
Toggle local axis display of listed objects.
|
|
newCurve(nc)
|
boolean
|
|
|
Set component display state of new curve objects
|
|
newPolymesh(np)
|
boolean
|
|
|
Set component display state of new polymesh objects
|
|
newSurface(ns)
|
boolean
|
|
|
Set component display state of new surface objects
|
|
normal(nr)
|
boolean
|
|
|
Toggle display of normals of listed surface and mesh objects.
|
|
origin(o)
|
boolean
|
|
|
Toggle origin display of listed surfaces.
|
|
point(pt)
|
boolean
|
|
|
For use with normal flag. Set the normal display style to vertex display.
|
|
pointDisplay(pd)
|
boolean
|
|
|
Toggle point display of listed surfaces.
|
|
pointFacet(pf)
|
boolean
|
|
|
For use with normal flag. Set the normal display style to vertex and face display.
|
|
rotatePivot(rp)
|
boolean
|
|
|
Toggle rotate pivot display of listed objects.
|
|
scalePivot(sp)
|
boolean
|
|
|
Toggle scale pivot display of listed objects.
|
|
selectHandle(sh)
|
boolean
|
|
|
Toggle select handle display of listed objects.
|
|
state(st)
|
boolean
|
|
|
Explicitly set the state to true or false instead of toggling the state.
Can not be queried.
|
|
surfaceFace(sf)
|
boolean
|
|
|
Toggle surface face handle display of listed surfaces.
|
|
template(te)
|
boolean
|
|
|
Toggle template state of listed objects
|
|
uvCoords(uv)
|
boolean
|
|
|
Toggle display uv coords of listed mesh objects.
|
|
vertex(vt)
|
boolean
|
|
|
Toggle vertex display of listed mesh objects.
|
|
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
surface1 = cmds.sphere()
cmds.toggle( surface1, cv=True )
cmds.toggle( g=True, cv=True )
cmds.toggle( q=True, cv=True )
# Returns 0 if the queried state is false.
# Returns 1 if the queried state is true.