Saving in Slate Cutscene Preview sometimes saves actor positions

Forums 💬 Slate Sequencer ⚙️ Support Saving in Slate Cutscene Preview sometimes saves actor positions

  • This topic has 0 replies, 2 voices, and was last updated 8 years ago by b4th.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20900
    b4th
    Participant

      Not 100% reproducible, but sometimes, when saving a scene by pressing ‘Ctrl-S’ while Slate is still in cutscene preview, the scene will save actor and animator skeleton positions at that moment in the timeline. If Mecanim animation is being done using root motion, and characters are saved in different positions from when the cutscene was authored, then characters will likely start their animations in those, incorrect, positions.

      Can Slate exit preview before a Save operation is carried out?

      Perhaps this AssetModificationProcessor hook can be used?
      http://answers.unity3d.com/questions/175931/perform-action-on-saveload-in-editor.html

      #20903
      b4th
      Participant

        So I’ve put together a sample project which consistently reproduces the issue. It’s a blank scene with a character, and a slate cutscene, which moves the character under root motion with a walk animation.

        If the cutscene is previewed, the walk animation is paused halfway, and the scene is then saved, the scene will be saved with the actor in that position. If Unity crashes (or the user does not save again) after stopping the preview, the actor’s position will not be reverted. Likewise, if the user decides to QUIT Unity while previewing the animation, and DOES choose to save at that point, the same problem will occur – this is perhaps the more likely problem scenario.

        @Gavalakis – would it be useful to share this sample project with you?

        #20902
        Gavalakis
        Keymaster

          Hey,

          Sorry for the late reply!
          Properly handling scene saving has already been added for the next version. (cutscene is now reverted before the scene is saved automatically).
          This only work for Unity 5.6+ though, since Unity added a nice callback for when scene is about to be saved in version 5.6.

          If you want to modify the source code now and add this change and not wait for the next version, please open up CutsceneEditor.cs and:

          1) In OnEnable() method add this code in the beginning:

          2) In OnDisable() method add this code in the beginning as well:

          3) Add the following method somewhere in the CutsceneEditor.cs class:

          If you have any trouble making the changes, let me know and I can send you over the update to your email.

          Thanks!

          #20901
          b4th
          Participant

            This is great news, and many thanks for the code samples!

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.