Dave_Hingley
09-13-2005, 10:05 AM
I am using maxscript to automate some boring stuff. The script takes a source destination and a target destination on each file and export each file to the destination directory
the problem i am getting is that after about half a dozen or so small test files maxscript brings up an Rollout Handler exception: Unknown system exception.
I have tried checking the heapsize and adding GC() to the end of the script. but that hasn't worked..
here is the script i got at the moment :
suffix = "_stable"
togo=""
gofrom=""
utility batch "Batcher" width:162 height:370
(
group "File Settings"
(
button btn1 "Select source directory"
label source ""
button btn2 "Select Destination directory" enabled:false
label dest ""
)
-- event handlers
on filenamesuffix entered text do
(
filenamesuffix.text = text
print filenamesuffix.text
suffix = filenamesuffix.text
)
on btn1 pressed do
(
--Select source directory
sourcefiles = getSavePath caption:"Select Source Directory Containing .FBX files"
source.caption = sourcefiles
btn2.enabled = true
gofrom = sourcefiles
print gofrom
)
on btn2 pressed do
(
--Select Destination directory
targetfiles = getSavePath caption:"Select Destination Directory For .FBX files"
dest.caption = targetfiles
togo = targetfiles
print togo
)
on btn4 pressed do
(
--MessageBox "button Pressed"
type = "\\*.fbx (file:///*.fbx)"
files = getfiles (gofrom + type)
If files.count != 0 then
--run the batch
for f in files do
(
resetMaxFile #noPrompt
importFile f #noPrompt
max views redraw
fileIn "script.ms"
--perfom some housekeeping functions parent the imported objects and delete some not needed
--make the new filename
exportFile (togo + "\\" + getFilenameFile f + suffix + ".FBX")#noPrompt
)
--error trap an empty folder
else
MessageBox "no .FBX Files in source directory doofus!"
)
)--end of file
Any idea whats happening?
the problem i am getting is that after about half a dozen or so small test files maxscript brings up an Rollout Handler exception: Unknown system exception.
I have tried checking the heapsize and adding GC() to the end of the script. but that hasn't worked..
here is the script i got at the moment :
suffix = "_stable"
togo=""
gofrom=""
utility batch "Batcher" width:162 height:370
(
group "File Settings"
(
button btn1 "Select source directory"
label source ""
button btn2 "Select Destination directory" enabled:false
label dest ""
)
-- event handlers
on filenamesuffix entered text do
(
filenamesuffix.text = text
print filenamesuffix.text
suffix = filenamesuffix.text
)
on btn1 pressed do
(
--Select source directory
sourcefiles = getSavePath caption:"Select Source Directory Containing .FBX files"
source.caption = sourcefiles
btn2.enabled = true
gofrom = sourcefiles
print gofrom
)
on btn2 pressed do
(
--Select Destination directory
targetfiles = getSavePath caption:"Select Destination Directory For .FBX files"
dest.caption = targetfiles
togo = targetfiles
print togo
)
on btn4 pressed do
(
--MessageBox "button Pressed"
type = "\\*.fbx (file:///*.fbx)"
files = getfiles (gofrom + type)
If files.count != 0 then
--run the batch
for f in files do
(
resetMaxFile #noPrompt
importFile f #noPrompt
max views redraw
fileIn "script.ms"
--perfom some housekeeping functions parent the imported objects and delete some not needed
--make the new filename
exportFile (togo + "\\" + getFilenameFile f + suffix + ".FBX")#noPrompt
)
--error trap an empty folder
else
MessageBox "no .FBX Files in source directory doofus!"
)
)--end of file
Any idea whats happening?
