PDA

View Full Version : Maya metaData - fleshing out a new API


RedNine
06-24-2012, 05:35 PM
I'm just starting to flesh out a new python based metaData system for Maya, aimed at serializing complex data and managing systems in a more pythonic manner. The idea is that on a MayaNetwork node we handle all attribute calls (__getattribute__, __setattr__ , addAttr etc) and if needed serialize complex data such as dict/lists etc via JSON to a string attr. When you do a simple attr call to the metaClass it checks the MayaNode and if it's a JSON managed string, will give you back the complex data as it was, handling all the deserialization for you.

So from the class object you can do the following where 'complexAttr' is just a JSON serialized string attribute on the MayaNode itself

node.complexAttr['Meta'] #deserialize and from the dict given me the key value ['Meta']

It also manages connections via message links, all wrapped in the same pythonic manner. The same standard node.attr call to a message attr will give you back a list of connections to that msg attr itself.

There are a few other neat tricks in there too that Im testing, such as the r9Meta.GetMetaNodes() which will give you back not just the MayaMetaNodes, but those nodes initialized to the correct class object ready for use.

Anyway, I'm looking for testers and some ideas as to how to expand on this. Initially I was going to use it as part of a generic Rig marking system but kind of thinking it could go way further than that.

Mail me if you fancy a play with the API

Red

doctorbob
06-24-2012, 11:38 PM
The things you can do with a good metaNode system are verrry interesting... ;)

I use them in the lighting pipeline, for instance.

cheers,
chrisg

verbatimline
06-25-2012, 03:54 PM
Mail me if you fancy a play with the API
Red

It sounds really interesting.

RedNine
06-25-2012, 04:46 PM
It's now up for download off my blog, just follow the Download tag which will take you to my Google docs download folder. Only available in v1.24

verbatimline
06-25-2012, 04:49 PM
It's now up for download off my blog, just follow the Download tag which will take you to my Google docs download folder. Only available in v1.24

Thanks rednine, I will give a try.

Tim

RedNine
06-26-2012, 06:47 PM
Just added a quick Video demo on the blog, hope it all makes sense!

http://red9-consultancy.blogspot.co.uk/2012/06/r9metaclass-vimeo-demo.html

Joviex
06-30-2012, 09:45 PM
I'm just starting to flesh out a new python based metaData system for Maya, aimed at serializing complex data and managing systems in a more pythonic manner. The idea is that on a MayaNetwork node we handle all attribute calls (__getattribute__, __setattr__ , addAttr etc) and if needed serialize complex data such as dict/lists etc via JSON to a string attr. When you do a simple attr call to the metaClass it checks the MayaNode and if it's a JSON managed string, will give you back the complex data as it was, handling all the deserialization for you.

So from the class object you can do the following where 'complexAttr' is just a JSON serialized string attribute on the MayaNode itself

node.complexAttr['Meta'] #deserialize and from the dict given me the key value ['Meta']

It also manages connections via message links, all wrapped in the same pythonic manner. The same standard node.attr call to a message attr will give you back a list of connections to that msg attr itself.

There are a few other neat tricks in there too that Im testing, such as the r9Meta.GetMetaNodes() which will give you back not just the MayaMetaNodes, but those nodes initialized to the correct class object ready for use.

Anyway, I'm looking for testers and some ideas as to how to expand on this. Initially I was going to use it as part of a generic Rig marking system but kind of thinking it could go way further than that.

Mail me if you fancy a play with the API

Red

Sounds interesting. Reads like a lot of what we have for our rig, fx, lighting/comp and animation pipelines.

Definitely be interested to test it out.

Cheers.

RedNine
07-01-2012, 09:29 AM
Well at the moment it's very much just the baseClass thats fleshed out. I wanted to get the main attribute handling sorted and seamless before figuring out where to go with this. The aim was to make as Pythonic setup as I could so you just treat the MayaNode as a Python object and don't worry about anything else.

One thing I was thinking is that at the moment the baseClass will, if not already passed in, make a network node to serialize the data too but sudddenly thought last night theres no need! If you pass in a standard Maya node, why not just use the same handling and serializing but on any Maya node you pass in. So for complex nodes with tons of attrs you could just pass the node to the baseClass and you get all the benefits of the binding.

Red

RedNine
07-01-2012, 09:52 PM
A few new bits added which make sense, I think?

https://vimeo.com/45034087

CGTalk Moderation
07-01-2012, 09:52 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.