Notifications
Clear all
[Closed] Error in CSV reading script
Apr 18, 2012 4:15 pm
I’m getting an error in the “theDummy.position.controller.percent = (readValue theFile)” line: “Unknown Property: “Position” in undefined”. I have tried using .pos as well and keep getting the error.
What I’m trying to do is read a CSV file that I’ve calculated the “Time” and “Percent” along a path with. This script should automatically insert those values in the animation, but obviously I’m getting an error. Any ideas?
(--start a local scope.
--pick the file:
local 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
local theDummy = Dummy005 --set dummy
while not eof theFile do ( --loop until the end of tile
theTime = (readValue theFile) --read the time
with animate on --enable autokey animation context
at time theTime --set the current time for the following expression
theDummy.position.controller.percent = (readValue theFile)
)--and read the percent from the file for each time step
close theFile --close the file when done
)--end if
)--end script
3 Replies
Apr 18, 2012 4:15 pm
I think you forgot a dollar sign ($) in this line:
local theDummy = Dummy005 --set dummy
Assuming that an object named Dummy005 exists, it should be:
local theDummy = $Dummy005 --set dummy