Skip to content

Instantly share code, notes, and snippets.

@lukpazera
Last active April 10, 2019 09:35
Show Gist options
  • Save lukpazera/60001af47b40b026468776b165a49709 to your computer and use it in GitHub Desktop.
Save lukpazera/60001af47b40b026468776b165a49709 to your computer and use it in GitHub Desktop.
Using python TDSDK to merge two rotation transform items in MODO. The assumption is that the 2nd item is zero rotation one so effectively this removes zeroed rotation from an item.
import modo
scene = modo.Scene()
i = scene.selected[0]
l = modo.LocatorSuperType(i)
rot = l.rotation
transformsStack = [xfrm for xfrm in l.transforms]
transformsStack.reverse()
for n, xfrm in enumerate(transformsStack):
print xfrm.name
if xfrm == rot:
if transformsStack[n + 1].type == 'rotation':
scene.select([transformsStack[n + 1], xfrm])
lx.eval('transform.merge rem:1')
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment