Guest User

Untitled

a guest
Mar 11th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. -- Scale Tool for X plane
  2. -- Authored by Thomas of Hilo
  3. -- Based on works by Kaen, raptor, Watusimoto
  4.  
  5. function getArgsMenu()
  6.  
  7. menu = {
  8. TextEntryMenuItem.new("Scale X: ", "1", "10.0", "I don't know what's going on here"),
  9. TextEntryMenuItem.new("Scale Y: ", "1", "10.0", "Woo hoo")
  10. }
  11. return "XYScaler", "Scale selection on the X Y axis", "Ctrl+=", menu
  12. end
  13.  
  14. function main()
  15. local sx = table.remove(arg, 1)
  16. local sy = table.remove(arg, 1)
  17.  
  18. local objects = plugin:getSelectedObjects()
  19.  
  20.  
  21. if #objects == 0 then
  22. plugin:showMessage("Operation failed. No objects are selected", false)
  23. return
  24. else
  25. for _, obj in pairs(objects) do
  26. local geom = obj:getGeom()
  27. local result = Geom.scale(geom, sx, sy)
  28. obj:setGeom(geom)
  29. end
  30. end
  31.  
  32. end
Advertisement
Add Comment
Please, Sign In to add comment