Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. We're running great holiday deals on subscriptions, swag and Asset Store packages! Take a peek at this blog for more information!
    Dismiss Notice
  3. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  4. Unity 2017.2 is now released.
    Dismiss Notice
  5. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  6. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  8. Unity 2017.3 beta is now available for download.
    Dismiss Notice

PlayableBehaviour doesn't receive a ProcessFrame call for last frame of the clip

Discussion in 'Timeline' started by jwvanderbeck, Nov 9, 2017.

  1. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    287
    Pretty much what the title says :)

    If I override ProcessFrame in the PlayableBehaviour it appears to get called for every frame EXCEPT the last one.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    176
    Timeline clips are inclusive on the first frame and exclusive on the last frame. By that I mean a clip that starts at 2 seconds and has a duration of 2 seconds will be active up to, but not including, 4 seconds.

    The reasoning behind this is predictability of adjacent clips. If a second clips starts at 4 then we don't want both active when the playhead is exactly at 4.
     
  3. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    287
    How do we handle the last frame of the animation then?

    We have a custom camera component that gets added to the same GameObject as the Unity camera. This custom camera component connects to our back end pipeline and pulls per frame animation data. The component has a currentFrame field which when set pulls that frame's data from the pipeline and updates the GO's transform, the Unity Camera's FOV, as well as other data.

    This all works ok on its own, and now I am trying to hook it up to Timeline. As the clip plays or is scrubbed, I update the currentFrame field on the custom camera. This seems to work well, though I was having problems figuring out the proper frame initially, but your replies to the other post should help with that so thanks!

    Problem is that since ProcessFrame doesn't get called for the last frame, the camera never gets its last frame of animation updated.
     
  4. Daemonhahn

    Daemonhahn

    Joined:
    Oct 5, 2013
    Posts:
    237

    Is this mentioned anywhere in the documentation, and if so can you please link to where?

    If not, please make sure the relevant colleague is notified of the needed amendment ASAP, thank-you! :)