Progressive Drop

This python script drops selected objects one at a time starting with the lowest one creating heaps and piles rather than the built in drop which places all of the objects on the nearest object underneath.

Progressive Drop 0.1 (2k Zip Archive)

Python Code

  1. #******************************************************
  2. # Drops a group of selected objects one at a time
  3. # starting with the lowest one and working up
  4. #
  5. # - progressivedrop.py
  6. # - By Mark Caldwell
  7. # - Version 0.1
  8. # - 17th June 2006
  9. # - Copyright Mark Caldwell 2006
  10. # - Tested with Vue 5 Infinite 5.10 and Vue 6 Infinite Pre Release
  11. #
  12. # How to use in 3 easy steps
  13. #
  14. # 1. Download this file onto your computer
  15. #
  16. # 2. Select Objects to drop. Make sure they are not
  17. # already resting on another object
  18. #
  19. # 3. Then run script and wait for it to work
  20. # To run it go to Python -> Run Python Script
  21. # Then locate the file on your computer
  22. #
  23. #******************************************************
  24. #----------------------------------------------
  25. # Internal Variables Set Up: Don't alter these
  26. #----------------------------------------------
  27.  
  28. posz=[]
  29. height=[]
  30. obj=[]
  31. countobj=CountSelectedObjects()
  32.  
  33. #----------------------------------------------
  34. # Find Selected Objects and Store Data
  35. #----------------------------------------------
  36.  
  37. if countobj>0:
  38. for i in range(0,countobj):
  39. object=GetSelectedObjectByIndex(i)
  40. coords=object.Position()
  41. z=coords[2]
  42. obj.append((z,object))
  43.  
  44. #----------------------------------------------
  45. # Sort them based on each object's Z position
  46. # Then reverse the order to get lowest first
  47. #----------------------------------------------
  48.  
  49. obj.sort()
  50. obj.reverse()
  51.  
  52. #----------------------------------------------
  53. # Work through the objects one at a time
  54. # dropping them
  55. #----------------------------------------------
  56.  
  57. for i in range(0,countobj):
  58. objx=obj.pop()
  59. SelectOnly(objx[1])
  60. Drop()
  61.  
  62. #----------------------------------------------
  63. # Refresh Vue's Display
  64. #----------------------------------------------
  65.  
  66. Refresh()
  67.  
  68. #----------------------------------------------
  69. # End of Script
  70. #----------------------------------------------