Git Product home page Git Product logo

animationplayer's People

Contributors

baste-raingames avatar bbuanes avatar boothand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

animationplayer's Issues

Recommended way to do a Jump animation

@Baste-RainGames I can see you updated your code with Events. Nice.

Using your AnimationPlayer framework, what would your recommended pattern be for a jump type animation?

So my character controller calls PlayerJump() when the "Jump" button is pressed. What would I do with my Idle/Walk/Run BlendTree1D that I have? Would I create a new layer with a Jump animation, transitioning to it and then back to the bottom layer with the BlendTree1D?

I'm just trying to wrap my head around Playables API and especially your great framework.

BTW, I exposed layerMixer in AnimationLayer.cs as a public variable

public AnimationLayerMixerPlayable LayerMixer

on line 23 and in 113 by adding it:

LayerMixer = layerMixer;

This way I have an easy way to call the SetinputWeight method on the Layer like:

layers[0].LayerMixer.SetInputWeight(0, LayerOneWeight);

layers[1].LayerMixer.SetInputWeight(1, LayerOneWeight);

This allow me to quickly blend the layers in real time in the Unity editor by adding some public [Range(0, 1)] variables for LayerOneWeight & LayerOneWeight.

Dynamically built states on startup?

I wrote a pretty awful interface admittedly and spiked some runtime creation of AnimationState into this. My interface is a bit awful because it's so simple and relies heavily on the outsider (me) but basically It's IStateAdder and must implement an AddStates(AnimationPlayer ap) function. I spiked it at about line 57 of AnimationPlayer.cs kinda like:

----new code:
IStateAdder[] adders = GetComponents();
if (adders != null && adders.Length > 0)
{
foreach (var adder in adders)
adder.AddStates(this);
}

----your existing code below: I had to create my states before the below loop fired, or else the underlying lists and stuff would be out of sync with the states.
for (var i = 0; i < layers.Length; i++)
layers[i].InitializeSelf(graph);

This way, I can create a component of my own and define how to add states outside of the animator. OBVIOUSLY, there is a much cleaner approach to be taken here, but I think something like this would be hugely valuable on your API. My AddStates() implementation basically specifies a hard-coded layer, and wipes all states from that layer to start off. I then add in a custom number of states as needed. This allows me to essentially define a series of animation behaviors somewhere else, and the same animator/character prefab/etc. is reusable between scenes and stuff. In my use case, I'm creating an Idle state, a Blocking state, and n # of attacking states which are just SingleClipState in my use case.

Now that I'm done, I have 4 separate animated behaviors all created at runtime, each can have a different number of attacks and all animations are working great! Also, if I really wanted to I could do fully randomize an infinite number of behaviors.

AnimationPlayer out of sync with Editor (Can't save or edit)

I'm not sure how I got into this state, but when I start up my game, the AnimationPlayer has the layers and states that I have configured through the Inspector window. However, they don't match what is in the editor, and I think it has something to do with collisions between state names, somehow. Anyways, it seems to fail when I attempt to ctrl+s and it also has created some weird behavior when I run the game. Luckily, this is the layer that I'm blanking out on startup so it's not causing problems, but if it was a different, more important layer I'd be super stuck.

Errors in editor

Keep getting these errors after adding another layer from the editor:

image

For this reason the view is bugged and only partly shown:

image

Suggest removing GraphVisualizerFork

The graph visualizer fork folder conflicts with the graph visualizer package. I suggest removing it from this package and adding in a suggestion to download your fork of the graph visualizer over unity's

Suggestion/Feature Request: Animation chaining

@Baste-RainGames Could you add Animation Chaining to your framework? Similar to https://github.com/prime31/ZestKit or DoTween http://dotween.demigiant.com/getstarted.php ?

I'm thinking something like:

Play("SomeAnimation", <float Duration>).SetTransition(TransitionType.EaseIn).Play("AnotherAnimation");

This would play SomeAnimation with a duration of Duration and then ease into AnotherAnimation.

And this could be extended with looping:

Play("SomeAnimation", <float Duration>).SetTransition(TransitionType.EaseIn).Play("AnotherAnimation").SetLoops(2).SetLoopType(LoopType.PingPong);

This would play SomeAnimation with a duration of Duration and then ease into AnotherAnimation with a total loop count of 2 with a PingPong behaviour.

Samples are broken

The development samples are missing scripts or the references have been broken and are not usable

Animation Preview is serializing transforms to my Character

I like that I can preview the animations in the inspector window, but it has some fun consequences. My character is sitting in my scene half way through an animation, stuck that way. It doesn't cause any animation problems on startup, but i'm using PuppetMaster which requires my ragdoll to match up with my rig on app startup. I'm still looking into how to rectify this problem. I may have to use my old rig's transform and do some sort of retargeting between the good one (t-pose) and the borked one and then serialize those positions/rotations back to my scene. Not quite sure yet how I'll fix it.

IK and animation layers

@Baste-RainGames I was reading your code in AnimationPlayer.cs around line 26 regarding IK. I'm working on some IK animations and need IK passthrough but it isn't working with your system. For my beta code I've just switched to a base AnimatorContoller and it's fine for testing.

You mention two potential solutions, the second one looks interesting. Can you provide some more thoughts on how to progress with "2: Ship AnimationPlayer with an AnimatorController that's set up correctly..." ?

Cheers,

David

This is AMAZING!!

@Baste-RainGames I am starting to wrap my head around this and just got my first 1D blend tree working with my own code. WOW!

Thank you so much for putting this together. I have a lot to learn from your API and will continue to dig in over the next few days.

I'm happy to collaborate where possible. I'm newer to the whole Playables system but trying to get up to speed as soon as I can.

Animation Events weird firing behavior

Here is what my animation clips look like in Unity. All of these events are baked into the clips themselves before being loaded into the AnimationPlayer:
Timeline below with events A() and D():
0 1 2 3 4 5 6 7
<---------------------A()--------------------------------D()------------------------------>

The events DO fire when I play the animation, however they fire like this
frame | event firings
0 D() and A() simultaneously fire (backward order) immediately around the first frame of the animation.
1 --
2 A() normal/expected
3 --
4 --
5 D() normal/expected

I'm going to attempt to ignore the first 2 firings because I haven't figured out what is causing this yet. If you can figure it out, let me know :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.