Skip to content

Instantly share code, notes, and snippets.

@patwooky
Created October 25, 2016 07:02
Show Gist options
  • Save patwooky/17b99cf469532064fddeca120750ff85 to your computer and use it in GitHub Desktop.
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
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