Advertisement
Lucas_3D

UV Offset

Jun 24th, 2021
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. --(
  2. delete $*
  3. pl = plane lengthsegs:3 widthsegs:3 length:100 width:100
  4. uvMat = physicalMaterial()
  5. uvMat.basecolormap = Bitmaptexture filename:(getDir #maxroot+"maps//uv-grid.png")
  6. pl.material = uvMat
  7. convertTo pl Editable_Poly
  8. polyop.breakVerts pl #all
  9. --lets get to uv offsetting
  10. randomMoveAmount = 1.0
  11. for face = 1 to getNumFaces pl do
  12. (
  13. faceVerts = polyOp.getMapFace pl 1 face
  14. (
  15. randomMove = (random randomMoveAmount -1 * randomMoveAmount)
  16. for vert in faceVerts do
  17. (
  18. polyOp.setMapVert pl 1 vert ((polyOp.getMapVert pl 1 vert) + [0,randomMove,0])
  19. )
  20. )
  21. )
  22. redrawViews()
  23. --)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement