Need Maxscript help reading values from a csv

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So here's my code. I need to read in values from a *.csv and make an object move up and down while rotating. Essentially I'm trying to have a box bob up and down on a sinusoildal wave created from another program.
(
AssyFile = openfile "C:\Documents\3dsMaxDesign\Scripts\\MotionTest.csv"
set animate on
if (AssyFile != undefined) then
(
skiptonextline AssyFile
select $Box001
while not eof AssyFile do
(
TransformName = readdelimitedstring AssyFile ","'
XRot = readValue AssyFile
ZTrans = readValue AssyFile
sliderTime = 0
max set key keys
sliderTime = sliderTime + 15
move $ [0,0,ZTrans]
rotate $ (angleaxis XRot [1,0,0])
)
)
else
(
messageBox "Open Failed" title:"Error!"
)
)
My spread sheet reads like this
TransformName | XRot | ZTrans |
1 | 10 | 1 |
2 | 10 | 1 |
3 | 10 | 1 |
4 | 10 | 1 |
5 | 10 | 1 |
6 | 0 | 0 |
7 | -10 | -1 |
8 | -10 | -1 |
9 | -10 | -1 |
10 | -10 | -1 |
11 | -10 | -1 |
12 | 0 | 0 |
I get this error
--Syntax error: at end of script, expected end of literal
--In line: )
I've no idea what this means or what's wrong. Any help?