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

Synopsis

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.

Return value

boolean when in the query mode. none otherwise.

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

Related

currentUnit, displayAffected, displayColor, displayCull, displayLevelOfDetail, displayPref, displayRGBColor, displaySmoothness, displayStats, displaySurface, hide, refresh, showHidden

Flags

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

Python examples

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.