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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question Playable graph help: How can I make a playable node that "tees" (splits/duplicates) inputs?

Discussion in 'Animation' started by burningmime, Aug 2, 2022.

  1. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    613
    I have a playable graph with some animations. However, I want an input animation to have a different weight for the upper body than the lower body. I found I can do this using AnimationLayerMixerPlayable. However, to do that I need to start 2 of the same animation (and keep them synced). If I try to connect the output of an AnimationPlayable to two different layers with different weights, an error will occur since one output can only be connected to one input.

    What I'd like is to create a PlayableBehaviour that basically just duplicates the frame data from its input to 2 separate outputs. However, I have no idea how to make that happen. Anyone know?
     
  2. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    613
    Bump. This is kind of blocking me. The only thing I can do is start 2 of the same clip and sync the times, which is needlessly slow and becomes hard to do when the inputs are more complex than a single clip.
     
  3. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,184
    I don't think it's possible. I tried to implement a similar feature but was never able to find a way to split the output of a Playable like that.
     
    burningmime likes this.
  4. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    613
    Hmm OK then is there a good way to make it so weights on head/arms are different from weights on lower body but animation is the same? Basically I have conversation animations that can start when character is standing in run pose. If I just blend to them, there will be too much foot sliding. If I play only top half of animation while bottom half is still shuffling feet, it looks bad. So I want to blend 2 animations but with different percent on each.

    Upper body is 90% conversation, 10% idle.
    Lower body is 10% conversation, 90% idle.
    Both sides use same input animations though.
     
  5. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,184
    Connect a regular mixer to each of the layer mixer's inputs, then you can set the weights on those regular mixers as desired.
     
    burningmime likes this.
  6. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    613
    Yes so this works but I need to duplicate animation inputs. If I try to connect same input to multiple outputs it throws error.

    One of the inputs is very complex since it is from MxM so like 8 clips and its own internal mixer.
     
  7. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,184
    That's what the regular mixers are for. They each have two inputs, each of which is connected to its own clip playable.
     
  8. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    613
    Yes but input can't be to multiple outputs. Maybe a diagram will help explain what I want to do:

    upload_2022-8-16_8-12-50.png

    Locomotion and Converation can only connect to one output not to both.
     
  9. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,184
    Yeah, you just need two copies of each clip playable. I thought that was clear from the beginning when I said you can't split outputs.