Search Unity

No blending between frames in the same animation (fake stop motion)

Discussion in 'Animation' started by Waliactico, May 28, 2014.

  1. Waliactico

    Waliactico

    Joined:
    Jan 16, 2013
    Posts:
    91
    Is it possible to disable blending between frames in the same animation? I mean, I have a walk loop with 5 frames, and I want it to be played simulating stop motion, without any blending applied between a frame and the next.
    Think of it as 2D animation and sprites, to get something like that with a 3D model.
    If I decrease the animation speed in mecanim animator controller, it blends all the frames, and the animation looks fluid, and I want it to be totally "unfluid".
    Thank you for your time!
     
  2. Waliactico

    Waliactico

    Joined:
    Jan 16, 2013
    Posts:
    91
    anyone?
     
  3. EmoSaru

    EmoSaru

    Joined:
    Dec 31, 2012
    Posts:
    19
    I'm not familiar with the animation codec used by Mecanim, but it's fairly likely that you'll need to achieve this effect in your source data. Are you using animations that you have the source data for? I'm not sure how well Unity/Mecanim respects this, but if you do have the source data, you should check to see what the actual curves look like on the joints. In most DCC tools, you should be able to adjust square off the curves on each frame, at which point Mecanim may do what you're looking for (depending on whether or not the importer respects discontinuities).
     
  4. TMPxyz

    TMPxyz

    Joined:
    Jul 20, 2012
    Posts:
    766
    I think you could have a look at this thread and the blog TreasureMap referenced.
    http://forum.unity3d.com/threads/248655-Animation-Interpolation-Jerk

    Assume there is an abrupt change between frame 5 6, and you don't want to see interpolation between them.
    You could modify the script in the blog to affect all bones of your character, use it at the frame 5;
    Or you could just use animation event at frame 5 to jump to frame 6
     
  5. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Hi WaLiactico,


    You could try with step key

    stepkey.png

    You can create step key either in your prefered authoring tool(max, maya, etc...) or create them directly in to the animation tool, simply create a key a set left and right tangent mode to constant. This way you are controlling the blending between each keyframe the way you want.
     
    Unicorn-slayer likes this.
  6. TMPxyz

    TMPxyz

    Joined:
    Jul 20, 2012
    Posts:
    766
    Hi, I have tried with constant in 4.3 on camera rotation, but there is still visible interpolation.
    Like in the example scene in the blog http://japan.unity3d.com/blog/?p=290
    Is there some setting in animation view that can eliminate such interpolation?
     
  7. Waliactico

    Waliactico

    Joined:
    Jan 16, 2013
    Posts:
    91
    Are those curves available in mecanim? I can only find them in legacy animation.
    Either way, manipulating those key frames is an enormous task, if I have to check EVERY key of EVERY bone of EVERY animation... This is the only way to do it?

    Again, adding an event on every key, is an endless task. Is there something I'm missing with these events?
     
  8. TMPxyz

    TMPxyz

    Joined:
    Jul 20, 2012
    Posts:
    766
    If you could accept small jitters, then maybe you could try making the animation with step key.
    There will be some visible jitters at each turn though.
    t03.gif
     
    Last edited: Jun 3, 2014
  9. Waliactico

    Waliactico

    Joined:
    Jan 16, 2013
    Posts:
    91
    Sorry for my ignorance, but I don't know what is step key (neither does google XD)
     
  10. TMPxyz

    TMPxyz

    Joined:
    Jul 20, 2012
    Posts:
    766
  11. Waliactico

    Waliactico

    Joined:
    Jan 16, 2013
    Posts:
    91
    Right, I know what step tangents are, but:
    1) Are they editable with mecanim? I only know how to edit them in legacy animation
    2) Is there any way to force Unity to set all keys to step tangents, or automatize this step tangent changing process? say this because changing the tangents to step tangents manually is not an option (there are so many of them...)
     
  12. TMPxyz

    TMPxyz

    Joined:
    Jul 20, 2012
    Posts:
    766
    They're editable if you made them into Legacy or Generic rig type, and you need to duplicate the animation data from the fbx file.

    But that's not important, you're asking for fastest method to resolve all keys to step tangent.

    The fastest way is to write a script to change all the keys in all the specified animations to step tangent;
    A slower way is to use 3dsmax's curve editor, you could select all the keys in an animation and change them to step tangent;
     
  13. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    You are right TMPxyz,

    so either you create a script that does the job for you, or you go back to your authoring tool and change all your tangent for your clip