pymel.core.general.hilite

hilite(*args, **kwargs)

Hilites/Unhilites the specified object(s). Hiliting an object makes it possible to select the components of the object. If no objects are specified then the selection list is used.

Flags:

Long Name / Short Name Argument Types Properties
replace / r bool ../../../_images/create.gif
  Hilite the specified objects. Any objects previously hilited will no longer be hilited.
toggle / tgl bool ../../../_images/create.gif
  Toggle the hilite state of the specified objects.
unHilite / u bool ../../../_images/create.gif
  Remove the specified objects from the hilite list. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.hilite

Example:

import pymel.core as pm

#    Create a few objects.
#
sphere = pm.sphere()
pm.move( 0, 0, 3, relative=True )
cone = pm.cone()
pm.move( 0, 0, -3, relative=True )
cylinder = pm.cylinder()

#    Select the sphere.
#
pm.select( sphere, replace=True )

#    Add the cone and cylinder to the hilite list.
#
pm.hilite( cone[0], cylinder[0] )

#    Toggle the hilite state of the cylinder.
#
pm.hilite( cylinder[0], toggle=True )

#    Replace the hilite list with the current selected objects.
#
pm.hilite( replace=True )