CSV import and visibility control
Hello
I imported coordinates from a CSV file and at every point I created a box. I want to control visibility by hiding one box at every frame. THe code I have so far is attached below. If this can not be done then I would love someone to direct me on how to import a point and create a box there at every keyframe until all points imported.
Thanks in advance
theFilename = getOpenFileName types:"Comma Separated Values (*.CSV)|*.CSV|All Files (*.*)|*.*" if theFilename != undefined do ( --if a valid filename picked local theFile = openFile theFilename --open the file while not eof theFile do ( --loop until the end of file Box pos:(Point3 (readValue theFile) (readValue theFile) (readValue theFile)) ) ) Select $box* animationrange = interval 1 selection.count !REG3XP1!>startTime = 0 endTime = selection.count nthFrame = 1 for i in selection do ( for t in startTime to endTime by nthFrame do ( animate on at time t ( if i=t then i.visibility = False ) ) )
Comments
...
The import part looks fine, but the anim part...
First some notes - in the loop "for i in selection..." the "i" variable hold Node, while in second "for t ...", "t" hold TimeValue, so comparision like "i=t" has no sense :)
And the whole question is a bit unclear... You want to animate the visibility. If it in a time row like - box1 is invisible at time 0 and visible in time 1 and to the end of the animation, t.e. only 2 anim keys; next - 2nd obj (box2) is invisible as well and become visible at time 2, and so on, then...
cheers!
my recent MAXScripts RSS (archive here)