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

Synopsis

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.

Return value

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

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.