Search Unity

  1. Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  3. Dismiss Notice

No interpolation with animation

Discussion in 'Animation' started by Trigve, Oct 20, 2014.

  1. Trigve

    Trigve

    Joined:
    Mar 17, 2013
    Posts:
    123
    Hi,
    I just want to ask if it is possible to have a 3D animation but without the interpolation between the key frames. I've searched for this and found this thread http://forum.unity3d.com/threads/no...n-the-same-animation-fake-stop-motion.248520/ which talks about it a little bit. It looks like that it is somehow possible but only using legacy animation. Is it somehow possible in mecanim? Or are there any other options?

    I've read some threads, in which people try to set the constant interpolation in the 3D animation programs but after exporting, there was still interpolation presents.

    Thank You
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,788
    There is a step interpolation in Max that is similar to the results you are after. When I get a chance I'll test it to see if it exports/imports accurately in Unity. I expect it not to work.

    But there is another solution though a tedious one.
    Set keys linearly 1 key at frame 1 where the object doesn't move, copy the 1 key to frame whatever (29) so the object doesn't move from frames 1-29 then move the object to the new position on frame 30.
    Boom - stop motion! :)
     
  3. Trigve

    Trigve

    Joined:
    Mar 17, 2013
    Posts:
    123
    Thanks for the reply,
    That would be great.
    I don't think I understand that.... or do you mean by that, that only specified frames would change the movement/rotation and the others one would stay as "static" (that is, they don't do any change from the previous one)?.
     
  4. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,788

    Yes in Max when you setup linear keys, not bezier or slow/fast in/out, and set a key that has no movement then copy that key to say frame 29, because they are linear keys the object/model will not move. Then on the next keyframe (30) animate the model into the next pose.
    This essentally is stop motion.
    I will test the step function I mentioned before and update this thread but I believe either fbx or Unity converts all key interpolation to linear or smooth on export/import.
     
    Trigve likes this.
  5. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,788
    @Trigve

    I just assumed you were going for a stop motion or a stuttery animation type similar to the building tenants in Wreck it Ralph. Are you trying to get a stop motion look to your animations?

    So I fixed up a crude test to see if this worked expecting it wouldn't because of other comments here and in Answers that hinted at key interpolation converting to linear on export or on import.

    So check it out. It looks like it does work! It looks like Unity keeps the key interpolation from Max.
    Sorry for the crude example and even cruder capture.

    Best view is to download and loop in Quicktime player.

    Capture from Max - https://www.dropbox.com/s/6vzxc03hl82u9la/StepLinear.mov?dl=0

    Capture from Unity - https://www.dropbox.com/s/p23vqfo66tyz2aq/StepCurvesInUnity_.mov?dl=0
    Linear key interpolation on the right and Step key interpolation on the left.


    I'm still not convinced though. I was hoping @Mecanim.Dev would comment on this. He knows more than most about animations in Unity.
     
    ErekT and Trigve like this.
  6. Trigve

    Trigve

    Joined:
    Mar 17, 2013
    Posts:
    123
    Thank you for the reply and for your time and sorry for my late reply (vacation).

    I haven't seen the Wreck it Ralph, but yes, I wanted to achieve something like stop motion look (assuming I interpret the stop motion look term correct). Something like what you get for the 2D sprite animation. So if you have animation with 8 FPS, you get 8 FPS and nothing more or less. And I wanted the same for the 3D animation, so it will render "only" the keyframes, that is, no interpolation.

    I've looked to your videos and it looks like it is working. But I would also want to hear about this topic from the unity developers, because it looks like implementation defined behaviour (?), which could be changed in any moment in the future versions.

    Anyway, thanks again for your time, I appreciate it a lot.
     
  7. ErekT

    ErekT

    Joined:
    Oct 2, 2013
    Posts:
    16
    This is great news. I'm also interested in setting up non-interpolated animations so thanks for testing and sharing :) Just a question; did you get this to work with an fbx file or did you just import a max file directly?
     
  8. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,788
    The example was an exported fbx file with the standard export settings. No key baking. and no key filters. FBX version 2012
     
  9. ErekT

    ErekT

    Joined:
    Oct 2, 2013
    Posts:
    16
    Nice, thanks :)
     
  10. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,300
    I know this is an old thread, but is there a way to do this easily/automatically in Unity directly?

    Literally every animation I make for my game requires no interpolation between frames, and I cannot use the sprite-sheet functionality for part-based cutout animation that simulates drawn frames. Seems like a HUGE oversight to not allow for such basic animation functionality. :(

    The only workaround I can think of to do such a thing automatically in Unity (without tons of time spent tweaking existing animations while still allowing for non-destructive animation editing) is described in this post for Sprites and Bones:

    http://forum.unity3d.com/threads/re...keleton-animation.219915/page-15#post-2728820
     
    Last edited: Jul 29, 2016
unityunity