Based on the Bungee paper we've implemented a MetaData python class
that utilises a simple MPxNode as a singleton to store the MetaData
attributes.  MetaData structures are connected together and Maya Nodes
are tagged to the MetaData via message links.

for example:

class MetaData(obejct):
    def __init__(self, node=None, **kw):
         self,metaClass = self.__class__.__name__
         # create the MPxNode and set the attr attaching it to Node

Each MetaData subclass has different methods associated with them.
While I have a simple AETemplate for my MPxNode.  It's become obvious
that I could have a totally different template based on the metaClass
attribute on the node.  With buttons calling methods in the class that
operate on the MetaData structure.

The only hacky way I have got this working is by reloading the
AETemplate via a script job if the MetaData node is different to the
last cached MetaData selection.  This works, is slow-ish, not stable
because the UI doesn't seem to be thread safe.

So, I guess I have to create a different MPxNode for every subclass
that requires a different template.  Even though my MPxNode is
effectively a blank node?

Anyone?  You're experience with templates would be welcome.  I've just
started to investigate them.

-Dave


-- 
http://groups.google.com/group/python_inside_maya

Reply via email to