mrv.maya.nt.typ

Epydoc: mrv.maya.nt.typ

Houses the MetaClass able to setup new types to work within the system. This can be considered the heart of the node wrapping engine, but it plays together with the implementation in the base module.

Functions

mrv.maya.nt.typ._addCustomType(targetmoduledict, parentclsname, newclsname, metaclass=<class 'mrv.maya.nt.typ.MetaClassCreatorNodes'>, **kwargs)

Add a custom type to the system such that a node with the given type will automatically be wrapped with the corresponding class name

Parameters:
  • targetmoduledict – the module’s dict to which standin classes are supposed to be added
  • parentclsname – the name of the parent node type - if your new class has several parents, you have to add the new types beginning at the first exsiting parent as written in the maya/cache/nodeHierarchy.html file
  • newclsname – the new name of your class - it must exist targetmodule
  • metaclass – meta class object to be called to modify your type upon creation It will not be called if the class already exist in targetModule. Its recommended to derive it from the metaclass given as default value.
Raises KeyError:
 

if the parentclsname does not exist

mrv.maya.nt.typ._addCustomTypeFromDagtree(targetmoduledict, dagtree, metaclass=<class 'mrv.maya.nt.typ.MetaClassCreatorNodes'>, force_creation=False, **kwargs)

As _addCustomType, but allows to enter the type relations using a mrv.util.DAGTree instead of individual names. Thus multiple edges can be added at once

Note:special care is being taken to make force_creation work - first all the standind classes are needed, then we can create them - just iterating the nodes in undefined order will not work as a parent node might not be created yet
Note:node names in dagtree must be uncapitalized
mrv.maya.nt.typ._removeCustomType(targetmoduledict, customTypeName)

Remove the given typename from the given target module’s dictionary as well as from internal caches

Note:

does nothing if the type does not exist

Parameters:
  • targetmoduledict – dict of your module to remove the type from
  • customTypeName – name of the type to be removed, its expected to be capitalized
mrv.maya.nt.typ.capitalize(s)
Returns:s with first letter capitalized
mrv.maya.nt.typ.initNodeHierarchy()
Initialize the global tree of types, providing a hierarchical relationship between the node typename strings
mrv.maya.nt.typ.initTypeNameToMfnClsMap()
Fill the cache map supplying additional information about the MFNClass to use when creating the classes
mrv.maya.nt.typ.initWrappers(targetmoduledict)

Create Standin Classes that will delay the creation of the actual class till the first instance is requested

Parameter:targetmoduledict – the module’s dictionary (globals()) to which to put the wrappers
mrv.maya.nt.typ.prefetchMFnMethods()

Fetch and install all mfn methods on all types supporting a function set. This should only be done to help interactive mode, but makes absolutely no sense in the default mode of operation when everything is produced on demand.

Note:Attaches docstrings as well
Returns:integer representing the number of generated methods
mrv.maya.nt.typ.uncapitalize(s, preserveAcronymns=False)
Returns:s with first letter lower case
Parameter:preserveAcronymns – enabled ensures that ‘NTSC’ does not become ‘nTSC’
Note:from pymel

Classes

Epydoc: mrv.maya.nt.typ

class mrv.maya.nt.typ.MEnumeration

Bases: tuple

Simple enumeration class which allows access to its enumeration using getattr access. As it is a tuple as well, one can access the enumeration values in the right sequencial order

count
T.count(value) -> integer – return number of occurrences of value
classmethod create(ed, mfncls)
Returns:new instance of this type as initialized from the EnumDescriptor ed and the mfncls
index
T.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.
nameByValue(value)
Returns:name string with the given integer value
Parameter:value – integer value of this enumeration
Raises ValueError:
 if value is not in the enumeration

Epydoc: mrv.maya.nt.typ

class mrv.maya.nt.typ.MetaClassCreator

Bases: type

Builds the base hierarchy for the given classname based on our typetree

mro
mro() -> list return a type’s method resolution order

Epydoc: mrv.maya.nt.typ.MetaClassCreatorNodes

class mrv.maya.nt.typ.MetaClassCreatorNodes

Bases: mrv.maya.util.MetaClassCreator

Builds the base hierarchy for the given classname based on our typetree :todo: build classes with slots only as members are pretermined

mro
mro() -> list return a type’s method resolution order

Epydoc: mrv.maya.nt.typ

class mrv.maya.nt.typ.instancemethod

Bases: object

instancemethod(function, instance, class)

Create an instance method object.

im_class
the class associated with a method
im_func
the function (or other callable) implementing a method
im_self
the instance to which a method is bound; None for unbound methods

Table Of Contents

Previous topic

mrv.maya.nt.it

Next topic

mrv.maya.nt.set

This Page