Advertisement
jeffwincek

The Fitter 0.1.0

Oct 6th, 2011
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement