Last active
April 10, 2019 09:35
-
-
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.
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 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