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.

[codesyntax lang=”python”]

#******************************************************
# Export a sequence of files for an objects for each
# frame of an animation
#
# - objectsequencesave.py
# - By Mark Caldwell
# - Version 0.1.0
# - 8th September 2009
# - Copyright Mark Caldwell 2009
# - Tested with Vue 7.5 Infinite
#
# How to use in 3 easy steps
#
# 1. Download this file onto your computer
#
# 2. Edit the script to change output_directory.  This should
#    be the full path to where you want to save the files
#
#    Make sure the directory you want to save to exists.
#    If it doesn't the files will not be saved.
#    On windows you'll need to use / in the directory path
#    instead of \
#
#    Also edit the format you want to save in 3ds, c4d, dxf,
#    lwo, obj, shd or vob
#
#    Also change startframe and endframe
#
#    If you don't want a file for every frame change stepframe
#
# 3. Select the objects to be exported. Then run script and
#    wait for it to work supplying responses when prompted.
#
#    To run it go to Python -> Run Python Script
#    Then locate the file on your computer
#
#    Do not run using quick load options
#
# Conversion options are those currently selected under
# File -> Export As
#
#******************************************************

#----------------------------------------------
# Configuration: Set these to alter end result
#----------------------------------------------

# Change the line below to change where files are saved
# see instructions above for more details

output_directory='C://foo/savedirectory'

format='obj'
startframe=0
endframe=5
stepframe=1

#---------------------------------------------------
# Main Script Body
#---------------------------------------------------

import os                       # import os libraries
import sys

# Load objects

if os.path.isdir(output_directory)==True:
    for frame in range(startframe,endframe+1,stepframe):
        filename=output_directory+'/'+str(frame)+'.'+format
        ExportObject (filename)
    Message('Files Exported')
else:
    Message('Output Directory Doesn\'t Exist')

Refresh()

[/codesyntax]

impworks © Copyright Mark Caldwell 1996 - 2024