pymel.core.windows.buttonManip

buttonManip(*args, **kwargs)

This creates a button manipulator. This manipulator has a position in space and a triad manip for positioning. When you click on the top part of the manip, the command defined by the first argument is executed. The command is associated with the manipulator when it is created. If a dag object is included on the command line, the manip will be parented to the object. This means moving the object will move the manip. You can move the manip independently of the object using its triad. Note that a buttonManip may not be parented to more than one object.

Flags:

Long Name / Short Name Argument Types Properties
icon / i unicode ../../../_images/create.gif
  Specify an icon to represent the manipulator. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.buttonManip

Example:

import pymel.core as pm

#    Example 1.
#
#    Create a button manipulator that will be parented to a sphere and will
#    print "Button Manipulator" whenever it is pressed.
#
#    Note that moving the sphere will also move the manipulator.
#
sphere = pm.sphere()
pm.buttonManip( 'print "Button Manipulator"', sphere[0])

#    Example 2.
#
#    Create a button manipulator that will execute the 'setKeyframe' command
#    when it is pressed.
#
pm.buttonManip( 'setKeyframe' )