Package mrv :: Package maya :: Package nt :: Module apipatch
[hide private]
[frames] | no frames]

Module apipatch

source code

Contains patch classes that are altering their respective api classes

The classes here are rather verbose and used as patch-template which can be handled correctly by epydoc, and whose method will be used to patch the respective api classes.

As they are usually derived from the class they patch , they could also be used directly


Note: never import classes directly in here, import the module instead, thus not: thisImportedClass but: module.thisImportedClass !

Classes [hide private]
  Abstract
Class flagging that subclasses should be abstract and are only to be used as superclass
    Primitive Types
  TimeDistanceAngleBase
Base patch class for all indicated classes
  MTime
  MDistance
  MAngle
  PatchIterablePrimitives
  PatchMatrix
Only for matrices
  MVector
  MFloatVector
  MPoint
  MFloatPoint
  MColor
  MQuaternion
  MEulerRotation
  MMatrix
  MFloatMatrix
  MTransformationMatrix
    Basic Types
  MPlug
Patch applying mrv specific functionality to the MPlug.
    Arrays
  ArrayBase
Base class for all maya arrays to easily fix them
  MPlugArray
Wrap MPlugArray to make it compatible to pythonic contructs
  MObjectArray
Wrap MObject to make it compatible to pythonic contructs.
  MColorArray
Wrap MColor to make it compatible to pythonic contructs.
  MPointArray
Wrap MPoint to make it compatible to pythonic contructs.
  MFloatVectorArray
Wrap MFloatVector to make it compatible to pythonic contructs.
  MVectorArray
  MFloatPointArray
Wrap MFloatPoint to make it compatible to pythonic contructs.
  MDoubleArray
  MFloatArray
  MIntArray
Attach additional creator functions
  MSelectionList
  MeshIteratorBase
Provides common functionality for all MItMesh classes
  MItMeshVertex
  MItMeshEdge
  MItMeshPolygon
  MItMeshFaceVertex
Functions [hide private]
 
init_applyPatches()
Called by package __init__ method to finally apply the patch according to the template classes Template classes must derive from the to-be-patched api class first, and can derive from helper classes providing basic patch methods.
source code
 
__getattribute__(self, attr)
Get attribute for MPlug which will raise if a setX method is used.
source code
    Basic Types
 
_mplug_createUndoSetFunc(dataTypeId, getattroverride=None)
Create a function setting a value with undo support
source code
Variables [hide private]
    Arrays
  _plugarray_getitem = api.MPlugArray.__getitem__
  _objectarray_getitem = api.MObjectArray.__getitem__
  _colorarray_getitem = api.MColorArray.__getitem__
  _pointarray_getitem = api.MPointArray.__getitem__
  _floatpointarray_getitem = api.MFloatPointArray.__getitem__
  _doublearray_getitem = api.MDoubleArray.__getitem__
  _floatarray_getitem = api.MFloatArray.__getitem__
  _floatvectorarray_getitem = api.MFloatVectorArray.__getitem__
  _vectorarray_getitem = api.MVectorArray.__getitem__
Function Details [hide private]

init_applyPatches()

source code 

Called by package __init__ method to finally apply the patch according to the template classes Template classes must derive from the to-be-patched api class first, and can derive from helper classes providing basic patch methods. Helper classes must derive from Abstract to indicate their purpose

If a class has an _applyPatch method, it will be called and not additional. If it returns True, the class members will be applied as usual, if False the method will stop

Notes:
  • overwritten api methods will be renamed to _api_methodname
  • currently this method works not recursively

_mplug_createUndoSetFunc(dataTypeId, getattroverride=None)

source code 
Create a function setting a value with undo support
Parameters:
  • dataTypeId - string naming the datatype, like "Bool" - capitalization is important
Notes:
  • if undo is globally disabled, we will resolve to implementing a faster function instead as we do not store the previous value.
  • to use the orinal method without undo, use api.MPlug.setX(your_plug, value)

__getattribute__(self, attr)

source code 
Get attribute for MPlug which will raise if a setX method is used. This could cause undo bugs that you'd better catch before they hit the user