Created
August 16, 2015 13:19
-
-
Save BigRoy/3fdbb6df0c2b302a804b to your computer and use it in GitHub Desktop.
This file contains 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
import maya.cmds as mc | |
def offsets_to_input(mesh): | |
num_pts = mc.getAttr('{0}.pnts'.format(mesh), size=True) | |
for i in range(num_pts): | |
# Get the internal offset | |
offset = mc.getAttr('{0}.pnts[{1}]'.format(mesh, i))[0] | |
# Move the vertex position by the internal offset value (relative) | |
mc.move(offset[0], offset[1], offset[2], '{0}.vtx[{1}]'.format(mesh, i), relative=True) | |
# Reset the internal offset to zero | |
mc.setAttr('{0}.pnts[{1}]'.format(mesh, i), 0.0, 0.0, 0.0, type='float3') | |
for mesh in mc.ls(sl=1, dag=1, leaf=1, type='mesh'): | |
offsets_to_input(mesh) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment