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. Dismiss Notice

Animancer - Less Animator Controller, More Animator Control

Discussion in 'Assets and Asset Store' started by Kybernetik, Oct 8, 2018.

  1. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    It's not really focussed on either because there is no real difference between 2D and 3D. They both use AnimationClips, your scripts just need to decide what you want to play then tell it to play. Most of the examples are applicable to both 2D and 3D. You take almost any of them and use Sprite animations without changing any of the scripts or setup steps.
     
  2. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    194
  3. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    I've updated the Sprites page with a new script that supports multi-object selection of both Sprites and Textures containing Sprites.
     
  4. patrykszylindev

    patrykszylindev

    Joined:
    Oct 28, 2019
    Posts:
    23
    Great utility script! Thank you for your efforts.

    Happy with the purchase so far. However...

    I am at that point where I have to sync animations over the network that also respect the speed of animations based on casting speed.

    My initial solution is sending animation name (which then looks up the length of animation) and ability's cast time and I'm using the two variables to modify animation speed.

    It works fine in the editor, but as soon as I build the game, the animation speed never changes. Here's the code below. I've currently hardcoding the speed so I know this is not a networking issue but this has no result whatsoever.

    Any ideas @Kybernetik?

    EDIT: Using NamedAnimancerComponent and just have a list of possible animations

    upload_2020-11-1_15-47-4.png

    upload_2020-11-1_15-46-43.png
     

    Attached Files:

  5. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    Speed is a Pro-Only feature so if you're using Animancer Lite it will do nothing in runtime builds.

    If you're using Animancer Pro, there shouldn't be any reason for it to act like that so please make a minimal reproduction project and send it to animancer@kybernetik.com.au so I can take a look at it.
     
  6. patrykszylindev

    patrykszylindev

    Joined:
    Oct 28, 2019
    Posts:
    23
    Do you know what... I actually don't have Animancer Pro. I'll get it now and give it a go
     
  7. patrykszylindev

    patrykszylindev

    Joined:
    Oct 28, 2019
    Posts:
    23
    Yep indeed worked like a charm with PRO version. Thanks @Kybernetik.

    Great stuff this asset!
     
  8. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    303
    Hello, Im definitively getting this asset, I have been playing with the Demo and I can do almost everything I require. Just one thing, how do I set Layer blending to be additive or overwrite?

    I have a hybrid component and I'm running some reactions with Animancer, I want the reactions to be additive and blend with the AnimatorController. Currently the animations are overriding the entire motion, although it is blending well I dont want them to override the entire motion, I want them only to be additive.

    Hope you can help me with this.
    Thanks!
     
  9. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    animancer.Layers[x].IsAdditive = true; (all layers are overwrite by default)
     
    Hazneliel likes this.
  10. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    303
    Thanks, I was just going to ask differently. What if I want all animancer to be additive? I want for example to use Animancer to add detail animations to the Animation Controller but never overwrite it?

    I already tried doing .Layer[0].isAdditive = true but this doesnt seems to work if I play an animation with or without specifying a layer.
     
  11. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    PlayController will play it on layer 0, so you could set Layer[1] to additive and play all your animations on with animancer.Layer[1].Play.
     
    Hazneliel likes this.
  12. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    303
    Thanks a lot
     
  13. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    If you are doing that a lot, you could make your own class that inherits from HybridAnimancerComponent to initialise the layers how you want them on startup and add a method called something like PlayAdditive as a wrapper around Layer[1].Play.
     
  14. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    194
    Do I have to use the directional script for moving right and left? Can't I just use my own script and just play the animancer clip? Example: If(moving right) play walk clip?
     
  15. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    You can control Animancer however you like, the examples are just examples.
     
  16. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    129
    Hi, i just have a call to:
    Code (CSharp):
    1.  if (Input.GetMouseButtonDown(0))
    2.             {
    3.                 animancer.Play(animation1, 0.25f).Time = 0;
    4.             }
    The first animation playing is an idle animation, the first time I press the mouse button it transitions nicely, however the subsequent times as you can see, it just snaps to the animation without transitioning, what am i doing wrong?




    Maybe my animation is just bad?
     
  17. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    Milionario likes this.
  18. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    194
    Does animancer support bolt? Or vice versa?
     
  19. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    My understanding is that Bolt can control C# scripts without needing specific "support" but I've never tried it myself.
     
  20. craigjwhitmore

    craigjwhitmore

    Joined:
    Apr 15, 2018
    Posts:
    135
    I'm using a Blend Tree in the form of a Float2ControllerState.Transition. this is a 2D blend tree. This blend tree controls the walking animations with respect to speed and horizontal speed, horizontal speed can be ignored, but is used for other purposes. The BT goes from a slow walk to running and sprinting. The walk animation I have added a curve for Footfall and added a parameter in the animator. When the character walks, the Footfall parameter follows the animation curve configured in the animation clip.

    In my code, I'm trying to access the footfall curve values as the animation plays, how can I do this.

    NVM

    I found the answer,
    private AnimatedFloat footFall;
    footFall.Value
     
    Last edited: Nov 5, 2020
  21. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    If the curve is only on the animations inside the Animator Controller and not any of the others you're playing separately with Animancer, you can make a float parameter inside the Animator Controller and it will automatically be updated with the value of the curve every frame. Otherwise yeah, an AnimatedFloat is the way to do it.
     
  22. Milionario

    Milionario

    Joined:
    Feb 21, 2014
    Posts:
    129
    Hi, do you mind expanding on how AnimancerLayer.MaxStateDepth works and what it is for? I got that ArgumentOutOfRangeException because I was probably playing the same animation too quickly, why it happens though? I think it was being played every 0.1 seconds, is that too quick? I used SetMaxStateDepth to solve the issue but I am still interested on why it happens, thanks in advance.
     
  23. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
  24. craigjwhitmore

    craigjwhitmore

    Joined:
    Apr 15, 2018
    Posts:
    135
    Any ideas how I might sync a blendtree exit transition with a single animation, ie a walking blendtree with a stop walking animation.
     
  25. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    Depends on exactly what you mean by "sync". The time? The blend parameter? Something else?
     
  26. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    Hey everyone, Animancer v6.0 Alpha is now available for testing. As usual, you can download the Lite version from the Test Releases page or email your Invoice Number to animancer@kybernetik.com.au for the Pro version (or if you still have the download link from previous test releases it should still work).

    Here's a quick summary of the new features:
    • Added a new StateChange system to the Animancer.FSM system (which I originally proposed here). This is the most significant change you need to be aware of if you upgrade from an older version of Animancer in the middle of a project.
    • Added Window/Animation/Animancer Tools which opens a window with various useful tools including the script for easily generating animations from selected sprites that I made recently. I haven't documented them yet, but the Change Log has a summary of the tools.
    • Mixer Transitions can now use either AnimationClips or Transition Assets (any ITransition that inherits from UnityEngine.Object) for their children, meaning that you can now fully set up Nested Mixers using transitions instead of in code.
    • Added AnimancerEvent.Sequence.RemoveCallback (which I originally proposed here).
    The Change Log has the full list of changes. I'll be posting subsequent test releases over in the Work In Progress thread to avoid bothering everyone here.

    Please try it out and let me know what you think so I can keep improving it as much as possible.
     
  27. craigjwhitmore

    craigjwhitmore

    Joined:
    Apr 15, 2018
    Posts:
    135
    I have a walking blend tree, when it's in the walking state and I release control, the blend tree state exits and the character stops walking, the end time of the walk animation can be anything. When I transition to the subsequent state, the start time of this second state animation is fixed, so when the subsequent animation starts playing, the animations don't sync. ie, the walk anim might finish with the left foot up, but the subsequent stop walking animation starts with the right foot up, causing the character to skip.

    I'm looking for ideas how I can sync the subsequent animation to start playing with a dynamic start time, dependent on what the exit time or footfall value taken from the previous walk animation when it stops playing.
     
    Last edited: Nov 6, 2020
  28. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    If the walk cycle lines up with the second animation, you could just get the NormalizedTime from the ControllerState and set the second animation to start at that value.

    Otherwise, you could add a custom curve to the walk animations that directly corresponds to the NormalizedTime the second animation should start at if interrupted at that point.
     
  29. craigjwhitmore

    craigjwhitmore

    Joined:
    Apr 15, 2018
    Posts:
    135
    It's kind of a mix of both. I'm just mirroring the stop walk animation, then determine which foot is down and offset the start time with a curve. The system works ok. although is a bit awkward to setup; I'm eyeing both animations for when they look the same to line up the curve. It'll do, it's not great, but it's better than good, it's good enough!!! Thank you for your suggestion.

    I have 2 other questions also, which mainly pertain to version 6.0 beta.

    1. Can we access NextState before the current state goes into
    OnDisable()
    , as this would allow us to be able to change the end time of the current animation with respect to the next state.

    2. Have you thought about having State Transition Element ie, defined transition between one state to the next, so that each animation in the previous & next can be tuned dependent on the previous and next states? Although we can setup the next state dependent PreviousState, the converse would also be dependent on your answer to question 1 I suppose.
    In this sense, when I use the term Transition, I'm talking about a separate class to handle specific transitions between two states, not the individual animation transition that we have at the moment.

    3. With the changes to IState and the State Extensions, do we still need to copy the State Extensions in IState to our base state classes, as we used to have to with previous Animancer versions?
     
    Last edited: Nov 7, 2020
  30. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    1. No, the state change is only available during a stateMachine.TrySetState (or Can... or Force...) call. There is no "next state" until something actually tries to change it.
    2. I have, but without a use-case I haven't tried to implement it since I could easily waste time developing it in a way that isn't very useful. I've basically imagined it as a "TransitionSet" scriptable object which has a list of from/to pairs which it makes into a dictionary at runtime so you can call transitions.GetTransition(from, to) then play whatever it returns. Does that sound like the sort of thing you're looking for? The more detail you can give me about how you intend to use it, the better.
    3. I removed those commented out methods while I was implementing the change because I thought they wouldn't be necessary since IState is no longer generic, but IOwnedState still needs to be generic so I'll probably need to bring them back. I did figure out that you can get around the issue by manually specifying the generic argument (state.TryEnterState<BaseState>()) since it's just a problem with the way the compiler infers generic types, but that's still not great.
     
  31. craigjwhitmore

    craigjwhitmore

    Joined:
    Apr 15, 2018
    Posts:
    135
    the TransitionSet would be ideal for use with the Transition Interpolation I was working on, if an animation goes to two different blendTree's, the different interpolation curves could be defined in each TransitionSet.

    If the current animation has an End Time event set, then when the new state has TryEnterState called upon it, it won't end until the End Time event is called, perhaps CanExitState prevents it exiting. In this instance, are we able to use a reference to the NextState, ie to change the current animation end time?
     
  32. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    I'm not quite sure what you mean by that. I was thinking of a TransitionSet as something a character would only have one of since it can define all of their from/to pairs (though each set could have a fallback it uses if it doesn't have anything for a particular combination). Are you imagining it more as a single "from" with multiple possibilities to transition "to" so that each state essentially has its own TransitionSet to determine how it transitions into other things? Or perhaps the other way around (multiple "from", single "to")?

    Yes, the StateChange will be accessible during the TryEnterState call (for all the CanExitState, CanEnterState, OnExitState, and OnEnterState methods that it calls). So the current state's CanExitState could do something like:
    Code (CSharp):
    1. switch (StateChange<CreatureState>.NextState.Type)// Type being an enum.
    2. {
    3.     case StateType.Flinch:
    4.         return true;
    5.     case StateType.Attack:
    6.         return Animancer.States.Current.NormalizedTime > 0.5f;
    7.     case StateType.Jump:
    8.         return Animancer.States.Current.NormalizedTime > 0.8f;
    9. }
    Then other scripts can try to enter a state at any time and it will respond accordingly. But that has nothing to do with the current animation's End Time and those hard coded numbers are obviously not ideal.
     
  33. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
  34. craigjwhitmore

    craigjwhitmore

    Joined:
    Apr 15, 2018
    Posts:
    135
    Thank you for getting back to me with a comprehensive reply. They are some difficult questions to answer. The transition to mixers does throw a spanner into the works, as they can contain many animations, as you say. Any solution is going to be very dependent as to how the mixer is setup. From your perspective, any solution would probably be a large overhead for small gains, considering that we can just code in any logic to the state ourselves using previous or next states.

    It's useful information to know. I'll have a think upon what you wrote and if I come up with anything I'll let you know.
     
  35. Crouching-Tuna

    Crouching-Tuna

    Joined:
    Apr 4, 2014
    Posts:
    81
    Hi
    I'm really interested in the asset, and is my top next buy when/if it'd go on sale

    I do wanna try it first now too, but since my game is multiplayer, the "full features dont work in builds" is very limiting for me
    Is it possible, possibly, to change that limitation to "full features dont work in non development builds" ? Or something along that line? Or watermark it somehow, or only works in dev build and spams in the log every 5 minutes, or anything?
     
  36. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    Animancer will be in the Anniversary Sale which starts on the 17th.

    The current restrictions mean that the Lite version has one DLL which only works in the Editor and another without the Pro features which works in Runtime Builds. Changing it to allow Development Builds would mean that the Runtime DLL needs runtime checks all over the place which would cost some performance for everyone (only a very tiny bit, but it's already not ideal because of the code obfuscation that makes it harder to reverse engineer the Lite DLLs).

    Your other suggestions wouldn't be allowed by the Asset Store Submission Guidelines (sections 1.7 and 1.8). Now that I think about it, using Development Builds as a limitation might also fall under 1.7.a and/or 1.7.e.

    I'd like to find a better way to arrange the Lite feature restrictions, but haven't been able to come up with anything better yet. In particular, I want to give people who work with 2D Sprites some real reasons to get the Pro version so I don't need to restrict the ability to control Speed and Time (because otherwise there would be barely any Pro-only features that are relevant to them).
     
  37. Crouching-Tuna

    Crouching-Tuna

    Joined:
    Apr 4, 2014
    Posts:
    81
    Yeah, the speed/time feature being a Pro is kinda limiting, but more so is the build limit in my multiplayer case

    But, sale on the 17th? Wow yeah lets get it then!

    I have a question tho, kinda not related to Animancer

    The thing is i'm making an addon to an asset which means it can't have paid asset as part of it. This is the only reason why, even though i'll definitely NOT use Animator for my game, i still need to for this case...
    And since using the Lite to be included in this asset won't work (i need attack speed anim sets, etc, not to mention it's a multiplayer addon), i'll have to live with Animator just for this case...

    The question is actually, your experience with trying to use Animator in scripting as much as possible (probably before the time u have Animancer). Can u share what can/can't work, just some tips with how far i can get with using .Play/Crossfade, and in what case can i "let control pass to the SM", etc?
    So far i only read some silly bug like "can't Crossfade into the same anim". Luckily i separate my "interruptible" anim with the "interruptible post anim"

    It's for a fighting game..

    Sorry, not related to Animancer. Feel free to PM. I just thought maybe some Animator coding story would be kinda interesting here too
     
  38. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    Before I made Animancer, my Animator Controllers consisted of individual states with the only transitions being exit time transitions back to the Idle state. No parameters or other transitions (except parameters for blend trees), just scripted CrossFades.

    Keep as much logic as possible out of the Animator Controller and use a separate script based state machine system. My one is now included with Animancer. It's entirely separate from the animation system and its full source code is included in both Animancer Lite and Pro. If you want to take a look at it, get it from the Animancer v6.0 Alpha since I've made a bunch of improvements to it.

    Overall it's a workable solution, but not very convenient since you need to double up a lot of work (making state scripts and setting up their Inspector details on your prefab and making states in the Animator Controller).

    I also wrote an Animation Constants system for my Weaver plugin which procedurally generates a script containing the hash codes of all Animator Controller states and parameters in the project so you don't need to mess with magic strings as well as a method that returns the original string associated with a hash code so you can actually log the name of a state.

    Also, even if an asset is free that doesn't mean you can do whatever you want with it. The Asset Store license for example doesn't allow you to redistribute the assets. So even if Animancer Lite had the features you need, you would need to instruct users on how to get Animancer rather than directly including Animancer with your own asset.
     
  39. Crouching-Tuna

    Crouching-Tuna

    Joined:
    Apr 4, 2014
    Posts:
    81
    Ah, yes. Good to know about redistributing. I never include the 3rd assets and only include the "integrations" that it needs to make it work with another asset
    In this case (assuming i'll be using Lite), i'll include the "animation asset" or the script of it but not the Lite itself

    And thanks for the general guide about coded Animator. I'm also using the AnimatorStateInfo.IsTag to check what state it's in (in case i wanna check if it's in a sub state group of states thing).

    So i'll start untangling my Animator into code, just for the sake of this addon thing. This already sounds exciting.
    While i do that i'll prepare myself for an even more exciting scripted anims with Animancer. This'll be fun

    Cheers
     
  40. artofbeni

    artofbeni

    Joined:
    Mar 15, 2014
    Posts:
    7
    Hey! First of all, I must say that I've been using Animacer Pro on my project for a while and its been a life saver, thanks for making this plugin!

    However I've encountered an issue when trying to get the total duration of a ClipState.Transition and I'm not sure how to fix it. The problem is that when I add an animation event to a ClipState.Transition in the inspector, the NormalizedEndTime of the created state returns float.NaN, which also makes AnimancerState.RemainingDuration return NaN as well. If i don't add any animation event, then the NormalizedEndTime returns the value expected (usually 1 except if I modified it manually)

    I need to calculate the remaining duration of a ClipState.Transition before playing a state because I have a custom system where i can play a sequence of ClipState.Transition using a coroutine (waiting for the duration of the actual state before playing the next one). However, if the calculated duration returns NaN then my coroutine breaks. I'm also calculating the duration inside a function that returns the duration in seconds of the Clipstate.Transition. This function also returns NaN.

    This is the code that I'm using to control my coroutine:
    And this is the function I'm using to calculate the remaining duration and return it as a float (based on the calculate maximum duration function from animancer).
    I should also mention that I'm storing the ClipState.Transitions in a custom scriptable object class. I'm only calling them at runtime so i think this should not be an issue.

    I've read the docs on the EndEvent particularities and it does mention that its default state is NaN, but I'm confused as to why adding an event to my ClipState.Transition messes up the calculation of the duration. Can somebody shed some light on this please?
     
  41. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    If you have a look at the RemainingDuration property you can see that it does stuff with the end time if the _EventRunner is not null. If you have no events then it can skip all that stuff, but otherwise it needs to account for the end time and isn't handling the NaN properly. Replacing the RemainingDuration property with this should fix it:
    Code (CSharp):
    1.  
    2.         public float RemainingDuration
    3.         {
    4.             get
    5.             {
    6.                 var speed = Speed;
    7.                 if (speed == 0)
    8.                     return float.PositiveInfinity;
    9.  
    10.                 var length = Length;
    11.                 if (_EventRunner != null)
    12.                 {
    13.                     var endTime = _EventRunner.Events.NormalizedEndTime;
    14.                     if (!float.IsNaN(endTime))
    15.                     {
    16.                         if (speed > 0)
    17.                             length *= endTime;
    18.                         else
    19.                             length *= 1 - endTime;
    20.                     }
    21.                 }
    22.  
    23.                 var time = Time;
    24.                 if (IsLooping)
    25.                     time = Mathf.Repeat(time, length);
    26.  
    27.                 return (length - time) / Math.Abs(speed);
    28.             }
    29.             set
    30.             {
    31.                 if (value == 0)
    32.                     throw new ArgumentException($"{nameof(Duration)} cannot be set to 0 because that would require infinite speed.");
    33.  
    34.                 var length = Length;
    35.                 if (_EventRunner != null)
    36.                 {
    37.                     var endTime = _EventRunner.Events.NormalizedEndTime;
    38.                     if (!float.IsNaN(endTime))
    39.                     {
    40.                         if (value > 0)
    41.                             length *= endTime;
    42.                         else
    43.                             length *= 1 - endTime;
    44.                     }
    45.                 }
    46.  
    47.                 var time = Time;
    48.                 if (IsLooping)
    49.                     time = Mathf.Repeat(time, length);
    50.  
    51.                 Speed = (length - time) / value;
    52.             }
    53.         }
     
    artofbeni likes this.
  42. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    303
    Hello

    How do you fade stopping an animation in a layer.
    Currently Im doing:
    Code (CSharp):
    1.  
    2. animancer.Layers[BodyExpressionsLayer].Play(clip, 0.2F, FadeMode.FromStart).Events.OnEnd = () => animancer.Layers[BodyExpressionsLayer].Stop();
    3.  
    But this is making the stop to be abrupt, I would like to stop smoothly and I do not have an indle state for this layer.

    btw, I need to call stop because Im checking if this layer is playing this specific clip before playing it again, if I dont call stop the clip will reach to the end and stay there indefinitely with the isPlaying state still on true.

    Thanks for the help
     
  43. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    You can just fade the layer out as explained in the Layers example.

    And if you want a particular state to have IsPlaying == false you can just set it to false. You don't need to stop it or the layer.
     
    Hazneliel likes this.
  44. artofbeni

    artofbeni

    Joined:
    Mar 15, 2014
    Posts:
    7
    Thanks Kybernetik, modifying the RemainingDuration did the trick. Also updated my custom function to check for NaN and it seems to work fine now. Is the RemainingDuration intented to work like it used to do before the change or are you going to add this fix in the next release? Asking so I know if I should change this property again when updating the asset.
     
  45. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    I'll be changing it. I've set up a bunch of Unit Tests for it to make sure it acts correctly in various edge cases so it won't be exactly the code I posted earlier, but the NaN issue will be solved.

    There are two cases I'm not quite sure how it should work:
    1. If you get the RemainingDuration after you are already past the End Time, should it return 0 or a negative number indicating how far back the End Time is? End Events are triggered every frame after the End Time so you think of the RemainingDuration as "how long until the End Event triggers" then 0 would be appropriate. But if it's "how long until the End Time" then a negative value would be better.
    2. What should it return for looping animations? End Events are triggered the same regardless of whether the animation is looping or not, but people might be expecting the RemainingDuration to be "how long until the end of this loop".
    Let me know if you have any opinions on how you think either of those cases should be handled.
     
  46. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    For now I've gone with returning a negative value if you are already past the End Time (since you can always clamp the value yourself if necessary) and treating looping animations the same as non-looping (for consistency with End Events).
     
  47. artofbeni

    artofbeni

    Joined:
    Mar 15, 2014
    Posts:
    7
    I think that's a great solution, thank you!
     
  48. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @Kybernetik , Hi there. Looking to buy this asset upon a pal's recommendation. I was just wondering if there was any easy way (or shortcut) in the Animancer Pro API to grab an AnimationClip from an FBX file asset?
     
  49. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,485
    Duffer123 likes this.
  50. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @Kybernetik ,

    Thanks for the speedy response! -

    - But what if the AnimationClip is in an FBX? (I am probably missing something obvious here!)

    (I am thinking here of the functionality some asset kits have to load in to the FBX as the Animation, so to speak...)