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

Module persistence

source code

generic python style persitance plugin This module contains a storage interface able to easily handle python-style data within maya scenes.
Classes [hide private]
    Storage Plugin
  StoragePluginNode
Base Class defining the storage node data interfaces
  PyPickleData
Allows to access a pickled data object natively within a maya file.
Functions [hide private]
    Initialization
 
__initialize(nodes_module)
Assure our plugin is loaded - called during module intialization.
source code
    Storage Plugin
 
createStorageAttribute(dataType, name_prefix='')
This method creates an Attribute in a configuration suitable to be used with the StorageBase interface.
source code
 
initStoragePluginNodeAttrs()
Called to initialize the attributes of the storage node
source code
 
initializePlugin(mobject) source code
 
uninitializePlugin(mobject) source code
Variables [hide private]
  log = logging.getLogger('mrv.maya.nt.persistence')
  persistence_enabled_envvar = "MRV_PERSISTENCE_ENABLED"
  _should_initialize_plugin = int(os.environ.get(persistence_ena...
Function Details [hide private]

__initialize(nodes_module)

source code 
Assure our plugin is loaded - called during module intialization. Its a tough time to run, it feels more like bootstrapping as we initialize ourselves although the system is not quite there yet.

createStorageAttribute(dataType, name_prefix='')

source code 
This method creates an Attribute in a configuration suitable to be used with the StorageBase interface.
Parameters:
  • dataType - the type of the typed attribute - either MTypeID or MFnData enumeration An MTypeID must point to a valid and already registered plugin data. In order for the StorageBase interface to work, it must by PyPickleData.kPluginDataId.
  • name_prefix - string to be used as prefix for all short and long attribute names. Useful if you want to have more than one storage attributes.
Returns:
attribute api object of its master compound attribute

Note: this allows your own plugin node to receive storage compatibility


Variables Details [hide private]

_should_initialize_plugin

Value:
int(os.environ.get(persistence_enabled_envvar, False))