mrv :: maya :: nt :: typ :: MetaClassCreatorNodes :: Class MetaClassCreatorNodes
[hide private]
[frames] | no frames]

Type MetaClassCreatorNodes

source code

       object --+        
                |        
             type --+    
                    |    
util.MetaClassCreator --+
                        |
                       MetaClassCreatorNodes

Builds the base hierarchy for the given classname based on our typetree :todo: build classes with slots only as members are pretermined
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(metacls, name, bases, clsdict)
Called to create the class with name
source code

Inherited from type: __call__, __delattr__, __eq__, __ge__, __getattribute__, __gt__, __hash__, __init__, __le__, __lt__, __ne__, __repr__, __setattr__, __subclasses__, mro

Inherited from object: __format__, __reduce__, __reduce_ex__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
_fetchMfnDB(cls, newcls, mfncls, **kwargs)
Return the mfndb for the given mfncls as existing on newcls.
source code
 
_wrapStaticMembers(cls, newcls, mfncls)
Find static mfnmethods - if these are available, initialize the mfn database for the given function set ( ``mfncls`` ) and create properly wrapped methods.
source code
 
_wrapMfnFunc(cls, newcls, mfncls, funcname, mfndb, addFlags=0)
Create a function that makes a Node natively use its associated Maya function set on calls.
source code
 
_wrapLazyGetAttr(thiscls, newcls)
Attach the lazy getattr wrapper to newcls
source code
Properties [hide private]

Inherited from type: __abstractmethods__, __base__, __bases__, __basicsize__, __dictoffset__, __flags__, __instancecheck__, __itemsize__, __mro__, __name__, __subclasscheck__, __weakrefoffset__

Inherited from object: __class__

Method Details [hide private]

_fetchMfnDB(cls, newcls, mfncls, **kwargs)
Class Method

source code 
Return the mfndb for the given mfncls as existing on newcls. If it does not yet exist, it will be created and attached first
Parameters:
  • kwargs - passed to MMemberMap initializer

_wrapStaticMembers(cls, newcls, mfncls)
Class Method

source code 
Find static mfnmethods - if these are available, initialize the 
mfn database for the given function set ( ``mfncls`` ) and create properly 
wrapped methods. 
Additionally check for enumerations, and generate the respective enumeration
instances
:note: As all types are initialized on startup, the staticmethods check 
        will load in quite a few function sets databases as many will have static 
        methods. There is no real way around it, but one could introduce 'packs'
        to bundle these together and load them only once. Probably the performance
        hit is not noticeable, but lets just say that I am aware of it
:note: Currently method aliases are not implemented for statics !

_wrapMfnFunc(cls, newcls, mfncls, funcname, mfndb, addFlags=0)
Class Method

source code 

Create a function that makes a Node natively use its associated Maya function set on calls.

The created function will use the api object of the instance of the call to initialize a function set of type mfncls and execute the function in question.

The method mutation database allows to adjust the way a method is being wrapped

Parameters:
  • mfncls - Maya function set class from which to take the functions
  • funcname - name of the function set function to be wrapped.
  • mfndb - mdb.MMemberMap
  • addFlags - If set, these flags define how the method will be generated.
Returns:
wrapped function or None if it was deleted
Raises:
  • KeyError - if the given function does not exist in mfncls

Note: if the called function starts with _api_*, a special accellerated method will be returned and created allowing direct access to the mfn instance method. This is unsafe if the same api object is being renamed. Also it will only be faster if the same method is actually called multiple times. It can be great for speed sensitive code where where the same method(s) are called repeatedly on the same set of objects

__new__(metacls, name, bases, clsdict)

source code 
Called to create the class with name
Parameters:
  • dagtree - mrv.util.DAGTree instance with hierarchy information
  • module - the module instance to which to add the new classes to
  • nameToTreeFunc - convert the class name to a name suitable for dagTree look-up
  • treeToNameFunc - convert a value from the dag tree into a valid class name ( used for parent lookup )
Returns: a new object with type S, a subtype of T
Overrides: object.__new__