Any way to import numbers into the timeline or...

I want to make a node oscillate or swing like a pendulum. I can use matlab, for example, to generate the positions for the node at each time step and then copy one number at a time and paste it into the node parameter being animated. This is very tedioous and error-prone.  Surely there must be some way to import a list of numbers and have them populate one line (parameter) of the time line? If not, are there functions in DS where I can input a starting position at one frame and an ending position at the final frame and have DS automatically compute the positions of the frames between? E.g. I have an object I want to rotate between -5 degrees and +5 degrees over 31 frames but I want the motion to be sinusoidal. In matlab the numbers could be generated like this:

% generate 31 evenly spaced numbers between 0 and pi inclusive, ie x(1) = 0,  x(31) = pi. x(n) = (n-1)*pi/30.

>> x = linspace(0,pi,31);

% multiply the cosine of x by -5

>> d = -5*cos(x);

Then d contains the 31 positions of the rotation which starts slowly at frame 1 accelerates to hit maximum velocity at frame 17 then decelerates to a stop at frame 31.

Any idea how to import d into a time line say as a text file?  Can DS be instructed to fill in the timeline with a function of the time?

Thanks!

Comments

Sign In or Register to comment.