pymel.core.general.toggle¶
- toggle(*args, **kwargs)¶
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.
Flags:
Long Name / Short Name Argument Types Properties above / a bool Toggle state for all objects above listed objects. below / b bool Toggle state for all objects below listed objects. boundary / bn bool Toggle boundary display of listed mesh objects. boundingBox / box bool Toggle or query the bounding box display of listed objects. controlVertex / cv bool Toggle CV display of listed curves and surfaces. doNotWrite / dnw bool Toggle the this should be written to the filestate. editPoint / ep bool Toggle edit point display of listed curves and surfaces. extent / et bool Toggle display of extents of listed mesh objects. facet / f bool For use with normalflag. Set the normal display style to facet display. geometry / g bool Toggle geometry display of listed objects. gl / gl bool Toggle state for all objects highPrecisionNurbs / hpn bool Toggle high precision display for Nurbs hull / hl bool Toggle hull display of listed curves and surfaces. latticePoint / lp bool Toggle point display of listed lattices latticeShape / ls bool Toggle display of listed lattices localAxis / la bool Toggle local axis display of listed objects. newCurve / nc bool Set component display state of new curve objects newPolymesh / np bool Set component display state of new polymesh objects newSurface / ns bool Set component display state of new surface objects normal / nr bool Toggle display of normals of listed surface and mesh objects. origin / o bool Toggle origin display of listed surfaces. point / pt bool For use with normal flag. Set the normal display style to vertex display. pointDisplay / pd bool Toggle point display of listed surfaces. pointFacet / pf bool For use with normalflag. Set the normal display style to vertex and face display. rotatePivot / rp bool Toggle rotate pivot display of listed objects. scalePivot / sp bool Toggle scale pivot display of listed objects. selectHandle / sh bool Toggle select handle display of listed objects. state / st bool Explicitly set the state to true or false instead of toggling the state. Can not be queried. surfaceFace / sf bool Toggle surface face handle display of listed surfaces. template / te bool Toggle template state of listed objects uvCoords / uv bool Toggle display uv coords of listed mesh objects. vertex / vt bool Toggle vertex display of listed mesh objects. Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.toggle
Example:
import pymel.core as pm surface1 = pm.sphere() pm.toggle( surface1, cv=True ) pm.toggle( g=True, cv=True ) pm.toggle( q=True, cv=True ) # Result: False # # Returns 0 if the queried state is false. # Returns 1 if the queried state is true.