RE: Lua - prompt and wait for selection?
2021-10-04, 21:35 (This post was last modified: 2021-10-04, 21:38 by Roland Melkert.)
2021-10-04, 21:35 (This post was last modified: 2021-10-04, 21:38 by Roland Melkert.)
(2021-10-04, 1:12)David Manley Wrote: I'm wondering about adding to the API the ability to query the clock "tick" unit size for an animation. Knowing this metric would help make some calculations when working out how far through an animation the current time represents.
While using getFrameTime() / getLength() does give the proportion, the challenge I'm facing is getting the 4 bar linkage working when using the "set interval start" at something other than the start of an animation. Knowing the clock "tick" unit size (which differs for normal speed vs slow speed) should enable me to work out the change of angles required between frames.
An animation 'frame' event should be self contained, meaning it should render the scene at a certain point in time without knowledge of what happened before.
This because the call can be for any random frame at any time resulting from: skipping, playing backwards, speed changes, etc.
I'm also playing with the thought of making it multi threaded to allow for more complicated animations needing more then 40ms of work per frame.
That said, you are free to ignore all that and use the incremental approach and use
getLength()/getFrameCount()
To get the 'frame tick' you are looking for.
Or do you mean something else with 'tick'?
Or maybe you where expecting getFrameCount to be .e.g 25 no matter the current play mode.
From the documentation:
"Do note the number does not have to be equal to fps*length as it accounts for extra frames resulting from things like slow motion"
edit:
Or do you need the current interval settings (ofs, length)?
Those are currently not available, I could add them though.