Package mrv :: Package maya :: Module mdb :: Class PythonMFnCodeGenerator
[hide private]
[frames] | no frames]

Class PythonMFnCodeGenerator

source code

          object --+    
                   |    
MFnCodeGeneratorBase --+
                       |
                      PythonMFnCodeGenerator

Specialization to generate python code

Flags:

Instance Methods [hide private]

Inherited from MFnCodeGeneratorBase: __init__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Interface
 
generateMFnClsMethodWrapper(self, source_method_name, target_method_name, mfn_fun_name, method_descriptor, flags=0)
Generates code as python string which can be used to compile a function.
source code
 
generateMFnClsMethodWrapperMethod(self, source_method_name, target_method_name, mfncls, mfn_fun, method_descriptor, flags=0)
Returns: python function suitable to be installed on a class
source code
    Utilities

Inherited from MFnCodeGeneratorBase (private): _toRvalFunc

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

generateMFnClsMethodWrapper(self, source_method_name, target_method_name, mfn_fun_name, method_descriptor, flags=0)

source code 

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

Parameters:
  • source_method_name - Original name of the method - this is the name under which it was requested.
  • target_method_name - Name of the method in the returned code string
  • mfn_fun_name - original name of the MFn function
  • method_descriptor - instance of MMethodDescriptor
  • flags - bit flags providing additional information, depending on the actual implementation. Unsupported flags are ignored.
Returns:
string containing the code for the wrapper method as configured by the method descriptor
Overrides: MFnCodeGeneratorBase.generateMFnClsMethodWrapper

generateMFnClsMethodWrapperMethod(self, source_method_name, target_method_name, mfncls, mfn_fun, method_descriptor, flags=0)

source code 
Parameters:
  • mfncls - MFnFunction set class from which the method was retrieved.
  • mfn_fun - function as retrieved from the function set's dict. Its a bare function.
Returns:
python function suitable to be installed on a class

Note: For all other args, see MFnCodeGeneratorBase.generateMFnClsMethodWrapper