Open PockPocket opened 1 year ago
Hi Mathieu,
I'm not sure why the two options are grayed-out, but here is the place where loading of frames happens for Timeline-based animation and where you should implement the playback logic you want.
You can adjust the speed of the clip e.g. by introducing a speedUpFactor
property like in the example below (you could define a similarly named speedUpFactor
property also on Record3DPlayback
, which you could access from within R3DVideoBehaviour
by calling input.endLocation.speedUpFactor
; the speed-up factor property could be manually specified in the scene inspector).
double speedUpFactor = 5.0;
int frameIdx = (int)Math.Round(speedupFactor * playableInput.GetTime() * input.endLocation.fps);
Or instead of using speedUpFactor
, you could directly compute the current frame index based on where in the Clip is the animation playhead currently located; the speedup would then be defined by how much you stretch the Clip in the Timeline:
var clipDuration = playableInput.GetDuration(); // Duration of the clip in the Timeline
var currClipTime = playableInput.GetTime(); // The time at which the playhead is located (relative to the start of the Clip)
double percentageOfVideo = currClipTime / (clipDuration == 0.0 ? 1.0 : clipDuration);
int frameIdx = (int)Math.Round(percentageOfVideo * input.endLocation.numberOfFrames);
Hey, I'm trying to set one of the Record3D clip from my scene in slow-motion via the timeline but the option is greyed out:
Do you have any alternative to set individual .r3d clips in slow-motion ? Thanks a bunch, Mathieu