Search Unity

[RELEASED] Sage: Anim Graph Editor -- Control your Animations Visually!

Discussion in 'Assets and Asset Store' started by AlteredReality, Jan 19, 2012.

  1. Duskling

    Duskling

    Joined:
    Mar 15, 2011
    Posts:
    1,196
    Alright, I think I got it, but I think its some sort of issue with the animation.

    The 'Run' Animation seems to slightly be turning to the right while it is playing.

     
  2. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Details are in the documentation PDF. But it is as simple as connecting the input variable (Direction), and then connecting the proper output to the proper blend target (animation node in this case). So you would remove the Blend node in your graph, add a Direction node. First connect your Direction variable to the input of the Direction node. Then connect the Run animation to the Forward output, the RunBackwards to the Backwards output, and so on. It is smart enough to ignore the unconnected outputs, and only blend between the outputs.
     
  3. Duskling

    Duskling

    Joined:
    Mar 15, 2011
    Posts:
    1,196
    Alright, problem is all solved!

    Thanks!
     
  4. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Cool, does it resolve the input issues you originally posted about as well?
     
  5. Duskling

    Duskling

    Joined:
    Mar 15, 2011
    Posts:
    1,196
    Yep!

    The Direction node is amazing! Nice work man!
     
  6. Duskling

    Duskling

    Joined:
    Mar 15, 2011
    Posts:
    1,196
  7. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
  8. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    So everyone know, I put the Sage source code along with a full site license on sale at our website for $300. Let me know if anyone has any questions. You can purchase it here: http://www.alteredr.com/sage
     
  9. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
  10. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    I already purchase the plugin before source license is released.

    Is there any chance or policy to get discount for the one already got the previous package?

    Or should I pay $300 again to get the source even if I bought the package?

    Thank you.

    -Kim
     
  11. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I didn't think about that before, but that sounds like a good idea to me! If you could send me an email at AlteredRealityEnt@yahoo.com with the invoice to confirm the purchase, I can send you a coupon code for $75 off. Thanks!
     
  12. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Also, the offer of the coupon extends to ANYONE who purchased Sage previously. :)
     
  13. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Sage: Anim Graph Editor v1.5.1 has been released!


    Version 1.5.1 Changes

    - SIGNIFICANTLY improved performance...up to 4 times faster!
    - Fixed a bug with Float Variable visual debugging.
    - Added warning for multiple Sage Controllers on the same game object.
    - Auto-generated "_BaseController" script is now abstract.
    - Auto-generated scripts now attempt to make sure only valid characters are used in their names.
     
  14. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Version 1.5.2 Changes

    - Added ability to force Sage to recache all animations in the case of dynamically changing animation clips on a target Animation object.
    - Fixed all compiler warnings in the source code.
    - Fixed an issue where a newly created node would not show up.
     
  15. antiqas

    antiqas

    Joined:
    May 10, 2012
    Posts:
    9
    Hello,
    Is there a way or are the any plans to implement bone specific blending- you select which bones specifically you want to read and which ones to ignore. For example- for up and down the hill walking I only want my have an additive animation on spine1 which I will expose trough incline variable for code to use.
    Another one one would be random blinking, while doing other anims.
    This feature is the most important in my opinion for a good animation blending state machine
     
  16. antiqas

    antiqas

    Joined:
    May 10, 2012
    Posts:
    9
    Doh! My bad! Just discovered that you do it on mixing transforms on state machine node! I'm a happy animator now :)
     
  17. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Awesome, glad you found it! :)

    As for the random blinking...you could use a nested or parallel state machine that has two anim list nodes. Each node could contain a "don't blink" and a "blink" animation, and you would be able to weight them as you want. Then just connect the two nodes together, and you will get the two states transitioning back and forth, and picking random animations. Let me know if that helps and works for you!
     
  18. antiqas

    antiqas

    Joined:
    May 10, 2012
    Posts:
    9
    Thank you for your support- I will try the solution for randomizing anims and let you know what I think. It would be good to have a random blend node in a future thou, which would randomly choose between the given animations in the future thou, ideally with weighted probability and optional repetition of each node to create the behavior wanted from character easily.

    On another note I have two questions if you have some time to explain me:

    • is there a way or plants to implement timeline events/trigers such as footSteps for soundsEvents to play at the given times when animation is active or ideally even to even mach the footsteps between different speed locomotion (Transition to next on the given trigger)
    • is there a way to force a shader animation trough into SAGE- for example I have a blinking as UV animation and eyes changing colour to red as shader animation animation either done in Unity or even better- in 3D package (Maya in my case) and then plug it into sage to use with the rest of animation tree

    Thanks again!
     
  19. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I will make it an option on the AnimList node that when looping, it will pick a different animation.

    For the footsteps, I would use the build in animation events system with Unity. You should be able to use them to then send a message to the SageController to trigger a Trigger node in a graph. http://unity3d.com/support/documentation/Components/animeditor-AnimationEvents

    The shader animation thing you are talking about I would think would mostly just work external to Sage. Any additional work could most likely be done in the OnEnter, OnUpdate, and OnExit (in the exported script). functions for any state that you would want to run custom code for this feature. If you wanted to create a custom node to have an even more advanced feature, that is something that would have to be done using the Sage source code.
     
  20. antiqas

    antiqas

    Joined:
    May 10, 2012
    Posts:
    9
    Thanks again for your support. We might look into editing the source code and I will research all what you have listed.
     
  21. antiqas

    antiqas

    Joined:
    May 10, 2012
    Posts:
    9
    Hello,
    I have been trying to set up a one bone additive animation inside certain animation blend graphs, but noticed that this option is only available when creating a parallel State machine, however it is not available inside Blend graph.
    I can work around this by creating a parallel state machines but each one of them would need to be set up to be triggered at the right time and having an option to choose additive blend for certain animations inside a blend graph would simplify my anim tree.
    Is there are more simple solution or perhaps this feature could be added in future releases?
    thanks!
     
  22. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    190
    Mate, this is quality software. Even if Unity decides to eventually use a system like this, they don't always get their implementations right (GUI system, for example) so I hope you continue to develop this regardless. You've set the bar very, very high. 5 stars.
     
  23. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Sorry I didn't reply sooner! For some reason, I never received a post notification for this post until the next person in the thread posted something. :(

    There is a way to do this without having to start the parallel state machines manually. You could have the following setup for your blend graphs/state machines...

    ==> [SM] MyStateMachine
    ====> [BG] MyBlendGraph
    ======> [SM] ChildStateMachine
    ========> [pSM] AdditiveStateMachine

    This setup should cause the parallel state machine to blend in and out with the with the blend graph. All you'd need to do is set the pSM to Additive, set it to start active, and add an animation to it, which will play automatically if it is the only state in the state machine. Does that work for you?

    I won't be able to add blend mode to a blend graph itself, as Sage is structure around the parent state machine controlling the blend mode and layer. However, I will look into being able to change the blend mode of a normal nested state machine. Let me know if that would help you.
     
  24. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Awesome, thanks for the kind words! Let me know if you have any questions or other feedback while using it! :)
     
  25. sirival

    sirival

    Joined:
    Sep 14, 2011
    Posts:
    146
    Hello,

    I am looking for the best way to do these transitions for a character. I will write it in pseudocode and you could give me your input as to how I can implement this using nodes, because I can't do it. The reason I cannot do it is because I cannot find a 'looping condition' meaning a condition that is always being checked and not only when it is first satisfied:

    Code (csharp):
    1.  
    2. if( Dance == 1 )
    3. {
    4.     Play Looping Dance Animation
    5. }
    6. else if( Talk == 1 )
    7. {
    8.    Play Looping Talk Animation
    9. }
    10. else
    11. {
    12.    Play Looping Idle Animation
    13. }
    14.  
    Note that Dance and Talk are two float variables. If Dance is 1 then the character must dance. If Dance becomes 0 and Talk is 1 I want to play the talk animation. Hoever I also want to play the talk animation if Talk becomes 1 and Dance is 0.

    I can do this by creating conditions for all possible outcomes and connecting them in all possible ways. However this is very impractical as if I want to add a couple of states with similar behavior I have to create a LOT of combinations and this is very error prone.

    Let me know if you can help!
     
  26. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    As of right now, there is no way to do a condition using nodes as complex as this. However, not all transitioning logic needs to be, or should be directly in the graphs. The condition nodes are meant to make it easy to visually represent simple conditions. It would be very easy to put this logic into the *_GameController.cs code. As follows...

    Code (csharp):
    1.  
    2.     public override void Update()
    3.     {
    4.         base.Update();
    5.  
    6.         if (Dance == 1.0f)
    7.             TransistionToState("Main", "Dance");
    8.         else if (Talk == 1.0f)
    9.             TransistionToState("Main", "Talk");
    10.         else
    11.             TransistionToState("Main", "Idle");
    12.     }
    13.  
    That would very easily give you exactly what you need. And it would actually be a bit easier than that, since export to scripts would give you helper functions to handle the transitions.

    Does that help?
     
  27. sirival

    sirival

    Joined:
    Sep 14, 2011
    Posts:
    146
    Hey there, thanks for responding.

    Yeah this is basically what I've done I was just making sure I wasn't missing anything! Thanks again!
     
  28. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Awesome, glad to hear it. Let me know if you need anything else. :)
     
  29. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    For anyone following this thread, Sage Anim Graph Editor is 25% off on our website until tomorrow morning (6/11)!

    You can get Sage Anim Graph Editor Basic \w Dlls for only $56.25. And Sage Anim Graph Editor Pro \w Source Code for $225!
     
  30. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Does this work with locomotion?
     
  31. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    This was already discussed a bit in page 4 of this thread: http://forum.unity3d.com/threads/12...ditor-Control-your-Animations-Visually!/page4

    The honest quick answer is I'm not 100% sure, but I believe it would as long as Sage and the locomotion system do not use try to play the same animations. I setup Sage to work with external packages as much as possible. Let me know if you have more questions.
     
  32. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    I actually do own a copy of Sage but my colleage is looking more in depth at it. The current demo foot skates, but it's not apparent in your demo because the floor is all white. If you use a tiled texture, it will be obvious.

    For an animation system like EmotionFX or Morpheme, they would have locomotion integrated.
     
  33. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    With Sage, I decided to focus on interacting with the Unity animation system from a blending/transitioning perspective. IK and Root Motion are two things that I would love to integrate at some point, but it just isn't practical to do all of those features upfront. So most of my time has gone into Sage as a state machine and blend tool. With how Sage is setup, it should be relatively easy to integrate support alongside it for IK (foot placement) and Root Motion (having the animation determine movement). These would however require programming knowledge, or another external package running along side Sage.

    The Sage source code is for sale for advanced users that would like to implement their own features directly into it. As always though, both IK and Root Motion remain two things I'd like to implement myself at some point, but I'm not sure if/when that will be.
     
  34. Duskling

    Duskling

    Joined:
    Mar 15, 2011
    Posts:
    1,196
    Howdy,

    How would I make different animations play on the graph based on what weapon I have selected?

    For instance, in the graph can I have a variable currentWeapon that connects to a variable in the script and then if currentWeapon is a pistol then go to the pistol state machine?
     
  35. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    So, you have all of the different state machines for each weapon already separated? If so, I'd recommend using code in your *_GameController.cs class to trigger the state transitions based on the weapon. The would be the easiest and most direct way to do it.
     
  36. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Sage 1.5.3 has been released...

    - Added "Random on Loop" option to the Anim List state node.
    - Fixed a bug preventing an animation with negative speed properly playing with the "Once" wrap mode.
    - Exposed list of animations being used in a library (accessible from the ISageLibary interface).
    - Also added the ability to check if a used animation has movement enabled.
     
  37. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Great product really. Doesn't the move/rotate show up in debug mode?

    EDIT- By reading this now, it may sounded a bit aggresive but not on purpose. Sorry if it did. I was asleep.
     
    Last edited: Jul 2, 2012
  38. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Why would it happen that while I have a forced condition that goes true, the animation doesn't play, but remains in some other SM. A slight change in the value that the condition is checking, does the trick, but that would be unusable in runtime.
    Thanks
     
  39. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    First off, the move/rotate does not do anything in debug mode, as I wanted that mode to be "in place". So it will only apply movement and rotation in play mode.

    I have some optimizations in place to try and prevent checking a condition without the target variable changing. If your variable changing, and the condition is true, it should trigger a transition. The only potential issue I can see is if the graph the condition node belongs to isn't active at the time, that the condition change will not be processed. Although, I believe it should process the condition when the graph is active again, but I'll have to double check. Could this be the case for your issue? If not, could you please take a screen shot of your setup? You can email me the image at AlteredRealityEnt@yahoo.com if you don't want to post it here. Regardless, I'll look into recreating this bug myself as well.
     
  40. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    nuverian, I tried to reproduce this and was unable to. I had previous fixed the issue where if a state machine wasn't active, that conditions wouldn't properly be triggered when active again. It is working just fine for me. For reference, I am using the SoldierSL Sage Library that ships with Sage, on version 1.5.3. I used the Walk state machine and tried getting it to fail from switching. It switched properly regardless of whether or not it was active. Could you please email me more info as to how your library is setup so I can better help? Thanks!
     
  41. antiqas

    antiqas

    Joined:
    May 10, 2012
    Posts:
    9
    Hello,
    thank you for your continuous support. We are on 1.5.0 version I beleave and I have a few bugs I have discovered, apologies if certain things have already been adressed:


    • random nodes become unselectable for moving around and eventually become selectable after clicking around on random other ones
    • on clicking to create condition, trigger or anything for the first time it sometimes does not appear at all, but if I do undo/redo command it does. Repetitive clicking to create them will create further ones, but the first one would be invisible until command is undone and redone.
    • some nodes become invisible on reopening and in certain occasions- you can see the links to them, but it's just empty grey space, it reappears on scaling the window around a bit or going back and forth in hierarchy(Not that major f an issue)
    • Entering values in nodes sometimes the values come back backwards if I type: 0.5 I get 5.0
    • Sometimes while clicking to drag a node, it snaps around 5cm to the side from the cursor, you can still drag it thou.

    I have also had some questions suggestions again:

    • blend in and out speed is currently on the node which limits to only one blend speed setting per node. Because having a blend speed sometimes prevents animations to work properly (such as go back and forth between two states if they are short) and also for flexibility purpose it would be useful to be able to set each link individually between states instead of setting it on state itself.
    • Would be great to be able to select multiple nodes for moving purposes
    • Would be great to have a copy paste (ctr c = ctr v) option for nodes
    • How should the company go about upgrading to the latest version of your software(we have a source version of 1.5.0)?

    Thanks and I hope at least some of this helps to improve SAGE!
     
    Last edited: Jul 9, 2012
  42. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    First off, thanks for all the great feedback! I'll go ahead and address them all for you...

    The issues with nodes not appearing should be all fixed as of 1.5.2.

    The issues with not being able to move nodes, values entering backwards, and nodes snapping while dragging all seem to be issues caused by using Unity GUI's GUI.Window function for displaying the nodes. Unfortunately, there seems to be quite a few bugs with their GUI.Window code. I have been fighting with these sort of Unity GUI issues on Sage for the last 9 months, but I have been unable to resolve all of them. :( I have put alot of code in place to help reduce the frequency of these issues, as they used to happen alot more frequently. Regardless, I will continue to see if I can eliminate or reduce any of these issues. I'm really sorry about any inconvenience these issues have caused!

    The blend in/out on links would be nice, but unfortunately I don't see this being able to happen with the current setup of Sage. If you need to have a custom blend in/out time between specific states, I would recommend calling the state transitions from code.

    Multiple node selection and copy/paste are definitely two things on the list of future features to add.

    As far as upgrading your Sage, I would just treat it as any typical SDK code merge. If you've made local changes to Sage, then you need to perform a merge/diff of the two versions. An easy way to get at the code is to import the new version into a blank Unity project. If you don't have any changes, then you can just import the new version over top it.

    Thanks again for the feedback, and let me know if you need anything else at all!
     
  43. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    Sage 1.5.4 has been released!

    Changes:

    - Fixed a bug that prevented multiple linked condition nodes from working properly.
     
  44. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Got it. Thx ;)
     
  45. SC_79

    SC_79

    Joined:
    Jul 12, 2012
    Posts:
    3
    Hi there,

    I am using your great Addon, together with Antiqas. I am more on the scripting side of things.

    I currently have two problems:

    1st
    There are some triggers which are location into a sub-State Machine. Try as I might, it seems I cannot trigger these triggers from scripts (CharSAGE_GameController). Is there some trick I am failing to see, so that I do that?

    2nd
    When ever In\Out fields are set to 0 on Animation Lists, I start getting some weird behaviour when controlled from the scripts. From the animation not playing at all, or played incorrectly. Everything works fine when I debug from the SAGE editor.

    Thanks a lot for your help! :)
     
  46. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I'm sorry you are running into issues! I wanted to give you a quick update that I was able to easily reproduce both of these issues. Thank you so much for reporting them! I will resolve them ASAP and let you know when they are fixed.
     
  47. SC_79

    SC_79

    Joined:
    Jul 12, 2012
    Posts:
    3
    Great! Thanks a lot. ;)

    Got another one for you. This time I could also replicate it from the Debug mode on the SAGE editor:

    I have this SM (top-level):


    If Actions is >= than 10, it will go into the Actions SM
    If <= 0 (tried also <= 10), it will go back to the top-level SM.

    Actions SM looks like this:


    So, if I understand it right, when Actions >= 10 it should play the appropriate animation into actions (depending on Action's value), and stop until I decrease Actions back to <= 10, which should revert it back to the main SM and then go back to the Idle SM.

    The problem I have here is that even after I decrease Actions back to 0, it won't exit the Actions SM. The character would stop all animations, and trying a second time (change the value of Actions again), won't play anything at all. You might notice also the Moving SM which is working correctly, is very similar (kinda more complex actually) to the Actions SM.

    Code-wise, I am resetting Actions to zero like so (again, it doesn't work :( ):

    Sorry long post, but I wanted to be descriptive as much as possible! :D
     
    Last edited: Jul 13, 2012
  48. AlteredReality

    AlteredReality

    Joined:
    Aug 15, 2011
    Posts:
    397
    I don't mind long posts, the more info the better for trying to figure out issues. :)

    First off, about your other issue. I fixed the issue with Out Time being set to zero. And the Trigger issue, at least on my end, I figured out wasn't an issue with the code all all. After running through the code, I verified that the trigger message was being received by the node. There was actually two configuration issues that I had. I didn't have "Force Transition" selected, and there was no direct transition setup for the state the trigger was pointing to. And second, I had a condition that was immediately transitioning away from the state I tried to transition into with the Trigger node. Are either of these the cases for your graph? If not, perhaps a screen shot of that would help too.

    And looking at your screen shots, it seems to me that your top level state machine has stopped executing. If it is active, the background color would be yellow-ish. My guess is that in one of your state machines, it hit a state where no animation was being played in the top level SM or it's children. If no animation is being played, it will consider the entire state machine finished and stop it. I'd look into seeing if there is indeed a case where this happens. As well, I was able to reproduce a similar SM to yours and it worked fine. Only time I ran into an issue, was when I purposely put it into a condition where no animation is being played, which stopped the entire state machine.

    Let me know if that helps. :)
     
  49. SC_79

    SC_79

    Joined:
    Jul 12, 2012
    Posts:
    3
    Hey again ;)

    For the Out Time, excellent! Thanks.

    Re. Triggers. I have no screenshot sorry, because I replaced the Triggers with Conditions. Just to have an idea what I was doing, just imagine triggers instead of the Conditions in the 2nd screenshot. They were all set with Force Transition, and triggers worked fine when they were set in the main SM. When the Triggers and Animation Lists were moved into the Actions SM, they didn't work anymore. Thinking of it now, it maybe be more of a problem with the Actions SM, rather than the actual triggers, since the Triggers where in the same Actions SM.

    Regarding the Actions SM, I don't think that That was the problem. All the animation lists had animations. After a lot of experimenting, I did come up with a work around:



    So first off, I improved the conditions Actions >=10 and Actions < 20. I suspecting that the problem in the SM was due 1+ conditions where being hit. That didn't fix it though. Secondly, I added an 'exiting' Condition Action <= 0, which transitioned to an ActionIdleOnce. That Animation List is a non-looping animation for our idle animation. That seems to have fixed my problem. I suspect that a single exit point for the SM fixed it (against having all the other animtions lists as exits)? Not sure :(

    Also, I have some kind of a minor problem. See the rounded red circle around the 'Default' Animation List? If we name it anything else apart from default, the Animation in that Anim List is played twice. To explain better we named it SitDown: Animation played twice, and then transitioned to SitIdle. We re-named it Default, and it played correctly. (We tried a variety of other names, also 'Default2'). Could this be related to the problem above?

    Thanks a lot for your help! ;)
     
  50. Arkasis

    Arkasis

    Joined:
    Nov 22, 2010
    Posts:
    61
    Great job !

    This addon is very good.

    I have some question about using script : If I want to know which animation is actually played in a StateMachine how can I do this ?
    I'm trying using GetStateMachineCurrentState() but it always log an error : [Sage] Unable to find active state machine on Sage Controller, "Test"!

    Something really strange happen with trigger.



    I have created a state machine which start on a basic state in which I start an idle anim or a move anim if the speed is > 0.
    I create a trigger which force the transition and start a roll animation and then have a transition to the first SM.
    When I call this trigger from code, it works fine when I don't modify my CharacterMove parameters (but physics don't modify animation ?!) but if in the same function I call the trigger and then modify my CharacterMove param, the Roll animation is never played...
    It is really really strange !

    Thanks for your answer !
     
    Last edited: Jul 16, 2012