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 ! |
---|
Create a function setting a value with undo support
Parameter: | dataTypeId – string naming the datatype, like “Bool” - capitalization is important |
---|---|
Note: | if undo is globally disabled, we will resolve to implementing a faster function instead as we do not store the previous value. |
Note: | to use the orinal method without undo, use api.MPlug.setX(your_plug, value) |
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
Note: | overwritten api methods will be renamed to _api_methodname |
---|---|
Note: | currently this method works not recursively |
Epydoc: mrv.maya.nt.apipatch.Abstract
Epydoc: mrv.maya.nt.apipatch.ArrayBase
Bases: mrv.maya.nt.apipatch.Abstract
Base class for all maya arrays to easily fix them
Note: | set _apicls class variable to your api base class |
---|
Returns: | Array created from elements yielded by iter |
---|---|
Note: | this one is less efficient than mfromList as the final length of the array is not predetermined |
Returns: | Array created from the given list of elements |
---|
Returns: | Array created from the given elements |
---|
Epydoc: mrv.maya.nt.apipatch.MAngle
Bases: maya.OpenMaya.MAngle, mrv.maya.nt.apipatch.TimeDistanceAngleBase
Epydoc: mrv.maya.nt.apipatch.MColor
Bases: maya.OpenMaya.MColor, mrv.maya.nt.apipatch.PatchIterablePrimitives
Epydoc: mrv.maya.nt.apipatch.MColorArray
Bases: maya.OpenMaya.MColorArray, mrv.maya.nt.apipatch.ArrayBase
Wrap MColor to make it compatible to pythonic contructs.
Note: | for performance reasons, we do not provide negative index support |
---|
Returns: | Array created from elements yielded by iter |
---|---|
Note: | this one is less efficient than mfromList as the final length of the array is not predetermined |
Returns: | Array created from the given list of elements |
---|
Returns: | Array created from the given elements |
---|
Epydoc: mrv.maya.nt.apipatch.MDistance
Bases: maya.OpenMaya.MDistance, mrv.maya.nt.apipatch.TimeDistanceAngleBase
Epydoc: mrv.maya.nt.apipatch.MDoubleArray
Bases: maya.OpenMaya.MDoubleArray, mrv.maya.nt.apipatch.ArrayBase
Note: | for performance reasons, we do not provide negative index support |
---|
Returns: | Array created from elements yielded by iter |
---|---|
Note: | this one is less efficient than mfromList as the final length of the array is not predetermined |
Returns: | Array created from the given list of elements |
---|
Returns: | Array created from the given elements |
---|
Epydoc: mrv.maya.nt.apipatch.MEulerRotation
Bases: maya.OpenMaya.MEulerRotation, mrv.maya.nt.apipatch.PatchIterablePrimitives
Epydoc: mrv.maya.nt.apipatch.MFloatArray
Bases: maya.OpenMaya.MFloatArray, mrv.maya.nt.apipatch.ArrayBase
Note: | for performance reasons, we do not provide negative index support |
---|
Returns: | Array created from elements yielded by iter |
---|---|
Note: | this one is less efficient than mfromList as the final length of the array is not predetermined |
Returns: | Array created from the given list of elements |
---|
Returns: | Array created from the given elements |
---|
Epydoc: mrv.maya.nt.apipatch.MFloatMatrix
Bases: maya.OpenMaya.MFloatMatrix, mrv.maya.nt.apipatch.PatchMatrix
Epydoc: mrv.maya.nt.apipatch.MFloatPoint
Bases: maya.OpenMaya.MFloatPoint, mrv.maya.nt.apipatch.PatchIterablePrimitives
Epydoc: mrv.maya.nt.apipatch.MFloatPointArray
Bases: maya.OpenMaya.MFloatPointArray, mrv.maya.nt.apipatch.ArrayBase
Wrap MFloatPoint to make it compatible to pythonic contructs.
Note: | for performance reasons, we do not provide negative index support |
---|
Returns: | Array created from elements yielded by iter |
---|---|
Note: | this one is less efficient than mfromList as the final length of the array is not predetermined |
Returns: | Array created from the given list of elements |
---|
Returns: | Array created from the given elements |
---|
Epydoc: mrv.maya.nt.apipatch.MFloatVector
Bases: maya.OpenMaya.MFloatVector, mrv.maya.nt.apipatch.PatchIterablePrimitives
Epydoc: mrv.maya.nt.apipatch.MFloatVectorArray
Bases: maya.OpenMaya.MFloatVectorArray, mrv.maya.nt.apipatch.ArrayBase
Wrap MFloatVector to make it compatible to pythonic contructs.
Note: | for performance reasons, we do not provide negative index support |
---|
Returns: | Array created from elements yielded by iter |
---|---|
Note: | this one is less efficient than mfromList as the final length of the array is not predetermined |
Returns: | Array created from the given list of elements |
---|
Returns: | Array created from the given elements |
---|
Epydoc: mrv.maya.nt.apipatch.MIntArray
Bases: maya.OpenMaya.MIntArray, mrv.maya.nt.apipatch.ArrayBase
Attach additional creator functions
Returns: | Array created from elements yielded by iter |
---|---|
Note: | this one is less efficient than mfromList as the final length of the array is not predetermined |
Returns: | Array created from the given list of elements |
---|
Returns: | Array created from the given elements |
---|
Returns: | An MIntArray initialized with integers ranging from i to j |
---|---|
Parameters: |
|
Epydoc: mrv.maya.nt.apipatch.MItMeshEdge
Bases: maya.OpenMaya.MItMeshEdge, mrv.maya.nt.apipatch.MeshIteratorBase
Epydoc: mrv.maya.nt.apipatch.MItMeshFaceVertex
Bases: maya.OpenMaya.MItMeshFaceVertex, mrv.maya.nt.apipatch.MeshIteratorBase
Epydoc: mrv.maya.nt.apipatch.MItMeshPolygon
Bases: maya.OpenMaya.MItMeshPolygon, mrv.maya.nt.apipatch.MeshIteratorBase
Epydoc: mrv.maya.nt.apipatch.MItMeshVertex
Bases: maya.OpenMaya.MItMeshVertex, mrv.maya.nt.apipatch.MeshIteratorBase
Epydoc: mrv.maya.nt.apipatch.MMatrix
Bases: maya.OpenMaya.MMatrix, mrv.maya.nt.apipatch.PatchMatrix
Epydoc: mrv.maya.nt.apipatch.MObjectArray
Bases: maya.OpenMaya.MObjectArray, mrv.maya.nt.apipatch.ArrayBase
Wrap MObject to make it compatible to pythonic contructs.
Note: | This array also fixes an inherent issue that comes into play when MObjects are returned using __getitem__, as the reference count does not natively get incremented, and the MObjects will be obsolete once the parent-array goes out of scope |
---|---|
Note: | for performance reasons, we do not provide negative index support |
Returns: | Array created from elements yielded by iter |
---|---|
Note: | this one is less efficient than mfromList as the final length of the array is not predetermined |
Returns: | Array created from the given list of elements |
---|
Returns: | Array created from the given elements |
---|
Epydoc: mrv.maya.nt.apipatch.MPlug
Bases: maya.OpenMaya.MPlug
Patch applying mrv specific functionality to the MPlug. These methods will be available through methods with the ‘m’ prefix.
Other methods are overridden to allow more pythonic usage of the MPlug class if and only if it is not specific to mrv.
Additionally it provides aliases for all MPlug methods that are getters, but don’t start with a ‘get’.
Note: | Theoretically the MPlug would satisfy the ‘iDagItem’ interface, but due to the method prefixes, it could not work here as it calls un-prefixed methods only. |
---|
Returns: | number of physical elements in the array, but only if they are not connected. If in doubt, run evaluateNumElements beforehand |
---|---|
Note: | cannot use __len__ as it would break printing of pymel |
Returns: | list of plugs affecting this one |
---|
Returns: | list of plugs affected by this one |
---|
Returns: | our data Mobject wrapped in base.Data |
---|---|
Note: | args and kwagrs have to be provided as MDGContext.fsNormal does not exist in maya 8.5, so we have to hide that fact. |
Returns: | MPlug with the given childname |
---|---|
Raises AttributeError: | |
if no child plug of the appropriate name could be found | |
Raises TypeError: | |
self is not a compound plug |
Returns: | list of intermediate child plugs, [ plug1 , plug2 ] |
---|---|
Parameter: | predicate – return True to include x in result |
Connect multiple source plugs to the same amount of detsination plugs.
Note: | This method provides the most efficient way to connect a large known amount of plugs to each other |
---|---|
Parameters: |
|
Note: | Both iterators need to yield the same total amount of plugs |
Note: | In the current implementation, performance will be hurt if force is specified as each destination has to be checked for a connection in advance |
Connect this plug to the right hand side plug
Parameters: |
|
---|---|
Returns: | destplug allowing chained connections a.connectTo(b).connectTo(c) |
Raises RuntimeError: | |
If destination is already connected and force = False |
Connect self an element of the given arrayplug.
Parameters: |
|
---|---|
Returns: | newly created element plug or the existing one |
Returns: | tuple with input and outputs ( inputPlug, outputPlugs ) |
---|
Disconnect this plug from other plug if they are connected
Parameter: | other – MPlug that will be disconnected from this plug |
---|---|
Returns: | other plug allowing to chain disconnections |
Returns: | list of plugs on this node that this plug affects or is being affected by |
---|---|
Parameter: | by – if false, affected attributplugs will be returned, otherwise the attributeplugs affecting this one |
Note: | you can also use the base.DependNode.dependencyInfo method on the node itself if plugs are not required - this will also be faster |
Note: | have to use MEL :( |
Completely disconnect all inputs and outputs of this plug. The plug will not be connected anymore.
Returns: | self, allowing chained commands |
---|
Disconnect this plug from other plug if they are connected
Parameter: | other – MPlug that will be disconnected from this plug |
---|---|
Returns: | other plug allowing to chain disconnections |
Disconnect the input connection if one exists
Returns: | self, allowing chained commands |
---|
Disconnect this plug from the given node if they are connected
Parameter: | other – Node that will be completely disconnected from this plug |
---|
Disconnect all outgoing connections if they exist
Returns: | self, allowing chained commands |
---|
Returns: | string returning the absolute and fully qualified name of the plug. It might take longer to evaluate but is safe to use if you want to convert the resulting string back to the actual plug |
---|
Returns: | True if lhsplug and rhs plug are connected - the direction does not matter |
---|---|
Note: | equals lhsplug & rhsplug |
Returns: | True if this plug is connected to destination plug ( in that order ) |
---|---|
Note: | return true for self.misConnectedTo(destplug) but false for destplug.misConnectedTo(self) |
Note: | use the mhaveConnection method whether both plugs have a connection no matter which direction |
Note: | use misConnected to find out whether this plug is connected at all |
Returns: | plug being the source of a connection to this plug or a null plug if no such plug exists |
---|
Special handler returning the input plugs of array elements
Returns: | list of plugs connected to the elements of this arrayplug |
---|---|
Note: | if self is not an array, a list with 1 or 0 plugs will be returned |
Returns: | True if this plug is connected to destination plug ( in that order ) |
---|---|
Note: | return true for self.misConnectedTo(destplug) but false for destplug.misConnectedTo(self) |
Note: | use the mhaveConnection method whether both plugs have a connection no matter which direction |
Note: | use misConnected to find out whether this plug is connected at all |
Returns: | graph iterator with self as root, args and kwargs are passed to it.iterGraph. Plugs are returned by default, but this can be specified explicitly using the plug=True kwarg |
---|
Returns: | iterator over the graph starting at this plug in input(upstream) direction. Plugs will be returned by default |
---|---|
Note: | see it.iterGraph for valid args and kwargs |
Returns: | iterator over the graph starting at this plug in output(downstream) direction. Plugs will be returned by default |
---|---|
Note: | see it.iterGraph for valid args and kwargs |
Returns: | index of logical indexed plug that does not yet exist |
---|---|
Note: | as this method does a thorough search, it is relatively slow compared to a simple numPlugs + 1 algorithm |
Note: | only makes sense for array plugs |
Returns: | plug at newly created logical index |
---|---|
Note: | only valid for array plugs |
Returns: | first plug that has this plug as source of a connection, or null plug if no such plug exists. |
---|---|
Note: | convenience method |
Returns: | MPlugArray with all plugs having this plug as source |
---|---|
Todo: | should the method be smarter and deal nicer with complex array or compound plugs ? |
Returns: | parent of this plug or None |
---|---|
Note: | for array plugs, this is the array, for child plugs the actual parent |
Returns: | list of intermediate sub-plugs that are either child plugs or element plugs. Returned list will be empty for leaf-level plugs |
---|---|
Parameter: | predicate – return True to include x in result |
Note: | use this function recursively for easy deep traversal of all combinations of array and compound plugs |
Returns: | Attribute instance of our underlying attribute |
---|
Returns: | wrapped Node of the plugs node |
---|---|
Note: | instance information gets lost this way, the respective instance can be re-retrieved using the instance information on this instanced attribute, if this is an instanced attribute |
Returns: | Attribute instance of our underlying attribute |
---|
Returns: | wrapped Node of the plugs node |
---|---|
Note: | instance information gets lost this way, the respective instance can be re-retrieved using the instance information on this instanced attribute, if this is an instanced attribute |
Epydoc: mrv.maya.nt.apipatch.MPlugArray
Bases: maya.OpenMaya.MPlugArray, mrv.maya.nt.apipatch.ArrayBase
Wrap MPlugArray to make it compatible to pythonic contructs
Note: | for performance reasons, we do not provide negative index support |
---|
Returns: | Array created from elements yielded by iter |
---|---|
Note: | this one is less efficient than mfromList as the final length of the array is not predetermined |
Returns: | Array created from the given list of elements |
---|
Returns: | Array created from the given elements |
---|
Epydoc: mrv.maya.nt.apipatch.MPoint
Bases: maya.OpenMaya.MPoint, mrv.maya.nt.apipatch.PatchIterablePrimitives
Epydoc: mrv.maya.nt.apipatch.MPointArray
Bases: maya.OpenMaya.MPointArray, mrv.maya.nt.apipatch.ArrayBase
Wrap MPoint to make it compatible to pythonic contructs.
Note: | for performance reasons, we do not provide negative index support |
---|
Returns: | Array created from elements yielded by iter |
---|---|
Note: | this one is less efficient than mfromList as the final length of the array is not predetermined |
Returns: | Array created from the given list of elements |
---|
Returns: | Array created from the given elements |
---|
Epydoc: mrv.maya.nt.apipatch.MQuaternion
Bases: maya.OpenMaya.MQuaternion, mrv.maya.nt.apipatch.PatchIterablePrimitives
Epydoc: mrv.maya.nt.apipatch.MSelectionList
Bases: maya.OpenMaya.MSelectionList, mrv.maya.nt.apipatch.ArrayBase
Returns: | MSelectionList as initialized from the given list of tuple( DagNode, Component ), Component can be a filled Component object or null MObject |
---|---|
Parameter: | kwargs – passed to base.toComponentSelectionList |
Returns: | MSelectionList as initialized from the given iterable of Nodes, MObjects, MDagPaths, MPlugs or strings |
---|---|
Parameter: | kwargs – passed to base.toSelectionList |
Returns: | MSelectionList as initialized from the given iterable of Nodes, MObjects, MDagPaths, MPlugs or strings |
---|---|
Parameter: | kwargs – passed to base.toSelectionList |
Returns: | MSelectionList initialized from the given iterable of strings |
---|---|
Parameter: | kwargs – passed to base.toSelectionListFromNames |
Returns: | True if we contain rhs |
---|---|
Note: | As we check for Nodes as well as MayaAPI objects, we are possibly slow |
Returns: | Iterator yielding node, component pairs, component is guaranteed to carry a component, implying that this iterator applies a filter |
---|---|
Parameter: | kwargs – passed on to it.iterSelectionList |
Returns: | Iterator yielding all plugs on this selection list. |
---|---|
Parameter: | kwargs – passed on to it.iterSelectionList |
Returns: | iterator yielding of Nodes and MPlugs stored in this given selection list |
---|---|
Note: | all args and kwargs are passed to it.iterSelectionList |
Returns: | list with the contents of this MSelectionList |
---|---|
Note: | all args and kwargs passed to it.iterSelectionList |
Epydoc: mrv.maya.nt.apipatch.MTime
Bases: maya.OpenMaya.MTime, mrv.maya.nt.apipatch.TimeDistanceAngleBase
Epydoc: mrv.maya.nt.apipatch.MTransformationMatrix
Bases: maya.OpenMaya.MTransformationMatrix, mrv.maya.nt.apipatch.PatchMatrix
Epydoc: mrv.maya.nt.apipatch.MVector
Bases: maya.OpenMaya.MVector, mrv.maya.nt.apipatch.PatchIterablePrimitives
Epydoc: mrv.maya.nt.apipatch.MVectorArray
Bases: maya.OpenMaya.MVectorArray, mrv.maya.nt.apipatch.ArrayBase
Note: | for performance reasons, we do not provide negative index support |
---|
Returns: | Array created from elements yielded by iter |
---|---|
Note: | this one is less efficient than mfromList as the final length of the array is not predetermined |
Returns: | Array created from the given list of elements |
---|
Returns: | Array created from the given elements |
---|
Epydoc: mrv.maya.nt.apipatch.MeshIteratorBase
Bases: mrv.maya.nt.apipatch.Abstract
Provides common functionality for all MItMesh classes
Epydoc: mrv.maya.nt.apipatch.PatchIterablePrimitives
Bases: mrv.maya.nt.apipatch.Abstract
Note: | Classes derived from this base should not be used directly |
---|
Epydoc: mrv.maya.nt.apipatch.PatchMatrix
Bases: mrv.maya.nt.apipatch.Abstract, mrv.maya.nt.apipatch.PatchIterablePrimitives
Only for matrices
Epydoc: mrv.maya.nt.apipatch.TimeDistanceAngleBase
Bases: mrv.maya.nt.apipatch.Abstract
Base patch class for all indicated classes
Note: | idea for patches from pymel |
---|
Bases: mrv.interface.Interface
Describes interface for a DAG item. Its used to unify interfaces allowing to access objects in a dag like graph Of the underlying object has a string representation, the defatult implementation will work natively. Otherwise the getParent and getChildren methods should be overwritten
Note: | a few methods of this class are abstract and need to be overwritten |
---|---|
Note: | this class expects the attribute ‘_sep’ to exist containing the separator at which your object should be split ( for default implementations ). This works as the passed in pointer will belong to derived classes that can define that attribute on instance or on class level |
Returns: | item with separator added to it ( just once ) |
---|---|
Note: | operates best on strings |
Parameters: |
|
Returns: | basename of this path, ‘/hello/world’ -> ‘world’ |
---|
Returns: | list of intermediate children of path, [ child1 , child2 ] |
---|---|
Parameter: | predicate – return True to include x in result |
Note: | the child objects returned are supposed to be valid paths, not just relative paths |
Returns: | list of all children of path, [ child1 , child2 ] |
---|---|
Parameters: |
|
Note: | the child objects returned are supposed to be valid paths, not just relative paths |
Returns: | True if self is a part of other, and thus can be found in other |
---|---|
Note: | operates on strings only |
Returns: | True if this path is the root of the DAG |
---|
Returns: | True other starts with self |
---|---|
Note: | operates on strings |
Note: | we assume other has the same type as self, thus the same separator |
Returns: | generator retrieving all parents up to the root |
---|---|
Parameter: | predicate – returns True for all x that you want to be returned |
Returns: | parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root |
---|
Returns: | all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ] |
---|
Returns: | the root of the DAG - it has no further parents |
---|
Returns: | True if this instance supports the interface of the given type |
---|---|
Parameter: | interface_type – Type of the interface you require this instance to support |
Note: | Must be used in case you only have a weak reference of your interface instance or proxy which is a case where the ordinary isinstance( obj, iInterface ) will not work |