SHARE
TWEET

The Fitter 0.1.0

jeffwincek Oct 6th, 2011 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Select two objects, object first then place3DTexture node
  2. # this script will move and scale the place3DTexture node to the same position and size
  3. # as the first selected object
  4.  
  5. firstObject = str(plg.ls(selection =  True)[0])
  6. secondObject = str(plg.ls(selection =  True)[1])
  7.  
  8. plg.setAttr(secondObject + '.translateX', plg.getAttr(firstObject + '.translateX'))
  9. plg.setAttr(secondObject + '.translateY', plg.getAttr(firstObject + '.translateY'))
  10. plg.setAttr(secondObject + '.translateZ', plg.getAttr(firstObject + '.translateZ'))
  11.  
  12. active = plg.polyEvaluate(firstObject, boundingBox = True)
  13. sizeX = active[0][1] - active[0][0]
  14. sizeY = active[1][1] - active[1][0]
  15. sizeZ = active[2][1] - active[2][0]
  16.  
  17. plg.setAttr(secondObject + '.scaleX', sizeX/2)
  18. plg.setAttr(secondObject + '.scaleY', sizeY/2)
  19. plg.setAttr(secondObject + '.scaleZ', sizeZ/2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top