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
Both importing and generating intervening values could be handled via scripting - Daz Script is a form of EMCA2, like Javascript or Actionscript. However, if you just want even steps then simply changing the inerpolation type to linear in the Timeline should be all you need.
Thank you, Richard. Do you know of any existing scripts to modify the time line that I could use as templates or examples? I am familiar with mCasual's scripts but I am not sure which of them directly modifies the timeline. I would appreciate any suggestions you might have. I doubt that there is another person on the planet that understands DS as well as you do.
I'm pretty sure quite a few people around the forums know mor than me, and I know rob knows vastly more.
I don't immediately see any obviouis samples that deal with setting a key at a time, which is what you want. You'd need to get the node (by seelction or by name/label - see DzScene, find the target property on the DzNode, get the time interval (from DzScene), and then use http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/floatproperty_dz#a_1aecee7e9f5684b3006be9bc637a69df05 or http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/floatproperty_dz#a_1a2b59fcb123e8e1efbe13149d71f1d5b4 to set the desired value at the desired time
Thank you, Richard. That is a help.