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

Package maya

source code

Inialize the mrv.maya sub-system and startup maya as completely as possible or configured

Submodules [hide private]
  • mrv.maya.all: Module importing all maya related classes into one place
  • mrv.maya.automation: Intiailize the automation and process framework for maya
  • mrv.maya.env: Allows to query the maya environment, like variables, version numbers and system paths.
  • mrv.maya.mdb: Provides classes and functions operating on the MayaAPI class database
  • mrv.maya.ns: Allows convenient access and handling of namespaces in an object oriented manner
  • mrv.maya.nt: All classes required to wrap maya nodes in an object oriented manner into python objects and allow easy handling of them.
    • mrv.maya.nt.anim: Contains implementations of animation specific types and utilities
    • mrv.maya.nt.apipatch: Contains patch classes that are altering their respective api classes
    • mrv.maya.nt.base: Contains some basic classes that are required to run the nodes system
    • mrv.maya.nt.geometry: Contains implementations ( or improvements ) to mayas geometric shapes
    • mrv.maya.nt.it: Contains different multi-purpose iterators allowing to conveniently walk the dg and dag.
    • mrv.maya.nt.persistence: generic python style persitance plugin This module contains a storage interface able to easily handle python-style data within maya scenes.
    • mrv.maya.nt.set: Contains improved clases for set and partition editing
    • mrv.maya.nt.storage: Contains an implementation for the Persistence plugin for easy access within mrv and derived nodes.
    • mrv.maya.nt.typ: Houses the MetaClass able to setup new types to work within the system.
    • mrv.maya.nt.util: General utility methods
  • mrv.maya.ref: Allows convenient access and handling of references in an object oriented manner
  • mrv.maya.scene: Provides methodes to query and alter the currently loaded scene.
  • mrv.maya.ui: Initialize the UI framework allowing convenient access to most common user interfaces
  • mrv.maya.undo: Contains the undo engine allowing to adjust the scene with api commands while providing full undo and redo support.
  • mrv.maya.util: All kinds of utility methods and classes that are used in more than one modules

Functions [hide private]
    Common
 
registerPluginDataTrackingDict(dataTypeID, trackingDict)
Using the given dataTypeID and tracking dict, nt.PluginData can return self pointers belonging to an MPxPluginData instance as returned by MFnPluginData.
source code
    Init new maya version
 
initializeNewMayaRelease()
This method should be called once a new maya release is encountered.
source code
    Internal Utilities
 
dag_tree_from_tuple_list(tuplelist)
:return: DagTree from list of tuples [ (level,name),...], where level specifies the level of items in the dag.
source code
 
tuple_list_from_file(filepath)
Create a tuple hierarchy list from the file at the given path :return: tuple list suitable for dag_tree_from_tuple_list
source code
 
initWrappers(mdict, types, metacreatorcls, force_creation=False)
Create standin classes that will create the actual class once creation is requested.
source code
 
move_vars_to_environ()
Move the maya vars as set in the shell into the os.environ to make them available to python
source code
    Initialization
 
init_system()
Check if we are suited to import the maya namespace and try to set it up such we can use the maya standalone package.
source code
 
init_path()
Setup the path type to use slashes internally, no matter which operating system we are on
source code
 
init_user_prefs()
intiialize the user preferences according to the set configuration variables
source code
 
init_singletons()
Initialize singleton classes and attach them direclty to our module
source code
 
init_standard_output()
Assure that logging can print to stdout and stderr which get overwritten by special maya versions which lack the 'flush' method
source code
Variables [hide private]
  log = logging.getLogger("mrv.maya")
  init_done = True
Function Details [hide private]

registerPluginDataTrackingDict(dataTypeID, trackingDict)

source code 

Using the given dataTypeID and tracking dict, nt.PluginData can return self pointers belonging to an MPxPluginData instance as returned by MFnPluginData. Call this method to register your PluginData information to the mrv system. Afterwards you can extract the self pointer using plug.masData().data()

initializeNewMayaRelease()

source code 

This method should be called once a new maya release is encountered. It will initialize and update the database as well as possible, and give instructions on what to do next.

:note: Will not run if any user setup is performed as we need a clean maya without any plugins loaded. :raise EnvironmentError: if the current maya version has already been initialized or if the user setup was executed

dag_tree_from_tuple_list(tuplelist)

source code 

:return: DagTree from list of tuples [ (level,name),...], where level specifies the level of items in the dag. :note: there needs to be only one root node which should be first in the list :return: `DagTree` item allowing to easily query the hierarchy

initWrappers(mdict, types, metacreatorcls, force_creation=False)

source code 

Create standin classes that will create the actual class once creation is requested. :param mdict: module dictionary object from which the latter classes will be imported from, can be obtained using ``globals()`` in the module :param types: iterable containing the names of classnames ( they will be capitalized as classes must begin with a capital letter )

init_system()

source code 

Check if we are suited to import the maya namespace and try to set it up such we can use the maya standalone package. If running within maya or whith maya py, this is true, otherwise we have to use the MAYA_LOCATION to get this to work.