• Unity
  • Timeline and Director pause change

  • संपादित
Related Discussions
...

Hi,

I just upgraded to spine 4.0 and noticed an "issue" with the latest timeline, caused by this commit:
https://github.com/EsotericSoftware/spine-runtimes/commit/6d9e3e7e19807c016a3480c196027036d291744e#diff-570e7f59fc7aa8b3273a6246d74a970fa077683c55b5f9c8c4279a781bd09752

What I have been doing so far is to use the timeline with spine, then hold the spine animation and then pause the director, while waiting for user input. When the user input is received I resumed the director and continued the timeline animation (including the spine animations). For such moments in the timeline I used some small loop spine animations on the characters on screen. It worked nice until the above commit, where the scene now looks like frozen.

As I understand it, the behavior I was dependent on was a bug and it worked just by accident. For this reason I have created a commit to introduce an option to revert back to way it was working previously.
Please check this commit:
https://github.com/vhristov/spine-runtimes/commit/cd3d8e33599f4c7cd217ee490a0d766b422800a4

If you guys are interested in such a change, I can create a pull request.

P.S. I don't really like the property name I introduced, but so far I was not able to come with a better one...
P.S2 I would prefer to not using a fork and keep everything in sync with what is available in the spine-runtimes repository, so if the change is not acceptable, could you suggest a work around I could use

+1

It is very common to have a timeline controlled cutscene paused for some character dialogues. During the pause, characters should keep playing it idle loop animation instead of completely frozen. I didn't update my timeline for quite sometime but I think my project is also being affected by this.

As it seems like I am not the only one with this issue, I have decided to go and directly open a pull request.

You are absolutely right that this "bug" has been pretty useful. Thanks very much for opening a pull request, we have merged it to the 4.0 branch. We added some minor cosmetic modification: moved the property up, changed Dont to Don't and added a tooltip text. We also could not come up with a better name for the property, but while it's not elegantly named, it describes precisely what it does.

A new 4.0 timeline UPM package is available for download here:
Spine Unity Download
Thanks for reporting!

Harald लिखा

moved the property up, changed Dont to Don't and added a tooltip text.

Definitely looks better and the tooltip is a nice addition. These "minor" modifications solved two of my biggest issues with the proposed changed:

  • I didn't like the "dont"
  • It wasn't clear enough - solved by the tooltip

Thanks Harald!

Pleasure was mine, you already did the major part of the work! :nerd:

3 वर्ष बाद में

Hi @Harald , I'm using this feature. But I have one problem when the I resume the director the animation a little interrupted. I'm understand that it's trying to play at frame where it was resume, even though, I hope there could be a solution to avoid the interrupted when resume. Are there anything I can do?

  • इस पर Harald ने जवाब दिया।

    nam_nguyen But I have one problem when the I resume the director the animation a little interrupted.

    What do you mean by that, could you please describe it in more detail? Or could you show a video that shows this issue?

    Sorry I can't send the video here, but you can reproduce by using dontPauseWithDirector with the loop option. Enter play mode in unity edtior, play that animation with play button in timeline window, click pause button while it come inside that animation. In this time, the animation still loop, and then click next frame button (multiple time but not fast) while that animation is playing. You can see the interruption.
    What I have in mind that, when the animation is playing at frame 50 of animation, and you click next frame button, it will play that animation at frame we paused previously (Ex frame 10)

    @nam_nguyen You can always send us confidential material to contact@esotericsoftware.com if you are not allowed to share it publicly.

    The issue you described seems to be a problem in the Unity Editor play mode when playing and pausing with the Timeline window controls only (which has FrameData.seekOccurred set to true although only play was triggered and no seek happened). This issue does not seem to happen when playing and pausing via normal script code like the following:

    PlayableDirector director = this.GetComponent<PlayableDirector>();
    director.Pause();
    director.Play();

    Please always be sure to test Timeline behaviour with actual scripts or even better an actual player build, as within the Unity Editor things might be previewed incorrectly.

    • इस पर nam_nguyen ने जवाब दिया।

      Harald I shared the reproduce step by Timeline window because it's the most clarify way to see that problem. Of course, the first time I encounter that behaviour is when I pause the timeline via code.
      Here's my logic:
      director.Pause()
      yield return new WaitForSecond(second)
      director.Resume() //it happen in here

      @nam_nguyen This issue did not occur on our end with the respective code. Which exact version of the spine-unity runtime and which version of the Spine Timeline UPM package are you using?