Skip to content

Instantly share code, notes, and snippets.

@liorbenhorin
Created August 26, 2017 08:59
Show Gist options
  • Save liorbenhorin/e65cf5222f36cbecfc424d6130662d86 to your computer and use it in GitHub Desktop.
Save liorbenhorin/e65cf5222f36cbecfc424d6130662d86 to your computer and use it in GitHub Desktop.
Update mgear guides from older version (2.0.5) to latest (2.2.1)
import pymel.core as pm
import mgear.maya.attribute as att
import mgear.maya.shifter as sh
print '==== updating guides to RB2.2 ==='
guide = sh.RigGuide()
guides_root = pm.PyNode('biped_guide')
classicChannelNames_param = att.ParamDef2("classicChannelNames", "bool", True)
proxyChannels_param = att.ParamDef2("proxyChannels", "bool", False)
classicChannelNames_param.create(guides_root)
proxyChannels_param.create(guides_root)
print 'Added param {} to {}'.format('classicChannelNames', guides_root)
print 'Added param {} to {}'.format('proxyChannels', guides_root)
guide.findComponentRecursive(guides_root)
for comp, node in guide.components.iteritems():
param = att.ParamDef2("ctlGrp", "string", "")
node_root = pm.PyNode(node.root)
param.create(node_root)
print 'Added param {} to {}'.format('ctlGrp', node)
print '==== done updating ==='
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment