Search Unity

  1. Going to #UniteBerlin? Bring a buddy & get 25% off the 2nd ticket! More info here.
    Dismiss Notice
  2. Famed game designer and creator of The Sims, SimCIty, and Spore is looking for a 3D artist to join their team. Join the challenge.
    Dismiss Notice
  3. Unity 2017.4 has arrived! Read about it here.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. We've opened a new World Building sub-forum to faciltate all your world building discussions! Drop in and ask any ProBuilder, ProGrids, or PolyBrush questions.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Feedbacks for experimental feature: GameObjectRecorder (2017.1)

Discussion in 'Animation' started by RomainFailliot, Apr 24, 2017.

  1. RomainFailliot

    RomainFailliot

    Unity Technologies

    Joined:
    Nov 29, 2016
    Posts:
    56
    I haven't received a bug for it yet, and I must admit I don't really understand this 50 frames bug. There is nothing forcing the recording at 50 frames per second (AFAIK). If you're having this bug, please report a bug with a project in it so that it's easy to reproduce. The easier it is, the faster it'll be fixed.

    The only related bug I do have though is that the GameObjectRecorder is sampling at 60 frames per second, and it would be nice to let the user set its own FPS.
     
  2. Velcrohead

    Velcrohead

    Joined:
    Apr 26, 2014
    Posts:
    66
    Unfortunately I can't submit the project due to NDA. 50 frames is just what I recognised above, my team's first interpretation of it was that it was just sampling once every second. It only seems noticeable when we are turning objects on and off. I

    I guess that doesn't help much but I thought I'd mention it!
     
  3. RomainFailliot

    RomainFailliot

    Unity Technologies

    Joined:
    Nov 29, 2016
    Posts:
    56
    @Velcrohead I completely understand the NDA problem. I'll try to find this bug considering your description and @Crazy-Minnow-Studio's.

    That being said I don't have much information about it. Re-reading the previous posts, it seems to be recording at 50 fps when recording blendshapes. Whether you use Update() or LateUpdate(), the result is the same. Is that it? Do you have more information to share maybe?
     
  4. jilt

    jilt

    Joined:
    Nov 7, 2014
    Posts:
    39
    I don't know if it's related, but 1-2 months ago when I recorded blendshapes with this, it appeared to be fine until reopening the Unity project, then the recorded animation went to 1 fps.
     
  5. Velcrohead

    Velcrohead

    Joined:
    Apr 26, 2014
    Posts:
    66
    Yeah absolutely, thank you for the help.

    We have a hierarchy of a lot of objects, and I am binding the transform of each child, along with the isActive property. The objects are all mechanical so the animations are usually pretty straight forward, just moving and rotating.

    The actual movement is being run by coroutines in play mode, and the recorder is saving the transforms. The transforms themselves seem to be running fine and accurately. When we turn change a gameobjects activity though, it seems to sometimes lag behind.

    For example, an arm reaches down to pick something up. Something is supposed to turn off as it lifts it up immediately, but there is about a second delay before it toggles.

    Looking through the animation, it seems like the animation is only taking key frames of the isActive property every second (or 50 frames as described above), whereas we were expecting it would do it frame by frame. We are calling TakeSnapshot every frame on the LateUpdate as it does on the documentation page.

    Hopefully this is of some use!
     
  6. RomainFailliot

    RomainFailliot

    Unity Technologies

    Joined:
    Nov 29, 2016
    Posts:
    56
    Thank you @Velcrohead

    There are a bunch of passes that are done before saving the animation. One of those is the key reducing pass.
    That's why even if you take a snapshot at every frame, it's possible that some keys are "reduced" in the end.

    That being said, this key filtering has a low threshold, so it doesn't lose much data (i.e. it does test the keys with an epsilon, but the epsilon is very small). It may be that there is a bug in the key reducer though. I'll look into that too.
     
    Last edited: Apr 16, 2018 at 7:14 PM
  7. Velcrohead

    Velcrohead

    Joined:
    Apr 26, 2014
    Posts:
    66
    Thank you for your swift responses, Romain. Really appreciate your help :)

    I assume any fixes you might potentially make would have to wait for a new Unity update?
     
  8. RomainFailliot

    RomainFailliot

    Unity Technologies

    Joined:
    Nov 29, 2016
    Posts:
    56
    Sadly, yes. I'd like to make a package out of the GameObjectRecorder, but it still needs internal functions that can't be exposed as is.
     
  9. Velcrohead

    Velcrohead

    Joined:
    Apr 26, 2014
    Posts:
    66
    Okay so I think I have a workaround.

    We have seriously long animations that needed to be recorded - with a complex hierarchy (one of the animations is an hour long). I'd split the recording into clips of 180 seconds which is when the accuracy seemed to be lost (taking a keyframe every 50 seconds).

    I've reduced the clip times to 15 seconds and it's pretty much perfect now.

    TLDR ; reduce the clip lengths
     
  10. RomainFailliot

    RomainFailliot

    Unity Technologies

    Joined:
    Nov 29, 2016
    Posts:
    56
    @Velcrohead: On my side, I've been digging in our code and found something as well. The "one key every 50 frames" is actually a limitation on our side. In order to prevent an n^2 algorithm to take too long, we decided (a loooong time ago) to arbitrarily limit the number of keys reduced in the same batch, and this limitation is at 50 frames.

    The good news is that, although the key reducer doesn't reduce all the keys, it doesn't destroy the data either. In other words, the key reducer could be more effective, but it doesn't change what's been recorded.

    Now that the "one key every 50 frames" behaviour has been eluded, I'd like to know more about your bug. Why did you need to reduce the clip time? if the clip time is greater than 15 seconds, you start losing data?
     
  11. Velcrohead

    Velcrohead

    Joined:
    Apr 26, 2014
    Posts:
    66
    15 was just an arbitrary number I was using to see if it would make a difference (as its a signifcant change from 180). It was only a fleeting thought which I decided to follow up on, but seemed to make the difference!

    There are a lot of objects being animated in the scene, I guess I thought it might be trying to optimise it behind the scenes if it was too much data.
     
  12. RomainFailliot

    RomainFailliot

    Unity Technologies

    Joined:
    Nov 29, 2016
    Posts:
    56
    It's ok, 15 seconds or 25 doesn't really matter at this point ;)

    I'd really like to know what's happening at 180 seconds and above though. Could you take a screenshot of your bug without breaking the NDA, like the curves in the animation window?

    Thank you