Package mrv :: Package maya :: Module util
[hide private]
[frames] | no frames]

Module util

source code

All kinds of utility methods and classes that are used in more than one modules
Classes [hide private]
    Utitliy Classes
  Mel
This class is a necessity for calling mel scripts from python.
  OptionVarDict
A singleton dictionary-like class for accessing and modifying optionVars.
    API Utilities Classes
  StandinClass
Simple Function Object allowing to embed the name of the type as well as the metaclass object supposed to create the actual class.
  MetaClassCreator
Builds the base hierarchy for the given classname based on our typetree
  CallbackEventBase
Allows the mapping of MMessage callbacks to mrv's event sender system.
  MEnumeration
Simple enumeration class which allows access to its enumeration using getattr access.
Functions [hide private]
    Utility Functions
 
noneToList(res)
Returns: list instead of None
source code
 
isIterable(obj) source code
 
pythonToMel(arg) source code
    Decorator
 
_logException(func, reraise) source code
 
logException(func)
Decorator which shows short exception information in a popup and a full stack trace to stdout.
source code
 
notifyException(func)
As logException, but does not reraise on error.
source code
    MEL Function Wrappers
 
makeEditOrQueryMethod(inCmd, flag, isEdit=False, methodName=None)
Create a function calling inFunc with an edit or query flag set.
source code
 
queryMethod(inCmd, flag, methodName=None)
Shorthand query version of makeEditOrQueryMethod
source code
 
editMethod(inCmd, flag, methodName=None)
Shorthand edit version of makeEditOrQueryMethod
source code
 
propertyQE(inCmd, flag, methodName=None)
Shorthand for simple query and edit properties
source code
Variables [hide private]
    Utitliy Classes
  optionvars = OptionVarDict()
Function Details [hide private]

noneToList(res)

source code 
Returns:
list instead of None

logException(func)

source code 
Decorator which shows short exception information in a popup and a full stack trace to stdout. Finally the exception will be reraised

notifyException(func)

source code 
As logException, but does not reraise on error. This is useful if you just want to see a popup, but not cause maya to remove the possibly problematic UI callback. Additionally, no stacktrace will be shown

makeEditOrQueryMethod(inCmd, flag, isEdit=False, methodName=None)

source code 
Create a function calling inFunc with an edit or query flag set.
Parameters:
  • inCmd - maya command to call
  • flag - name of the query or edit flag
  • isEdit - If not False, the method returned will be an edit function
  • methodName - the name of the method returned, defaults to inCmd name

Note: THIS CODE HAS BEEN DUPLICATED TO mrv.maya.ui.util !