Go to: Synopsis. Return value. Related.
Flags. Python
examples.
toggle( [objects] , [above=boolean], [below=boolean], [boundary=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, 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 |
state(st) |
boolean |
|
|
Explicitly set the state to true or false instead of toggling
the state. Can not be queried. |
|
geometry(g) |
boolean |
|
|
Toggle geometry display of listed objects. |
|
controlVertex(cv) |
boolean |
|
|
Toggle CV display of listed curves and surfaces. |
|
editPoint(ep) |
boolean |
|
|
Toggle edit point display of listed curves and surfaces. |
|
hull(hl) |
boolean |
|
|
Toggle hull display of listed curves and surfaces. |
|
origin(o) |
boolean |
|
|
Toggle origin display of listed surfaces. |
|
surfaceFace(sf) |
boolean |
|
|
Toggle surface face handle display of listed surfaces. |
|
pointDisplay(pd) |
boolean |
|
|
Toggle point display of listed surfaces. |
|
vertex(vt) |
boolean |
|
|
Toggle vertex display of listed mesh objects. |
|
latticePoint(lp) |
boolean |
|
|
Toggle point display of listed lattices |
|
latticeShape(ls) |
boolean |
|
|
Toggle display of listed lattices |
|
boundary(bn) |
boolean |
|
|
Toggle boundary display of listed mesh objects. |
|
normal(nr) |
boolean |
|
|
Toggle display of normals of listed surface and mesh
objects. |
|
point(pt) |
boolean |
|
|
For use with normal flag. Set the normal display style
to vertex display. |
|
facet(f) |
boolean |
|
|
For use with normal flag. Set the normal display style
to facet display. |
|
pointFacet(pf) |
boolean |
|
|
For use with normal flag. Set the normal display style
to vertex and face display. |
|
extent(et) |
boolean |
|
|
Toggle display of extents of listed mesh objects. |
|
uvCoords(uv) |
boolean |
|
|
Toggle display uv coords of listed mesh objects. |
|
selectHandle(sh) |
boolean |
|
|
Toggle select handle display of listed objects. |
|
rotatePivot(rp) |
boolean |
|
|
Toggle rotate pivot display of listed objects. |
|
scalePivot(sp) |
boolean |
|
|
Toggle scale pivot display of listed objects. |
|
localAxis(la) |
boolean |
|
|
Toggle local axis display of listed objects. |
|
gl(gl) |
boolean |
|
|
Toggle state for all objects |
|
above(a) |
boolean |
|
|
Toggle state for all objects above listed objects. |
|
below(b) |
boolean |
|
|
Toggle state for all objects below listed objects. |
|
template(te) |
boolean |
|
|
Toggle template state of listed objects |
|
doNotWrite(dnw) |
boolean |
|
|
Toggle the "this should be written to the file" state. |
|
newCurve(nc) |
boolean |
|
|
Set component display state of new curve objects |
|
newSurface(ns) |
boolean |
|
|
Set component display state of new surface objects |
|
newPolymesh(np) |
boolean |
|
|
Set component display state of new polymesh objects |
|
highPrecisionNurbs(hpn) |
boolean |
|
|
Toggle high precision display for Nurbs |
|
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.