Last active
February 8, 2019 20:36
-
-
Save Onefabis/ffd35646f25f2dfc4f47e8affe2bd448 to your computer and use it in GitHub Desktop.
Quickly add tension map to your skinned mesh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sel = mc.ls( sl=1 ) | |
if mc.ls( mc.listRelatives( sel[0], s=1 )[0], st=1 )[-1] == 'mesh': | |
if not mc.pluginInfo( 'tensionMap', q=11, l=1 ): | |
mc.loadPlugin( 'tensionMap' ) | |
tensionMN = mc.createNode('tensionMap') | |
plug = mc.connectionInfo( sel[0] + '.inMesh', sourceFromDestination=1 ) | |
if plug: | |
mc.connectAttr( plug, tensionMN + '.deform', f=1 ) | |
mc.connectAttr( mc.listRelatives( sel[0], s=1 )[-1] + '.worldMesh[0]', tensionMN + '.orig', f=1 ) | |
mc.connectAttr( tensionMN + '.out', sel[0] + '.inMesh', f=1 ) | |
mc.polyOptions( sel[0], colorShadedDisplay=0 ) | |
mc.polyOptions( sel[0], colorShadedDisplay=1 ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment