Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Smooth Moves - 2D Skeletal Animation

Discussion in 'Assets and Asset Store' started by echo17, Feb 20, 2012.

  1. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249

    Yes, it is quicker for loading a single atlas at the start of the scene. You just won't gain any per frame boost since each animation needs its own draw call. I hope that Unity will someday support batching skinned meshes (at least small ones like what Smooth Moves uses).
     
  2. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    I think I might know what the issue is. You'll need to be sure you are on the latest version of Unity. I think they hide the buy button when you don't have the version that matches the plugin.
     
  3. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    Just gotta let you know that i totally love Smooth Moves !

    Not sure if this is even possible,but would a 'base skeleton' work on smooth moves ?
    Then we (the community) could build a library of animations that can be re-used.

    I know that a base skeleton won't fit everyones sprites, but artists could actually use it a base,and then limiting the need to make a dozen animations everytime.

    It's just an idea, would love to hear opinions on this...
     
  4. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    Awesome, thanks!

    You could certainly do this now. Once an animation is created, you could go back and set all the textures to some bogus texture in a generic atlas. The next animator could take the animation and set their own textures on each of the bones. Of course this all assumes that the texture sizes will be identical, so it probably wouldn't be too practical.

    Just be sure to only include the Smooth Moves runtime with anything you share. The Smooth Moves editor dll is not redistributable since it is the heart of the plugin.
     
  5. ddf

    ddf

    Joined:
    Jul 9, 2011
    Posts:
    54
    Hey so the docs say that BoneAnimation has a SetColor method, but when I try to call it the compiler says it does not exist. What's the story there?
     
  6. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    Oops, sorry about that. When I added bone color, the function SetColor became ambiguous so I created two functions, SetMeshColor and SetBoneColor. I guess I just forgot to add these to the docs and remove the old function. I'll try to get that fixed soon.

    Thanks!

    [EDIT] I updated the docs on my website at echo17.com. I'll be sure to include the updated version in the next release as well.[/EDIT]
     
    Last edited: Jun 1, 2012
  7. ddf

    ddf

    Joined:
    Jul 9, 2011
    Posts:
    54
    Awesome, thanks for the swift reply!
     
  8. ddf

    ddf

    Joined:
    Jul 9, 2011
    Posts:
    54
    But I guess SetMeshColor doesn't support alpha? Or is it possible it's being overriden by something in the animations?
     
  9. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    It should work. Be sure you have the "Update Colors" checkbox checked on the bone animation in your scene. I have this set to false by default to improve performance for animations that do not need their color updated.
     
  10. bandingyue

    bandingyue

    Joined:
    Nov 25, 2011
    Posts:
    131
    hello echo17,

    My question is :

    Can each component of a character have its own spriteAnim(Traditional animation)?
     
  11. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    Yes, each bone can have its own sprite animation.
     
  12. sanjodev

    sanjodev

    Joined:
    May 29, 2012
    Posts:
    63
    When I created colliders for my bones in the animation editor, I noticed if I used the mesh import scale on the animation, it doesn't seem to take effect right away for the colliders even though it does for the bones and sprite images in the scene view. So what i see is some big non scaled colliders which is confusing when setting up my scene. When I run the game, it seems to take 1 frame for the animation to update the scale of the colliders to match the mesh scaled size, so then it will show up in my scene view correctly. The real issue though is that during that 1 frame, collisions can happen with the non scaled mesh, which is problematic. Is this a known issue and is there a workaround for it?
     
  13. superdungeon64

    superdungeon64

    Joined:
    Jun 2, 2012
    Posts:
    16
    i just bought this today .. and after long hours stuggling.. i realized u cant just play animations with animation.play("asdfa"); you need to use smoothmoves.boneanimation or something.. like i see u do in your tutorials.. but u dont explain it.. and i also script in java .

    could u please explain how i can pull this off in java !! thanks!
     
  14. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    Try updating the mesh manually at design time, by going to the menu "Smooth Moves -> Tools -> Update All Bone Animations In Scene"
     
  15. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    You could do something like this to play an animation with Smooth Moves:

    Code (csharp):
    1.  
    2. #pragma strict
    3.  
    4. public var boneAnimation : SmoothMoves.BoneAnimation;
    5.  
    6. function Update () {
    7.     if (Input.GetKeyDown(KeyCode.A))
    8.     {
    9.         boneAnimation.Play("Attack");
    10.     }
    11. }
    12.  
    I'd suggest looking over the differences between java and c#. The two languages are pretty similar, but you'll find a lot more plugins created in c# than java. It seems to be the preferred language of devs for Unity extensions.

    Here's a wiki post that describes some of the basic Unity functions with c# and java side by side:

    http://www.unifycommunity.com/wiki/index.php?title=Programming_Chapter_1_Old
     
  16. Samb88

    Samb88

    Joined:
    Mar 26, 2009
    Posts:
    208
    Hey echo,
    I have some problems with curve.. or more what smooth moves automatically does with curves!
    I added some rotations to my character and this is what smooth moves creates:

    As you can see, it's a jittery/robotic animation. I don't know if this is a bug, but if not something like a "smooth curves" function for all selected frames would be nice. right now, I have to adjust the curve on every bone and that's a bit annoying :)
     
  17. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    Actually, this happens by design. When you add a new node to the end of a curve (or a new keyframe), it does not know what your next node will be so it just assumes a tangent of zero. When you add the next node after that, it does not modify any previous nodes, so you get a continuous string of zero tangents, which you see in the graphic.

    Now if you add a node between two existing nodes, then it can properly calculate a smooth tangent between them, so that works okay.

    Your idea of adding a function to auto smooth a curve is a good idea. I'll add that to my list.
     
    Last edited: Jun 3, 2012
  18. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513
    Hi echo!

    Great product :)

    I'm currently using SpriteManger2 for sprites, but really want to use your Plugin for animations of some characters.
    Do you know if both can work hand in hand or are there known clashes/incompatibilities?

    Also, if I use a scale of 1:1:1 for an object using EasyMove, if I build my sprites/atlases for iPhone4s, will the sprite in the scene automatically scale down for 3GS? This is the method I currently use for SM2, where I use an ortho camera.


    Many thanks!
     
    Last edited: Jun 4, 2012
  19. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    Thanks!

    They should work well together. I don't know of any incompatibilities.

    I'm not sure what EasyMove is. I don't have any automatic scaling in Smooth Moves, but you can easily achieve pixel perfect scaling by making your ortho camera size half the height of the screen. Smooth Moves creates meshes so that 1 pixel = 1 world unit, which is perfect for 2D cameras.
     
  20. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513
    Thats because I'm a noob who hasn't had enough coffee -- my bad, I have no idea where I got "EasyMove" from but I did mean "SmoothMoves" LOL **

    Thanks for your answers!
     
  21. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    I figured you meant that, but didn't want to assume anything. I could be the name of another plugin after all :)
     
  22. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,151
    hi echo,

    will it work with flash? do you plan to integrate it flash version?
     
  23. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    not currently.

    I may look into it at some time, but there were just too many things that flash couldn't do that Smooth Moves needed. Right now it is very low priority on my list. Hopefully Unity can make the flash implementation closer to all the other platforms in the future.
     
  24. sanjodev

    sanjodev

    Joined:
    May 29, 2012
    Posts:
    63
    This "Smooth Moves -> Tools -> Update All Bone Animations In Scene" option updates the mesh, but it doesn't do anything for the colliders. So the issue still exists.
     
    Last edited: Jun 4, 2012
  25. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    I'll take a look and see if i can reproduce the problem. Hopefully I can get a fix in the next service release.
     
  26. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    I removed tutorial #1 from my website. It dealt with setting up the environment for Smooth Moves, mainly in how to arrange the Resources folder that existed in versions older than 1.9.1. Since I started embedding the resources in 1.9.1, this tutorial was pretty much irrelevant. Sorry for any confusion that might have caused!
     
  27. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,151
    do you mean when unity relase flash version we will not be able to make flash games using "smooth moves" ?

    also do you plan to add feature like using skeleton animation files(bvh). so we can use motion captured data with smooth moves bones.
     
  28. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    Sorry for the confusion. When I try to compile my library for Flash, there are a lot of .NET functions that I use that Unity's version of Flash cannot. So for now, Smooth Moves won't work on Flash. I would have to strip out a lot of functionality to make Smooth Moves work with Flash, so that probably won't happen for a while, if at all.

    The short answer is: No, Smooth Moves does not work with Flash :)

    I hadn't thought about that, but it is an interesting idea. I know nothing about bvh files, so that would be something I'd need to research before I can say it will go on my list. Definitely a good idea though. Thanks!

    [EDIT] One thing to consider with motion capture is that Smooth Moves is a collection of planes sliding around in 2D. Not sure how you could get motion capture for that specialized of a mesh, but again, that's my lack of understanding with bvh files. [/EDIT]
     
    Last edited: Jun 5, 2012
  29. blaze

    blaze

    Joined:
    Dec 21, 2011
    Posts:
    211
    Hi there, I'm playing with Smooth Moves, and, when I create a character, it gets a enormous size, from the another things.
    Like, not in the normal scale of unity. For a while, this was ok, but now I'm trying to add physics to make the character jump.
    But seems that for be out of the normal scale, the normal functions to use gravity are too slow.
    One of the principal thing that I saw, is that the character controller needs to be enormous to fit in my character.
    Then, for best practices, what I may do? Resize the scale of the character until it fits in the normal scale, or I need to acelerate the gravity scripts?

    Sorry, I can be doing something wrong, but in your demo of the knight, if I put a character controller, It will be too small too. Then I need to resize the controller to a bigger size to fit in the knight.

    Another question, using big "things" dont make the engine to work hard? Example, if I add physics to a 1,1,1 cube and to a 100,100,100 cube, the processing in the both will be the same?

    Sorry for my noob questions, and sorry for my bad english, here in Hell doesnt exists good schools. :p
     
    Last edited: Jun 6, 2012
  30. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    Hi Blaze,

    By default, the mesh is created with the scale 1 pixel = 1 world unit. This is great for creating pixel perfect 2D worlds. If you want to interact with 3D (other meshes and physics), you'll probably want to scale your mesh down.

    You can easily do this by setting the Mesh Import Scale to a number lower than 1.0f on your bone animation data asset. For Instance, a value of 0.3f would be a mesh 1/3rd of the size.



    To answer your other question, no I don't believe the size of the objects will decrease performance. The only time this is an exception is when you have large alpha testing textures that cover the entire screen, then the processor has to spend more time drawing and testing each pixel.
     
  31. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,151
    if the problem is just compile errors i can help you.i am a very good .net developer. your framework is very good and you have very good training videos. but i definitely need flash support. 2dtoolkit says it has flash support but it has not supply good training material. so i can help you to get flash support from your framework. for .net help you can send me pm.

    bvh files are animation data for skeletons.yes they are 3d. we can use them like we use unity3d as a 2d game engine. assume you have a orthogonal camera from fixed angle. you will just use x and y coordinates and ignore z coordinate.as i know bvh includes just absolute positions not rotations.so you dont have to calculate rotations.there are many free mocap files.so we can use them.you can use blender to examine bvh files.

    also one feature request more; background images/video on animation editor of Smooth Moves. so we can capture reference video for animation and set keyframes using background video. this background video is just for animation editor.
     
  32. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    I have a background reference image for the animation window as one of my items on my TO DO list. I don't think I will be able to do video, however. I'm just using Unity's GUI system to create the window and its components so that it will all integrate into Unity nicely. I'll have to see if video is possible with that, but I'm pretty sure it is not.
     
  33. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    Unfortunately, the problem isn't compile errors, but that Flash doesn't have the complete set of functionality that Smooth Moves requires. I would have to create a separate Smooth Moves version that is good for Flash only and it would be very watered down. I really don't want to have to maintain two versions.

    My hope is that Unity will beef up their Flash implementation to be closer to their other platforms (PC, mac, iOS, Android).
     
  34. llavigne

    llavigne

    Joined:
    Dec 27, 2007
    Posts:
    977
    Set the tangents to AUTO it will update tangents to match the previous and next points on the curve


     
  35. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,151
    don't forget; game future goes to flash. adobe prepares for flash for better games.

    maybe subset of Smooth Moves would acceptable. tell us which features can work on flash. maybe simple features will be enough for us to make a flash game. you can disable some features using platform detection if conditions.

    you are an assets store seller. you can contact unity to ask if they will unify flash implementation as you expect.

    if there will be no flash version i have to examine, learn and buy another 2d framework :-(
     
  36. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,151
    maybe there is an workaround. i add a bone for background. i set background images to it for each frame. after i set my keyframes i can delete this bone. if there is an option to disable this background bone i can use it without delete it.

    also video is not necessary. image sequence is acceptable.
     
  37. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    Actually, I'm not using Unity's built in curve editor. It was too buggy and had memory crash problems, so I rolled my own. It does not currently have an auto-smooth feature, but I've added that to my list.
     
  38. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    I can add the ability to exclude bones from the final mesh creation to my list.
     
  39. Samb88

    Samb88

    Joined:
    Mar 26, 2009
    Posts:
    208
    This is maybe a bit special but I know it will happen very often troughout the development of a game: Adding new bones to an already animated character.

    Lets say I made a character and made every needed animation, but then my client says "I want the ability for the character to have an hat of choice! I heard another company makes MILLIONS with that!"
    Ok, so normally you just have to add a bone to the head bone and make it the right position. BUT smooth moves doesn't seem to carry over the bone positions of the new bone in every animation, only the position from the creation of the bone.
    So here is my solution for this problem: We need a button for "set position on all animations". If you press that, the bone will have the current (local) position in every animation clip. Right now, you would have to go in every animation and set the values by hand, that's a bit annoying :)
    Oh, and if that kind of button is possible a "set atlas on all animations" button would be cool as well, because, of course, there is no atlas settings for a new bone in every clip!
     
  40. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    That's a good idea, I'll add it to my list.
     
  41. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    I totally second what Samb88 wrote. Both the "set position on all animations" and the "set atlas on all animations" would make Smooth Moves much smoother :)

    @atmuc: if I can add something to the Flash discussion (without mentioning that the new "moves" Adobe did pissed off so many developers that Flash might die instead than be the future), no one can say if their Unity plugins will be Flash compatible or not. Because 1) Flash is still in beta and very buggy, and 2) the Unity guys still don't know for sure what they'll be able to implement. But good luck with that echo ;)
     
  42. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,151
    yes you are right it is still beta and buggy, but some developers say that they support this platform and follow beta versions and they also fix their flash export bugs. at this point intention is important for me.

    one they unity flash export will be mature. at that day, if someone starts to develop for flash he will be too late. to be fresh you must follow beta, even alfa versions :)

    i liked Smooth Waves and i want to help it to be better because i want to use it :)
     
  43. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    I did something unexpected with the first frame of one of my bones. The animation editor is no longer responsive. Here is the error...

    NullReferenceException: Object reference not set to an instance of an object
    SmoothMoves.AnimationWindow.CalculateAnimationWindowBones (SmoothMoves.BoneTree boneTree, Single parentRotation, Vector3 parentGlobalScale)
    SmoothMoves.AnimationWindow.CalculateAnimationWindowBones (SmoothMoves.BoneTree boneTree, Single parentRotation, Vector3 parentGlobalScale)
    SmoothMoves.AnimationWindow.CalculateAnimationWindowBones (SmoothMoves.BoneTree boneTree, Single parentRotation, Vector3 parentGlobalScale)
    SmoothMoves.AnimationWindow.OnGUI ()
    SmoothMoves.BoneAnimationDataEditorWindow.OnGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/BuildAgent/work/300357e52574df36/Editor/Mono/GUI/DockArea.cs:228)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/BuildAgent/work/300357e52574df36/Editor/Mono/GUI/DockArea.cs:221)
    UnityEditor.HostView.OnGUI () (at C:/BuildAgent/work/300357e52574df36/Editor/Mono/GUI/DockArea.cs:121)
     
  44. outtoplay

    outtoplay

    Joined:
    Apr 29, 2009
    Posts:
    741
    Hi Echo.. after you get the guy above me sorted, I have a quick question.
    I'm starting to build animation clips for a few characters. I try not to do stuff like this in the actual Game project. I usually create a Animation Project and build my sprites backgrounds or whatever in there, then import em.

    What will I need to grab out of my 'animating project' and import into the actual game project?


    thanks,
    B
     
  45. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    Can you send me your project to support@echo17.com? I'll take a look and see what I can find.
     
  46. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    You'll need to export the following as a Unity package (Assets->Export Package):

    1) Bone animation data assets
    2) Material(s) used in the bone animation data assets
    3) Texture(s) used in the material(s)
    4) If you want to edit your animations in the new project, you'll need the source textures that were used to build the atlases as well.
     
  47. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    1.9.2 Released

    This is a service release that fixes some issues with focus being lost in playMaker states on Smooth Moves sprites. I've also revamped the sprite a bit so that it does not try to take focus away. I had to get rid of the create sprite button in the atlas editor, but you can still create a new sprite by either:

    1) Select Smooth Moves->Create GameObject->Sprite
    2) Create an empty game object and add the Sprite script to it
     
  48. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    I'm having some trouble with the "Set Atlases" feature. I select multiple keyframes, I right click and choose Set Atlases. I choose my altlas and click the update button. But all the keyframes are still in default state.

    I see this error in the console...

    ArgumentException: Getting control 4's position in a group with only 4 controls when doing Repaint
    Aborting
    UnityEngine.GUILayoutGroup.GetNext () (at C:/BuildAgent/work/300357e52574df36/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:412)
    UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/BuildAgent/work/300357e52574df36/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:236)
    UnityEngine.GUILayoutUtility.GetRect (Single width, Single height, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/BuildAgent/work/300357e52574df36/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:219)
    UnityEngine.GUILayout.FlexibleSpace () (at C:/BuildAgent/work/300357e52574df36/Runtime/ExportGenerated/Editor/GUILayout.cs:163)
    SmoothMoves.BoneWindow.OnGUI ()
    SmoothMoves.BoneAnimationDataEditorWindow.OnGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/BuildAgent/work/300357e52574df36/Editor/Mono/GUI/DockArea.cs:228)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/BuildAgent/work/300357e52574df36/Editor/Mono/GUI/DockArea.cs:221)
    UnityEditor.HostView.OnGUI () (at C:/BuildAgent/work/300357e52574df36/Editor/Mono/GUI/DockArea.cs:121)
     
  49. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    It seems to be working for me, so we must be going about the process differently. If you could create a screencast (video) of what you are doing I might be able to see where to plug the hole.

    It could also be something about your project that is different than mine. If you want to send me a sample of your project that shows the error, you can email me at support@echo17.com
     
  50. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,249
    When upgrading smooth moves, the new package may lose the links to the animation files in the demo scene that comes with smooth moves. The best method to use here is to completely delete the Smooth Moves folder before upgrading.

    Just be sure you have no work in that folder before deleting it, however! :)