mrv.maya.nt.persistence
Epydoc: 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.
Functions
-
mrv.maya.nt.persistence.__initialize(nodes_module)
- 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.
-
mrv.maya.nt.persistence.createStorageAttribute(dataType, name_prefix='')
This method creates an Attribute in a configuration suitable to be used
with the StorageBase interface.
Note: | this allows your own plugin node to receive storage compatibility
|
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
|
-
mrv.maya.nt.persistence.initStoragePluginNodeAttrs()
- Called to initialize the attributes of the storage node
-
mrv.maya.nt.persistence.initializePlugin(mobject)
-
mrv.maya.nt.persistence.uninitializePlugin(mobject)
Classes
Epydoc: mrv.maya.nt.persistence.PyPickleData
-
class mrv.maya.nt.persistence.PyPickleData
Bases: maya.OpenMayaMPx.MPxData
Allows to access a pickled data object natively within a maya file.
In ascii mode, the pickle will be encoded into string data, in binary mode
the cPickle will be taken in its original value.
To get the respective dict-references back, we use a tracking dict as proposed
by the API Docs
Note: | This datatype is copies the data by reference which is why maya always calls
the copy constructor, even if you retrieve a const data reference, where this would not be
required actually. This is fine for most uses |
Note: | as the datatype is reference based, undo is currently not supported (or does not
work as it is expected to do |
-
copy(other)
- Copy other into self - allows copy pointers as maya copies the data each
time you retrieve it
-
static creator()
-
name()
-
readASCII(args, lastParsedElement)
- Read base64 element and decode to cStringIO, then unpickle
-
readBinary(inStream, numBytesToRead)
Read in 4 byte packs to cStringIO, unpickle from there
Note: | this method is more complicated than it needs be since asCharPtr does not work !
It returns a string of a single char ... which is not the same :) ! |
Note: | YES, this is a CUMBERSOME way to deal with bytes ... terrible, thanks maya :), thanks python |
-
thisown
- The membership flag
-
typeId()
-
writeASCII(out)
- cPickle to cStringIO, encode with base64 encoding
-
writeBinary(out)
- cPickle to cStringIO, write in 4 byte packs using ScriptUtil
Epydoc: mrv.maya.nt.persistence.StoragePluginNode
-
class mrv.maya.nt.persistence.StoragePluginNode
Bases: maya.OpenMayaMPx.MPxNode
Base Class defining the storage node data interfaces
-
addAttribute()
-
attributeAffects()
-
caching
-
className()
-
compute()
-
connectionBroken()
-
connectionMade()
-
copyInternalData()
-
static creator()
-
existWithoutInConnections()
-
existWithoutOutConnections()
-
getFilesToArchive()
-
getInternalValue()
-
getInternalValueInContext()
-
inheritAttributesFrom()
-
internalArrayCount()
-
isAbstractClass()
-
isHistoricallyInteresting
-
isPassiveOutput()
-
legalConnection()
-
legalDisconnection()
-
message
-
name()
-
passThroughToMany()
-
passThroughToOne()
-
postConstructor()
-
setDependentsDirty()
-
setExistWithoutInConnections()
-
setExistWithoutOutConnections()
-
setInternalValue()
-
setInternalValueInContext()
-
shouldSave()
-
state
-
thisMObject()
-
thisown
- The membership flag
-
type()
-
typeId()
-
typeName()