Python API 2.0 Reference
|
Public Member Functions | |
def | __init__ () |
def | addDependentPlug () |
def | addDoubleValue () |
def | addPointValue () |
def | addVectorValue () |
def | colorAndName () |
def | connectPlugToValue () |
def | connectToDependNode () |
def | dependentPlugsReset () |
def | deregisterForMouseMove () |
def | dimmedColor () |
def | doDrag () |
def | doMove () |
def | doPress () |
def | doRelease () |
def | draw () |
def | drawUI () |
def | finishAddingManips () |
def | getDoubleValue () |
def | getPointValue () |
def | getVectorValue () |
def | glActiveName () |
def | glFirstHandle () |
def | labelBackgroundColor () |
def | labelColor () |
def | lineColor () |
def | mainColor () |
def | mouseDown () |
def | mousePosition () |
def | mouseRay () |
def | mouseRayWorld () |
def | mouseUp () |
def | preDrawUI () |
def | prevColor () |
def | registerForMouseMove () |
def | selectedColor () |
def | setDoubleValue () |
def | setHandleColor () |
def | setPointValue () |
def | setVectorValue () |
def | shouldDrawHandleAsSelected () |
def | xColor () |
def | yColor () |
def | zColor () |
Static Public Member Functions | |
def | __new__ () |
def | newManipulator () |
Parent class of all user defined manipulators. Method resolution order: - MPxManipulatorNode - MPxNode - builtins.object
def OpenMayaUI.MPxManipulatorNode.__init__ | ( | ) |
Initialize self. See help(type(self)) for accurate signature.
|
static |
Create and return a new object. See help(type) for accurate signature.
def OpenMayaUI.MPxManipulatorNode.addDependentPlug | ( | ) |
addDependentPlug(plug) -> None This method adds the plug to the list of those to be keyframed. The call to addDependentPlug() should happen prior to the manipulator identifying the plugs to be set. For example, if your manipulator sets plugs based on the selection list or modifier keys you could call addDependentPlug() from your doPress() method. Note that the dependentPlugsReset() method is provided to clear out the list and should be called prior to addDependentPlugs(). * plug (MPlug) - the plug to keyframe when using this manipulator
def OpenMayaUI.MPxManipulatorNode.addDoubleValue | ( | ) |
addDoubleValue(valueName, defaultValue) -> int Manipulators which call connectPlugToValue() must first create the value on the node. Use this method to create a value of double type. Returns the index assigned to this value by Maya. * valueName (string) - Name of the value. * defaultValue (float) - Default value.
def OpenMayaUI.MPxManipulatorNode.addPointValue | ( | ) |
addPointValue(valueName, defaultValue) -> int Manipulators which call connectPlugToValue() must first create the value on the node. Use this method to create a value of MPoint type. Returns the index assigned to this value by Maya. * valueName (string) - Name of the value. * defaultValue (MPoint) - Default value.
def OpenMayaUI.MPxManipulatorNode.addVectorValue | ( | ) |
addVectorValue(valueName, defaultValue) -> int Manipulators which call connectPlugToValue() must first create the value on the node. Use this method to create a value of MVector type. Returns the index assigned to this value by Maya. * valueName (string) - Name of the value. * defaultValue (MVector) - Default value.
def OpenMayaUI.MPxManipulatorNode.colorAndName | ( | ) |
colorAndName(view, glName, glNameIsPickable, colorIndex) -> None This method is used to set the color of the GL component that is being drawn next. It is also used to set GL name of the component so that picking can be supported. * view (M3dView) - the view in which to draw * glName (MGLuint) - GL 'name' (an unsigned int) of the component. Must be unique. * glNameIsPickable (bool) - If true, the component will be pickable * colorIndex (half) - Color to use, as provided by one of the *Color() methods in this class.
def OpenMayaUI.MPxManipulatorNode.connectPlugToValue | ( | ) |
connectPlugToValue(plug, valueIndex) -> int This method is called in the connectToDependNode() virtual if it is implemented for the custom manipulator. It will connect a plug to an already added manipulator value of the same type. Returns a new index for the plug that is being connected. * plug (MPlug) - the plug to connect the value to * valueIndex (int) - the index of the value. index is set by add*Value() method
def OpenMayaUI.MPxManipulatorNode.connectToDependNode | ( | ) |
connectToDependNode(node) -> None This method connects the manipulator to the dependency node. This is a virtual method and needs to be overridden from the plug-in. * node (MObject) - the node to which the manipulator should be connected
def OpenMayaUI.MPxManipulatorNode.dependentPlugsReset | ( | ) |
dependentPlugsReset() -> None This method resets the list of dependent plugs for this manipulator. Call this method prior to adding plugs via addDependentPlug() such as from your doPress() method.
def OpenMayaUI.MPxManipulatorNode.deregisterForMouseMove | ( | ) |
deregisterForMouseMove() -> None This method deregisters this manipulator from receiving mouse move events.
def OpenMayaUI.MPxManipulatorNode.dimmedColor | ( | ) |
dimmedColor() -> half This method returns the color index for a dimmed or unselectable component.
def OpenMayaUI.MPxManipulatorNode.doDrag | ( | ) |
doDrag(view) -> None This method gets called when the manipulator receives a mouse drag event. Returns None if successful. Otherwise, returns MStatus.kUnknownParameter to allow Maya to further process the event. * view (M3dView) - the view in which to draw
def OpenMayaUI.MPxManipulatorNode.doMove | ( | ) |
doMove(view, refresh) -> None This method gets called when the manipulator receives a mouse move event, if the manipulator registered for mouse move events. To register for mouse move events, invoke registerForMouseMove() in the postConstructor of your manipulator. Returns MStatus.kSuccess if successful. Otherwise, returns MStatus.kUnknownParameter to allow Maya to further process the event. * view (M3dView) - the view in which to draw * refresh (bool) - if true, refresh the view on this event. Default is false.
def OpenMayaUI.MPxManipulatorNode.doPress | ( | ) |
doPress(view) -> None This method gets called when the manipulator receives a mouse down event. Returns None if successful. Otherwise, returns MStatus.kUnknownParameter to allow Maya to further process the event. * view (M3dView) - the view in which to draw
def OpenMayaUI.MPxManipulatorNode.doRelease | ( | ) |
doRelease(view) -> None This method gets called when the manipulator receives a mouse release event. Returns None if successful. Otherwise, returns MStatus.kUnknownParameter to allow Maya to further process the event. * view (M3dView) - the view in which to draw
def OpenMayaUI.MPxManipulatorNode.draw | ( | ) |
draw(view, path, style, status) -> None This method is overloaded to draw the manipulators. Selection is also setup with this method using the colorAndName() method call. * view (M3dView) - the view in which to draw * path (MDagPath) - the current path * style (M3dView.DisplayStyle) - the display appearance * status (M3dView.DisplayStatus) - the display status
def OpenMayaUI.MPxManipulatorNode.drawUI | ( | ) |
drawUI(drawManager, frameContext) -> None This is the primary method for drawing the manipulator in Viewport 2.0. All drawing should occur using the MUIDrawManager and any data cached in preDrawUI(). Raw OpenGL calls are not supported and if used behaviour will be undefined. Selection must still be handled in the draw() method, this method is only for display. This method is only called when the manipulator needs to be drawn in Viewport 2.0. This function is empty in this base class. * drawManager (MUIDrawManager) - The MUIDrawManager used to draw some simple UI * frameContext (MFrameContext) - Frame level context information
def OpenMayaUI.MPxManipulatorNode.finishAddingManips | ( | ) |
finishAddingManips() -> None This method should be called from the user-defined manipulator plug-in near the end of the connectToDependNode method so that the converter in the manipulator can be initialized. The converter cannot be initialized until all the connections from the manip values to the plug values have been specified.
def OpenMayaUI.MPxManipulatorNode.getDoubleValue | ( | ) |
getDoubleValue(valueIndex, previousValue) -> float This method is used for getting a floating point value associated with the manipulator. Returns the floating point value * valueIndex (int) - the index of the value to be retrieved * previousValue (bool) - if true, get the previous value. if false, get the current value
def OpenMayaUI.MPxManipulatorNode.getPointValue | ( | ) |
getPointValue(valueIndex, previousValue) -> MPoint This method is used for getting an MPoint value associated with the manipulator. Returns the MPoint value * valueIndex (int) - the index of the value to be retrieved * previousValue (bool) - if true, get the previous value. if false, get the current value
def OpenMayaUI.MPxManipulatorNode.getVectorValue | ( | ) |
getVectorValue(valueIndex, previousValue) -> float This method is used for getting an MVector value associated with the manipulator. Returns the MVector value * valueIndex (int) - the index of the value to be retrieved * previousValue (bool) - if true, get the previous value. if false, get the current value
def OpenMayaUI.MPxManipulatorNode.glActiveName | ( | ) |
glActiveName() -> MGLuint This method returns the unsigned int value which specifies the current active handle. Returns the active handle name.
def OpenMayaUI.MPxManipulatorNode.glFirstHandle | ( | ) |
glFirstHandle() -> MGLuint This method is used to find the unsigned int value that should be used for the first GL handle name. Returns the first handle name.
def OpenMayaUI.MPxManipulatorNode.labelBackgroundColor | ( | ) |
labelBackgroundColor() -> half This method returns the color index of a label background.
def OpenMayaUI.MPxManipulatorNode.labelColor | ( | ) |
labelColor() -> half This method returns the color index of a label.
def OpenMayaUI.MPxManipulatorNode.lineColor | ( | ) |
lineColor() -> half This method returns the color index of a line
def OpenMayaUI.MPxManipulatorNode.mainColor | ( | ) |
mainColor() -> half This method returns the main color index.
def OpenMayaUI.MPxManipulatorNode.mouseDown | ( | ) |
mouseDown() -> (half, half) This method returns the mouse down position within a view. The position is in port coordinates. Returns a tuple consisting of the x and y port coodinates.
def OpenMayaUI.MPxManipulatorNode.mousePosition | ( | ) |
mousePosition() -> (half, half) This method returns the current mouse position within a view. The position is in port coordinates. Returns a tuple consisting of the x and y port coodinates.
def OpenMayaUI.MPxManipulatorNode.mouseRay | ( | ) |
mouseRay() -> (MPoint, MVector) This method returns the location of the mouse within a view. The location is defined by a point and a direction through the point. Both point and direction are in local space. Returns a tuple consisting the local space point and direction.
def OpenMayaUI.MPxManipulatorNode.mouseRayWorld | ( | ) |
mouseRayWorld() -> (MPoint, MVector) This method returns the location of the mouse within a view. The location is defined by a point and a direction through the point. Both point and direction are in world space. Returns a tuple consisting the world space point and direction.
def OpenMayaUI.MPxManipulatorNode.mouseUp | ( | ) |
mouseUp() -> (half, half) This method returns the mouse up position within a view. The position is in port coordinates. Returns a tuple consisting of the x and y port coodinates.
|
static |
newManipulator(manipName) -> (MPxManipulatorNode, MObject) This static function is used to create a user-defined manipulator node. The manipObject argument is set to the new manipulator node. Note that the manipName argument must be the name of a manipulator derived from MPxManipulatorNode. Also note that this method creates the newManipulator but doesn't add it to the DAG. The primary use of this method is in conjunction with MPxSelectionContext.addManipulator, to add user-defined manipulators to a context. Returns a tuple consisting of new MPxManipulatorNode instance, and the manipulator node. * manipName (string) - manipulator name
def OpenMayaUI.MPxManipulatorNode.preDrawUI | ( | ) |
preDrawUI(view) -> None This method is used to setup some drawing data for drawing the manipulator in Viewport 2.0 . The data updated and cached in this function will be used later during 'drawUI()'. This method is only called when the manipulator needs to be drawn in Viewport 2.0. This method need only be overridden if custom data is needed for drawing in drawUI(). If no such data is needed, this method may be left unimplemented. This function is empty in this base class. * view (M3dView) - The view in which to draw
def OpenMayaUI.MPxManipulatorNode.prevColor | ( | ) |
prevColor() -> half This method returns the previously color used by the colorAndName() method.
def OpenMayaUI.MPxManipulatorNode.registerForMouseMove | ( | ) |
registerForMouseMove() -> None This method registers this manipulator to receive mouse move events. When registered, the doMove() function will be invoked on mouse move events.
def OpenMayaUI.MPxManipulatorNode.selectedColor | ( | ) |
selectedColor() -> half This method returns the color index of a selected component.
def OpenMayaUI.MPxManipulatorNode.setDoubleValue | ( | ) |
setDoubleValue(valueIndex, value) -> None This method is used for setting a floating point value associated with the manipulator. * valueIndex (int) - the index of the value to be set * value (float) - the value to set it to
def OpenMayaUI.MPxManipulatorNode.setHandleColor | ( | ) |
setHandleColor(drawManager, handleName, colorIndex) -> None This method is used to set the color of component that is being drawn next. The color will be correctly selected based on the component's state(highlighted, selected, etc.) * drawManager (MUIDrawManager) - The MUIDrawManager used to draw some simple UI * handleName (MGLuint) - The unique name (an unsigned int) of the component. * colorIndex (half) - The default color to use, as provided by one of the *Color() methods in this class. If the component is neither highlighted nor selected, this colorIndex will be used.
def OpenMayaUI.MPxManipulatorNode.setPointValue | ( | ) |
setPointValue(valueIndex, value) -> None This method is used for setting an MPoint value associated with the manipulator. * valueIndex (int) - the index of the value to be set * value (MPoint) - the value to set it to
def OpenMayaUI.MPxManipulatorNode.setVectorValue | ( | ) |
setVectorValue(valueIndex, value) -> None This method is used for setting an MVector value associated with the manipulator. * valueIndex (int) - the index of the value to be set * value (MVector) - the value to set it to
def OpenMayaUI.MPxManipulatorNode.shouldDrawHandleAsSelected | ( | ) |
shouldDrawHandleAsSelected(name) -> bool This function is obsolete, please use 'setHandleColor' instead This method can be used to find out if the handle should be drawn using the selected color instead of the regular one. * name (unsigned int) unique name of the component. Returns true if the handle is active or highlighted.
def OpenMayaUI.MPxManipulatorNode.xColor | ( | ) |
xColor() -> half This method returns the color index of the x axis.
def OpenMayaUI.MPxManipulatorNode.yColor | ( | ) |
yColor() -> half This method returns the color index of the y axis.
def OpenMayaUI.MPxManipulatorNode.zColor | ( | ) |
zColor() -> half This method returns the color index of the z axis.