Created
October 25, 2016 07:02
-
-
Save patwooky/17b99cf469532064fddeca120750ff85 to your computer and use it in GitHub Desktop.
Connects scaleX to scaleY and scaleZ, and locks scaleY and scaleZ. run it again on the same object and it will unlock scaleY, scaleZ, and disconnect both the attrs
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
def uniformScaleLock(sel=ls(sl=True)): | |
''' | |
connects scaleX to scaleY and scaleZ, and locks scaleY and scaleZ | |
run it again and it will unlock scaleY, scaleZ, and disconnect both the attrs | |
''' | |
if not sel: | |
print 'nothing selected. quitting' | |
return | |
if type(sel) == type(list()): | |
sel = sel[0] | |
if (sel.sx.isConnected()): | |
sel.sy.setLocked(1-sel.sy.isLocked()) | |
sel.sz.setLocked(1-sel.sz.isLocked()) | |
sel.sy.disconnect() | |
sel.sz.disconnect() | |
else: | |
sel.sx >> sel.sy | |
sel.sx >> sel.sz | |
sel.sy.setLocked(1-sel.sy.isLocked()) | |
sel.sz.setLocked(1-sel.sz.isLocked()) | |
uniformScaleLock() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment