import Red9_Meta as r9Meta import maya.cmds as cmds mRig=r9Meta.MetaRig(name='MRIG') mRig.select() mRig.addRigCtrl('Chest_Ctr','Chest',boundData={'Side':'Centre'}) mRig.addRigCtrl('UpChest_Ctr','UpperChest',boundData={'Side':'Centre'}) mRig.addRigCtrl('Head_Ctr','Head',boundData={'Side':'Centre'}) mRig.addRigCtrl('Root_Ctr','Root',boundData={'Side':'Centre'}) mRig.addRigCtrl('L_Foot_Ctr','L_Foot',boundData={'Side':'Left'}) mRig.addRigCtrl('Hip_Ctr','Hips',boundData={'Side':'Centre'}) support=mRig.addSubMetaNode(nodeName='SupportNode',attr='Support') support.connectChild(node='Settings_Node',attr='ExportData') facial=support.addSubMetaNode(nodeName='FacialNode',attr='Facial') facial.connectChild(node='Lips_Ctr',attr='Lips')Now the beauty of this is that because the MetaClass base wraps all the Maya attrs and autofills the python objects dicts, we can lituarally walk the dag graph with dot complete! So to get to the Lips we can simply do the following, all of which autocompletes in the Maya scriptEditor for you ;)
mRig.Support.Facial.LipsAlso because of the way the mRig manages the Controls all of the controllers added above show up in the autocomplete on the mRig node. So you can just go MRig.Head to get the headCtrl back. I'm trying not to restrict this stuff, I'd rather make this as open as I can.
Again, the thing to bear in mind is that the main python objects __getattr__, __setattribute__ have been modified so that getting and setting all data types from Maya nodes is automatic. This includes getting and setting Emums and Message links.
I'll up the latest build of this module is now up on my Google Drive, see download link in the Tags
cheers
Red
Great! Can't wait to dig in. Thanks!
ReplyDelete