There are times when its necessary to know if a tool has been activated or deactivated and based on that perform some operation. Each tool has its own specific events that can be handled; for the grabber tool, there are grab and release events. The following code shows how to register callback functions for both events and determine which object is being grabbed:
Note: This section continues with the configuration and script used in the previous section.
Run the script and pick up the different objects. A sequence of color fades is applied to the torus when it is grabbed while a sequence of scale actions is applied to the box and pyramid. When a release event occurs, the action added in the grab callback is removed.