Thanks Vlado!
The gpuCache’s readSample() methods are using seconds as time values unfortunately. Only thing I’d need to adapt is the 2 frame offset you’re using to subtract (2/FPS) seconds. Just need to figure out whether it uses a constant FPS internally or Maya’s currently set units, I’ll currently be testing:
double two_frames_in_seconds = MTime(2.0, MTime::uiUnit()).as(MTime::kSeconds);
Now all I need to get working is having the gpuCache read the length of the animation.
Somehow it never updates if I put it in the getCachedGeometry() method like so:
cacheReader->readAnimTimeRange(fCacheAnimTimeInterval);
This gpuCache code is making my head explode.
Without knowing the length of the cache all that works is offsetting the animations, not the looping/ping-pong.