Cortex
10.0.0-a4
|
#include <ParameterisedHolderManipContext.h>
Inherits MPxSelectionContext.
Public Types | |
enum | Mode { All, First, Targeted } |
Public Member Functions | |
void | setTarget (MString &plugName) |
MString | getTarget () |
void | setMode (Mode m) |
Sets the Context's mode to one of the above. | |
Mode | getMode () |
virtual void | toolOnSetup (MEvent &event) |
virtual void | toolOffCleanup () |
Static Public Member Functions | |
static void | updateManipulators (void *blindData) |
This Class provides a generic manipulator context, that allows Parameters on any node derived from IECore::ParameterisedHolder to be manipulated.
When a node is in the selection, and this context is used as a tool, the selection is recursively walked for supported dependency/DAG nodes. When one is found, its parameters are traversed, and depending on the mode, one or more manipulators are created.
In order for a parameter to display controls, a suitable manipulator must first be registered. This is done in a way similar to Maya's 'Show Manipulator Tool'. The name of registered manipulator should take the following form:
ie[<manipulatorTypeHint>]<parameterTypeName>ParameterManipulator
The optional manipulatorTypeHint, used for specialisation, is read from the StringData member "manipTypeHint" in the the "UI" CompoundObject of the Parameters userData(), if present.
If the manipulator derives from IECore::ParameterManipulatorContainer then two additional methods are called after creation to specify which parameter the manipulator should target, and wether a label has been specified by the optional StringData member "manipLabel" in the "UI" CompoundObject in the Parameters userData().
Because it may not be desirable to have all manipulatable parameters display, you may set parameter->userData()["UI"]["disableManip"] to BoolData( true ), and the context will skip that Parameter.
The context supports three modes of operation. These can be managed by the ParameterisedHolderManipContextCmd
Mode IECoreMaya::ParameterisedHolderManipContext::getMode | ( | ) |
MString IECoreMaya::ParameterisedHolderManipContext::getTarget | ( | ) |
void IECoreMaya::ParameterisedHolderManipContext::setTarget | ( | MString & | plugName | ) |
Used to set the target plug name for the context when in Targeted mode.
plugName | The Maya attribute name, without the node prefix. This should be the name of the Parameter plug itself, rather than any children. |