Can't prevent reset after Cinematic stopped

I use a Cinematic to transform multiple objects in my scene (move and scale). After the Cinematic has finished, I need the objects to keep their final transform, but unfortunately the Cinematic resets all its CinematicEvents to time 0 in its onStop() method. As far as I can see there is nearly no way to prevent this reset of the Cinematic at its end. Even extending from Cinematic brings me no further, because the internal list of CinematicEvents is private and therefore out of reach.

Is there any way I can prevent the unwanted reset?

Plan B

If there is no other solution to this problem (or just hillarious hacks), then I have another proposal.
After looking at the current implementation of Cinematic and AbstractCinematicEvent I would suggest to change the reset behavior of these components. Instead of setting the time to 0 in the stop() / onStop() method, it should be done in the play() method.

public void play() {
    if (playState == PlayState.Stopped) {
        setTime(0f);
    }
    [rest as before]
}

With this change the old behavior would be nearly the same as before. The only diference would be that the reset after stopping the Cinematic just occurs at the next call of the play() method. If a developer really needs the old reset behavior, it could be done easily by using a CinematicEventListener that calls cinematic.setTime(0f) in its onStop() method.

(If my suggested change is needed and wanted I can provide a pull request for it.)

On the one hand, cinematics weren’t really designed for this, I guess. (I think maybe the original designer even would revisit a lot of things if they could by now… but other things have superseded it.)

On the other hand, I think hardly anyone uses them so maybe no one will care if you change it.

Other than that, maybe there is a way to pause it instead of stop the cinematic? I’ve never used them.

If you are ever interested in alternatives then there are more composable animation frameworks available. I’m rather (biased) fond of the one in Lemur… which you can use without the rest of Lemur.

Just in case, Lemur Wiki animation section:

Independent anim package:

1 Like

I looked into Lemurs animation framework, but it looks like I can’t time scedule my transformations. I need a way to start some of them after others has finished or just after a fixed amount of time. Maybe I missed something?

Why do you think that nobody uses the cinematic framework? It gets explained in at least 2 of the books, so I thought it would be more popular. Sure, there is some room for improvements, but the base idea is still really powerfull.

Unless I misunderstand something:

…is a way of sequencing other tweens.

Indeed I didn’t noticed the sequence and the delay function in the Tweens class. Thanks for your help, I will give it a try. :+1: