Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Masks don't work with Playable API?

Discussion in 'Animation' started by dwit_mass_creation, Nov 21, 2016.

  1. dwit_mass_creation

    dwit_mass_creation

    Joined:
    Jun 18, 2015
    Posts:
    72
    I'm using experimental Playable API.
    When I add animator to AnimationMixerPlayable, masks used for that animator layers stopped working.
    Can I use masks with Playable API?

    What I'm trying to achieve: blend two animators where first animator has default animations and second is animator for custom actions (for example for cutscenes or custom interactions).
    Is there any other way to do it using Playable API or without, but using two Animators?
     
  2. Mecanim-Dev

    Mecanim-Dev

    Unity Technologies

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

    It not clear what is exactly your problem. Do you mean if you create a playable graph with a AnimationMixerPlayable as root and then connect two AnimatorControllerPlayable as child, in this case mask set on the controller layer doesn't work anymore?


    There is two different playable, AnimationMixerPlayable and AnimationLayerMixerPlayable, currently only the AnimationMixerPlayable is available, we are currently working on exposing mask on AnimationLayerMixerPlayable and then we will publish the AnimationLayerMixerPlayable
     
  3. dwit_mass_creation

    dwit_mass_creation

    Joined:
    Jun 18, 2015
    Posts:
    72
    Yes. That is exactly my problem: masks are not working even if there is one child connected to AnimationMixerPlayable.

    AnimationLayerMixerPlayable looks nice, but does it mean it would have more power than Animator? We currently cannot change or even access masks in layers from code as far as I know.
     
  4. Mecanim-Dev

    Mecanim-Dev

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Could you log a bug with a small repro project, we will investigate.

    No, the controller is already using an AnimationLayerMixerPlayble to mix all the layers togheter, this playable was not avaible yet because all the mask stuff is not ready for runtime. I'm currently working on this and made it work this monday but still I have a few thing to finish before it can be available, with this new playable you will be able to create override and additive layer with a mask at runtime.
     
  5. dwit_mass_creation

    dwit_mass_creation

    Joined:
    Jun 18, 2015
    Posts:
    72
    Ok. I sent Bug report with simple project (Case 853930). As I can see in replay mail you prioritize latest versions of Unity. This was tested on Unity 5.4.2p3.

    Currently we are using additional layer to simulate mixer but I think AnimationMixerPlayable is only way you can add animations to Animator during gameplay.
     
  6. Mecanim-Dev

    Mecanim-Dev

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    yes it the only way
     
  7. Bezzy

    Bezzy

    Joined:
    Apr 1, 2009
    Posts:
    75
    Perfect!
    We were just about to start exploring this stuff, and this was the thing that immediately sprang to mind. Good to know that even if it's not ready yet, it's on the cards! Thanks Mr. Dev!
     
  8. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    Can I just stop by and ask what's the status on the Playables API? When should we expect the official, stable, production-ready release?

    Seems like it is the saviour of animation-handling in Unity, but I don't feel too comfortable using it while it's still in experimental
     
    Last edited: Nov 28, 2016
  9. dwit_mass_creation

    dwit_mass_creation

    Joined:
    Jun 18, 2015
    Posts:
    72
    In our Steam version of game Draw Slasher we used ONLY Playable API for playing all animations.

    http://store.steampowered.com/app/418270/

    It is port from our internal engine, so Playable API was best for playing many single animations.
    There are hundreds active animations during gameplay: each zombie has 1 to 6 parts animating (each part has different Playable) and background sometimes has hundreds.

    So it can be used in production, but I agree it's risky if it is experimental.

    Official release will be probably when it will be tested and after feedback from developers, but most developers won't be using it because it's experimental :(

    So I would like to know timeline too.
    I'm sure more developers would be using Playable API if it is Beta than experimental.