Provides classes and functions operating on the MayaAPI class database
note: | This module must not be auto-initialized as it assumes its parent package to be present already |
---|---|
note: | The implementation is considered internal and may change any time unless stated otherwise. |
Returns iterator which yield tuple(nodeTypeName, MObject, modifier) triplets of nodeTypes, with an MObjects instance of it, created with the given modifier, one for each node type available to maya.
Note: | skips manipulators as they tend to crash maya on creation ( perhaps its only one which does that, but its not that important ) |
---|
Returns: | tuple of api modules containing MayaAPI classes |
---|---|
Note: | This takes a moment to load as it will import many api modules. Delay the call as much as possible |
Return path to cache file from which you would initialize data structures
Parameter: | use_version – if true, the maya version will be appended to the filename |
---|
Parse a file associating node type names with the best compatible MFn function set and return a dictionary with the data
Returns: | dict(((nodeTypeNameStr : api.MFnCls), ...)) dictionary with nodetypeName MFn class mapping |
---|
Generate the node-hierarchy for the current version based on all node types which can be created in maya.
Returns: | tuple(DAGTree, typeToMFnClsNameList)
|
---|---|
Note: | should only be run as part of the upgrade process to prepare MRV for a new maya release. Otherwise the nodetype tree will be read from a cache |
Returns: | True if the given mfncls has at least one enumeration |
---|
Returns: | Path to file containing the c++ header of the given apiclass’ name. The file will not be verified, hence it may be inaccessible |
---|---|
Parameter: | apiname – string name, like ‘MFnBase’ |
Raises ValueError: | |
if MAYA_LOCATION is not set |
Returns: | A path instance of the correct type |
---|---|
Note: | use this constructor if you use the Path.set_separator method at runtime to assure you will always create instances of the actual type, and not only of the type you imported last |
Returns: | Path to the node hierarchy file of the currently active maya version |
---|
Create a simple Memberlist of available mfn classes and their members to allow a simple human-editable way of adjusting which methods will be added to the Nodes.
Note: | currently writes information about all known api modules |
---|
Epydoc: mrv.maya.mdb.CppHeaderParser
Bases: object
Simplistic regex based parser which will extract information from the file it was initialized with.
For now its so simple that there is no more than one method
Parse the given header file and return the parsed information
Parameters: |
|
---|---|
Note: | Currently we can only parse non-anonymous enumerations ! |
Returns: | tuple(tuple(MEnumDescriptor, ...), ) |
Epydoc: mrv.maya.mdb.MEnumDescriptor
Bases: list
Is an ordered list of enumeration names without its values, together with the name of the enumeration type
Epydoc: mrv.maya.mdb.MFnCodeGeneratorBase
Bases: object
Define the interface and common utility methods to generate a string defining code for a given MFnMethod according to the meta data provided by an MMethodDescriptor.
Once instantiated, it can create any number of methods
Returns: | string containing the code for the wrapper method as configured by the method descriptor |
---|---|
Parameters: |
|
Epydoc: mrv.maya.mdb.MMemberMap
Bases: UserDict.UserDict
Simple accessor for MFnDatabase access Direct access like db[funcname] returns an entry object with all values
Globals: The __globals__ entry in MFn db files allows to pass additional options. Currently there are no supported flags
Create an entry for the given function, or return the existing one
Returns: | Entry object for funcname |
---|
Returns: | Tuple( mfnfuncname, entry ) original mfnclass function name paired with the db entry containing more information |
---|---|
Raises KeyError: | |
if no such function exists |
Returns: | mfn functionname corresponding to the ( possibly renamed ) funcname |
---|
Epydoc: mrv.maya.mdb.MMethodDescriptor
Bases: object
Contains meta-information about a given method according to data read from the MFnDatabase
Bases: object
Read and write simple pipe separated files.
The number of column must remain the same per line Format:
val11 | val2 | valn ...
intiialize the writing process
Parameter: | columnSizes – list of ints defining the size in characters for each column you plan to feed |
---|---|
Note: | When done writing, you have to close the file object yourself (there is no endWriting method here) |
Generator reading one line after another, returning the stripped columns
Returns: | tuple of stripped column strings |
---|---|
Raises ValueError: | |
if the column count changes between the lines |
Write the list of tokens to the file accordingly
Parameter: | tokens – one token per column that you want to write |
---|---|
Raises TypeError: | |
If column count changed between successive calls |
Epydoc: mrv.maya.mdb.PythonMFnCodeGenerator
Bases: mrv.maya.mdb.MFnCodeGeneratorBase
Specialization to generate python code
Flags:
- kDirectCall:
If set, the call return the actual mfn method in the best case, which is a call as direct as it gets. A possibly negative side-effect would be that it the MFnMethod caches the function set and actual MObject/MDagPath, which can be dangerous if held too long
- kIsMObject:
If set, the type we create the method for is not derived from Node, but from MObject. This hint is required in order to generate correct calling code.
- kIsDagNode:
If set, the type we create the method for is derived from DagNode
- kIsStatic:
If set, the method to be wrapped is considered static, no self is needed, nor any object. NOTE: This flag is likely to be removed as it should be part of the method_descriptor, for now though it does not provide that information so we pass it in.
- kWithDocs:
If set, a doc string will be generated the method. In future, this information will come from the method descriptor. Please note that docs should only be attaced in interactive modes, otherwise its a waste of memory.
Generates code as python string which can be used to compile a function. It assumes the following globals to be existing once evaluated: mfncls, mfn_fun, [rvalfunc] Currently supports the following data within method_descriptor:
- method_descriptor.rvalfunc
as well as all flags except kIsStatic. :raise ValueError: if flags are incompatible with each other
Returns: | python function suitable to be installed on a class |
---|---|
Parameters: |
|
Note: | For all other args, see MFnCodeGeneratorBase.generateMFnClsMethodWrapper |