Object Sequence Save

This script is the Ying of Object Sequence Load Yang. It exports a sequence of numbered files from Vue of the selected objects in Vue in one of the 3d file formats Vue can export. A file will be created for each frame over a range of frames or at given intervals.

  1. #******************************************************
  2. # Export a sequence of files for an objects for each
  3. # frame of an animation
  4. #
  5. # - objectsequencesave.py
  6. # - By Mark Caldwell
  7. # - Version 0.1.0
  8. # - 8th September 2009
  9. # - Copyright Mark Caldwell 2009
  10. # - Tested with Vue 7.5 Infinite
  11. #
  12. # How to use in 3 easy steps
  13. #
  14. # 1. Download this file onto your computer
  15. #
  16. # 2. Edit the script to change output_directory. This should
  17. # be the full path to where you want to save the files
  18. #
  19. # Make sure the directory you want to save to exists.
  20. # If it doesn't the files will not be saved.
  21. # On windows you'll need to use / in the directory path
  22. # instead of \
  23. #
  24. # Also edit the format you want to save in 3ds, c4d, dxf,
  25. # lwo, obj, shd or vob
  26. #
  27. # Also change startframe and endframe
  28. #
  29. # If you don't want a file for every frame change stepframe
  30. #
  31. # 3. Select the objects to be exported. Then run script and
  32. # wait for it to work supplying responses when prompted.
  33. #
  34. # To run it go to Python -> Run Python Script
  35. # Then locate the file on your computer
  36. #
  37. # Do not run using quick load options
  38. #
  39. # Conversion options are those currently selected under
  40. # File -> Export As
  41. #
  42. #******************************************************
  43.  
  44. #----------------------------------------------
  45. # Configuration: Set these to alter end result
  46. #----------------------------------------------
  47.  
  48. # Change the line below to change where files are saved
  49. # see instructions above for more details
  50.  
  51. output_directory='C://foo/savedirectory'
  52.  
  53. format='obj'
  54. startframe=0
  55. endframe=5
  56. stepframe=1
  57.  
  58. #---------------------------------------------------
  59. # Main Script Body
  60. #---------------------------------------------------
  61.  
  62. import os # import os libraries
  63. import sys
  64.  
  65. # Load objects
  66.  
  67. if os.path.isdir(output_directory)==True:
  68. for frame in range(startframe,endframe+1,stepframe):
  69. filename=output_directory+'/'+str(frame)+'.'+format
  70. ExportObject (filename)
  71. Message('Files Exported')
  72. else:
  73. Message('Output Directory Doesn\'t Exist')
  74.  
  75. Refresh()

impworks © Copyright Mark Caldwell 1996 - 2017