Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Manual keyframing workflow (2017.1)

Discussion in 'Animation' started by simonbz, May 16, 2017.

  1. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    109
    Hi everyone!

    So as mentioned previously in the 2017.1 preview feature post in the beta forum, the keyframing workflow has been updated in 2017.1 to address concerns many of you have been sharing with us. Namely, the ability to preview an animation clip without necessarily recording modifications made in the inspector. Please, take a look at the following video for more details:



    Here is the list of changes you'll see in 2017.1:

    Animation Window
    • Timeline feedback (preview/record).
    • Editor play/pause no longer red in record mode.
    • Animation window tab icon changes to a record icon when in record mode.
    • Inspector feedback (rec/preview/modified).
    Scene/Inspector
    • Contextual menu in the inspector (Add Key, Remove Key, Remove All Keys, Key All Modified, Key All Animated, Go to Previous Key, Go to Next Key).
    • Global hotkeys (Key All Animated, Key All Modified).
     
  2. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    Sorry, very late to the discussion here. I want to caveat the below by saying it's clear there was a lot of hard work done here by folks that are clearly passionate about making Unity's animation experience better.

    But I can't help but wonder if it would have been easier to simply have a specific button + keyboard input for "capture keyframe(s)". Something like the Ctrl + K (I think it is) used by Spine to keyframe the current pose.

    All of these new modes within modes seem like they might lead to their own set of new issues :|.
     
  3. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    109
    Thanks! That means a lot :D

    I'm not quite sure I understand your question here. Having preview in the animation window separate from recording is something softwares like Spine also have. Can you clarify your workflow? I'm not sure I understand what "Ctrl + K" is supposed to do.
     
  4. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    NP, let me try to clarify.

    I'm no Spine expert, but when using it I recall they have an Animation vs Design view as well as an autokey vs. manual-key modal toggle. By default autokey is off and you're in Design view.

    So when I "preview" an animation and then make adjustments I'm not automatically keying those adjustments, because autokey is off. To "key" them I press a shortcut or button, I recall it being was Ctrl + K (but that might be Blender...).

    This is pretty simple and the convention I believe, used by other programs like Blender.

    From a UX perspective you guys have added stronger visual reminders that the user is or is not in a mode (preview or otherwise), that's great, but fundamentally you still have the same UX challenge: mode errors.

    The best way to avoid mode errors is to remove the modal UI. Caps lock (modal) versus holding down shift (quasi modal*).

    * as in the user has to hold the key and doesn't forget doing so -- thus no accidental errors.

    If you decoupled "animation mode" (preview) from auto-keyframe you remove the mode and make things less error prone. Once decoupled, you could allow keys to be set / updated by pressing a button (non toggle) or shortcut (such as Ctrl K). This would effectively reframe your UX challenge. It's now intent driven rather than reliant on modes. With that reframe you might find you don't need all of the extra preview adornment and additional mode toggle.

    Hopefully that helps.

    NOTE: Very possible I'm misunderstanding the problem you guys are trying to solve :).
     
  5. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    109
    Thanks for the explanation!

    You can also use hotkeys when keyframing in Unity. As such, pressing 'K' will let you key all animated channels while 'Shift-K' will let you key all modified channels. However, we are aware this does not work for non-animated channels. As we are unaware of what you want to key, you need to directly add these channels to the animation clip in order for them to be keyable. To solve these issues, softwares like Motion Builder or Blender will use keying groups that will let you specify what channels you want to key on a selection. We are still exploring how this could work in Unity.

    Still not sure I understand that last part... I'll try and shed some lights on how things work internally. Preview and Record are not two separate modes per se. You should see Preview as the only mode there is, effectively telling the selected game object hierarchy to display its animated pose rather than its current scene pose. Record (since 2017.1) is merely a toggle that sets/unsets auto-key. We were very cautious with this new update to avoid disrupting the previous workflow people were used to. At the same time, this is an iterative process and expect adjustments and improvements in the future.

    At a larger scope, animation window is not the only source that authors animation anymore. Timeline now can also preview and record per track. We wanted to offer a workflow that would span through the multiple animation authoring editors in Unity and offer a similar experience throughout.
     
  6. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,622
    I haven't really looked into this before now, and I'd just like to say: being able to add a property by right-clicking the property in the inspector and clicking "Add Key" is amazing! Thanks a lot for that!

    It's getting pretty good, but there's some additional polish I'd like to see:

    - the keyboard shortcuts should show in the property right-click menu.

    - Shift-K doesn't seem to work as intended? I'm animating a test cube thing, and when I:
    - select a time in the timeline
    - change both the position and the rotation of the cube
    - press Shift-K​
    I get a keyframes for the position, but not the rotation. I can create a video showing what I'm talking about if it doesn't make sense.

    - Undo needs some work. If I move an object and then press "k", that records as one Undo entry, so undoing both undos the movement and the keyframing.

    - (This one is old) The animation window shows the message "To begin animating Thing, create an Animator and and Animation Clip". If I add an animator with clips to the object, that message stays there until I change my selection, even though I should be able to animate the thing now. So the animation window needs to react to changes to the selected object.


    Finally, another thing: we should be able to mark scripts as containing animation clips. I'm working on building our own animation framework based on Playables, and I want my animators to be able to use that with the animation window. I believe I could fake it right now by adding an Animation component and populate it with all of the clips, and then delete that on play, but that's ugly.

    I'd love to have an interface like this:

    Code (csharp):
    1. interface IContainsAnimationClips {
    2.     //Used by the animation window to figure out which clips should be shown in the clip dropdown
    3.     AnimationClip[] GetAllUsedClips();
    4.  
    5.     // Called on this component by the animation window when the user clicks "add new animation"
    6.     void OnNewClipCreated(AnimationClip clip);
    7. }

    I want to re-iterate; the improvements to the animation stuff is greatly appreciated! Both Playables and the upgrade to the Animation window is getting us much closer to having this stuff be comfortable.
     
  7. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    109
    Thanks for the feedback!

    Hmm, are both the position and rotation channels in the animation clip you're keyframing? There are lot of intricacies when keyframing rotations due to the interpolation mode. If you think you found a bug, can you log us a bug report, that would be very helpfull indeed :)

    The candidate value is ephemeral. Keyframing something flushes out the candidate, and thus undoing the operation will not restore the candidate. Similarly, if you scrub through the animation, or start a playback, we will flush the candidate as undoing it would potentially set values at a different frame in the animation.

    We added a lot of robustness to the Animation Window so that it would refresh when selection has changed. Even if the window does not refresh right away (when not in focus), clicking on it should normally make it fetch the current selection and fall back to a sane state. If it's not the case, please, log something about it, it will help us keep better track of it.

    A very good idea :D
    We'll add this to our feature backlog!
     
  8. Aedous

    Aedous

    Joined:
    Jun 20, 2009
    Posts:
    234
    I also really like that a lot of attention is going into the animation window! I would really like to suggest allowing users to multiselect not just keyframes, but the events above as well.


    Should be able to select the events as well :(

    It's a bit tedious when having to alter keyframes, and remembering where each event should be, would be a lot easier if we could select it all.
     
  9. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    +1 to Aedous' suggestion.

    General question: is there a way to restore the old method of auto-keyframing?

    EDIT : It seems like every time I switch animations I have to re-enable "Keyframe / Edit" mode -- is this a bug or by design?

    I appreciate this new design might make sense for those that are primarily using external tools to build animations, and are therefore rarely editing them through the unity animation editor, but I am building all of my animations in the editor.

    This new experience forces me to enable edit every single time I switch animations. Unfortunately, this is a frustrating extra gesture for me, but more importantly, because it is a mode, I often forget to enable it. This causes me to silently curse Unity :) and lose some work.

    Side Note: I find myself continually forgetting I am not in "edit mode". I adjust things only to realise I'm in preview mode. This is what a for of the mode error I note above. The system is in a mode (preview) which is inconsistent with my user goal (keyframe).

    More info on mode errors, as a general UI concept http://www.embedded.com/electronics-blogs/murphy-s-law/4025544/Modes-and-the-user-interface
     
    Last edited: Aug 21, 2017
  10. comfortchambeshi

    comfortchambeshi

    Joined:
    Aug 26, 2017
    Posts:
    1
    people help me on how to use animations when i try them a character is just moving without me to control them help me.
     
  11. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    @comfortchambeshi Don't use animations to move your character. Animations override any input set in your Update() call, as animations are processed after Update(). If you need move a character create a nested hierarchy.

    Rather than...

    Hero / Chest / Head

    ... create a root container...

    Hero / Root / Chest / Head

    Move the Hero with code e.g. transform.localPosition += foo;

    Inside animations only adjust Root, never Hero.

    Friendly side note: This thread is about specific editor changes to key framing. It is not the right place for general questions about animations. I would suggest deleting your question and starting a new discussion under Animations.

    Hope that helps.
     
    Last edited: Aug 28, 2017
  12. NoiseFloorDev

    NoiseFloorDev

    Joined:
    May 13, 2017
    Posts:
    104
    The main thing I'm not sure how to do with the current keying workflow is how to set an initial key. Placing a position key that changes a value is easy (enable recording, select an object and move it), but placing the first key that doesn't change the value and just keys the initial position is less obvious.

    (Of course, the "add property" UI is basically unusable--try adding something more than one or two levels deep with that and you'll tear your hair out...)
     
  13. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    @NoiseFloorDev this is something I've gotten used to... I edit a value in the hierarch and generate the keyframe.

    But, I 100% agree, this needs to be included as a feature.

    Every time I work with a new animator that is familiar with tools like max they ask me how to do this.
     
    Last edited: Aug 29, 2017
  14. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    109
    That was exactly one of the main issues we were trying to address with the improvements to the keyframing workflow. You can do that right now by enabling preview (or recording), then right click on the property you want to key and choose "Add Key" in the contextual menu.

    AddingKeysToAnimationClip.gif
     
  15. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    Great to see attention being paid here. But wouldn't you want to do the 'Add Key' through the hierarchy?

    For example, my hero has dozens and dozens of parts, the current approach would mean selecting each part (in the hierarchy), then right clicking on the appropriate transform slot to add the key.

    What I'd prefer is...

    1, Multi-select items in hierarchy
    2, Right-click --> Add Key: All / Position / Rotation / Scale
     
  16. NoiseFloorDev

    NoiseFloorDev

    Joined:
    May 13, 2017
    Posts:
    104
    (Why do Unity people call context menus "contextual menus"?)

    I hadn't seen that menu. It's a bit undiscoverable, since it only appears if you're in preview mode. If you're not in preview mode, it doesn't just grey out the context menu items, there's no context menu at all.

    v2: Multi-select seems to work if you right-click in the inspector. There's a lot going on in the hierarchy context menu, not sure if adding it there would be much of a shortcut (and it'd be a special case to do it just for TRS)...
     
  17. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    @NoiseFloorDev Good to hear multi-select works, and then right-clicking in the inspector. So long as I can avoid tons of clicking :).

    Agree hierarchy context menu is jammed... but as you note, putting it on the inspector as a right click is very undiscoverable. My "context" is the selection, why would one think to right click on the inspector to get commands for my hierarchy selection?
     
  18. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    109
    Like that?

    AddingMultipleKeysToAnimationClip.gif

    That should already work in 2017.1.
     
  19. NoiseFloorDev

    NoiseFloorDev

    Joined:
    May 13, 2017
    Posts:
    104
    I don't think the hierarchy is more discoverable than the inspector. The inspector is where you go to set and work with values on objects, the hierarchy is just where you select things. It's the same place as it is in Maya.

    It just seems undiscoverable since you don't really expect a context menu to exist when you're recording an animation where one doesn't otherwise exist. It might help if the context menu items were always there and just greyed out when they're not relevant. It doesn't matter once you know about it, it just makes the learning path bumpier.
     
  20. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    @simonbz yep, that's what I was looking for, thanks :).

    @NoiseFloorDev neither is ideal or terribly discoverable. I wonder if it should be select items in hierarchy, press "add key" button in Animation view?
     
  21. NoiseFloorDev

    NoiseFloorDev

    Joined:
    May 13, 2017
    Posts:
    104
    You need to tell it what you want to key, and the inspector is the only place you actually see all properties to be able to pick them.
     
  22. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    Yep, you're totally right. Hrm... feels like a bigger redesign would be needed to make it ideal.
     
  23. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    FWIW, the new preview mode, and the need to enable edit mode each time I switch animations is not ideal for my workflow.

    Any chance we could get a Project Setting override to have edit model enabled by default anytime I select in the animation timeline -- whatever the old design included?
     
  24. NoiseFloorDev

    NoiseFloorDev

    Joined:
    May 13, 2017
    Posts:
    104
    I don't think it needs a redesign, the inspector is the natural place for it to be. It's the same place Maya puts it. The only confusing part is that there's no hint that the context menu exists, since you don't really expect the status of one window to cause context menus to suddenly start existing in another window. Just making the context menu always exist, and grey out the "set key" stuff when no animation is active would fix that.
     
  25. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    I'm guessing you mean having the context menu items always exist, so that if you ever right click you get a "peek" at it?

    I'm guessing we'll just have to agree to disagree here, but even showing the items grayed out doesn't really solve the discoverability problem. Right clicking just isn't the core way you work with Unity. It's designed around a selection and inspector / property-pane model. Stuffing extra commands in right click is never going to be discoverable.

    I like how Spine sets up their animation experience with a clean distinction between design and animation, I'd like to see Unity head in a similar direction.
     
  26. NoiseFloorDev

    NoiseFloorDev

    Joined:
    May 13, 2017
    Posts:
    104
    Context menus are used all over the UI and they're the standard place to put secondary actions in every desktop UI. The only problem is that I didn't expect there to be a context menu there, since there usually isn't.

    A weird keying bug: if I enter record mode, right click a checked boolean property, add a key (don't have to change the value), then exit preview, the property becomes unchecked.
     
  27. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    109
    Weird... I can't reproduce that in 2017.1. Can you log a bug report with a scene where we can reproduce the issue? I'll have a look.
     
  28. NoiseFloorDev

    NoiseFloorDev

    Joined:
    May 13, 2017
    Posts:
    104
  29. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    Sorry to be a downer... I know a lot of love and effort went into this feature, but I absolutely hate the experience it forces on me.

    I've given it a few weeks now and I'm convinced it just doesn't work for me. The use case it tries to address just isn't something I'd ever do. Moreover, I'm constantly loosing work as a result of forgetting to enable "edit" mode whilst making adjustments.

    I have hundreds of 2d animations done entirely in Unity using a rig similar to 2d puppet and this new feature just gets in the way.

    There's no doubt this frustration (the forgetting and losing work) is due to using unity the "old way" for many years... but from a fundamental user experience perspective this feature, being a modal toggle, is error and frustration prone -- yes I know I've beat that drum before :).

    Can we please get an option to revert back to classic "always edit" behavior. It would really save me a lot of time and headache. Huge TIA!
     
    Last edited: Sep 12, 2017
    a436t4ataf likes this.
  30. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    109
    I understand your issue and I'll forward your feedback to the rest of the team as we continue to adjust keyframing in the animation window. We're looking into adding more options to customize the animation window in the future, so expect that behaviour to be part of it.
     
    v2-Ton-Studios likes this.
  31. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    Thanks a ton Simon -- again, sorry to be a downer. I designed tools for 10+ years... before getting into games... I understand how tricky and thankless (sadly) it can be to satisfy a bunch of whiny expert-users :)... so yea, again, big thanks, if I can help in any other way let me know.
     
  32. Torbach78

    Torbach78

    Joined:
    Aug 10, 2013
    Posts:
    159
    when I change focus the animation stays,,,finally :) nice for aligning animations between objects!

    but when I switch back it resets and turns off the autokey/rec mode; is there anyway to get timelines to retain where I left off and also retain record mode?
     
    Last edited: Sep 22, 2017
  33. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    109
    Not sure I fully understand the question. Are you asking about Timeline or the Animation Window? For Timeline, there is a separate forum where you can ask questions: https://forum.unity.com/forums/timeline.127/.

    As for the Animation Window, you should retain your selection as long as you select game objects in the same hierarchy (under a single animator or animation component). You can always lock your window to your selection as well if you don't want it to change. Look for the lock icon in the upper right corner of the window.
     
  34. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    199
    I think what Torbach78 is saying is that when you switch between animations, edit mode toggles off. I too have found this frustrating and honestly confusing.

    Scenario...

    I'm working on my Run animation, I'm in 'edit mode' within the animation window.

    I switch to my Idle animation, edit mode toggles to off, I'm now only in 'preview mode'

    Expected...

    'Edit mode' is maintained unless the play is pressed or explicitly disabled by the user.
     
    a436t4ataf and Robin55Pixels like this.
  35. burc_sunday

    burc_sunday

    Joined:
    Jan 7, 2020
    Posts:
    3
    I've just logged in to say that this was a feature I was waiting to be implemented for the last 4 years. It's surprising to learn that it's been implemented since 2017. :) For the current project I'm working on, I finally went insane and decided to delve deeper into the forums.

    This saves me at least 30 mins per day. Cheers!
     
unityunity