Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Select two objects, object first then place3DTexture node
- # this script will move and scale the place3DTexture node to the same position and size
- # as the first selected object
- firstObject = str(plg.ls(selection = True)[0])
- secondObject = str(plg.ls(selection = True)[1])
- plg.setAttr(secondObject + '.translateX', plg.getAttr(firstObject + '.translateX'))
- plg.setAttr(secondObject + '.translateY', plg.getAttr(firstObject + '.translateY'))
- plg.setAttr(secondObject + '.translateZ', plg.getAttr(firstObject + '.translateZ'))
- active = plg.polyEvaluate(firstObject, boundingBox = True)
- sizeX = active[0][1] - active[0][0]
- sizeY = active[1][1] - active[1][0]
- sizeZ = active[2][1] - active[2][0]
- plg.setAttr(secondObject + '.scaleX', sizeX/2)
- plg.setAttr(secondObject + '.scaleY', sizeY/2)
- plg.setAttr(secondObject + '.scaleZ', sizeZ/2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement