Search Unity

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,195
    No worries. I have it on my todo list to add a function to set the sprite by texture name, but it may take a while to get to. Sorry for the confusion!
     
  2. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    Hey Echo!

    I've been doing alot of animations with several clips and i always run into a small problem after doing the FIRST clip for an atlas. As soon as i am done animating my first clip, i exit the editor, place a boneanimation in scene to check it, and everytime it resets all the pivotpoints.

    All pivotpoint has been set in the atlas before i start animating. for some reasone it resets them everytime after finishing the first clip. I end up force rebuilding and going into the ditor, fix the pivots to they match the animation, THEN i dare to make more clips to make sure they dont mess up aswell.

    Am i doing soemthing wrong or is this a SM issue?


    Also;

    why when I import Unity can't find the scripts for the atlas and the bone animation and I have to reset them?


    Hope u can answer these please as they make editing and importing alittle tedious as it stands now.

    hopefully its a quick fix!
     
    Last edited: Dec 23, 2012
  3. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    844
    Hi, I made an anim using the anim editor and the depths are all fine, but in my game one of the arms depth is wrong so its appearing over the top of the body, how do I fix this?
     
  4. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    This was an issue in versions prior to 2.1.0. Be sure you are on the latest version to get a fix for this.


    Unity has some quirks when importing plugins into current projects. I encourage people to create a brand new project, import the updated plugin, then use your operating system's file system to copy the dlls to your project. It's a little clunky, but saves you lots of work re-attaching scripts. Hopefully, Unity will one day fix this.

    Have a look at the upgrade guide for an illustrated explanation of this process:

    http://www.echo17.com/support/smoothmoves_v2_upgrade_guide.pdf
     
  5. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    I haven't come across this issue personally. I would need to see your project to give you a diagnosis. If you want, you can send me your project zipped up to: support@echo17.com. Be sure you tell me which scene and bone animation data to look at to save me some time.
     
  6. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Hi, I'm working with Kelde. To clarify, the problem isn't importing the plugins. We have been trying to share animations between each other, by exporting/importing packages. When I import, all the atlases and bone animations say the script is missing so I have to go in and select the proper scripts for all those assets. We are using Unity 4.

    The Inspector says "The associated script can not be loaded". The console says "Unable to open Assets/SmoothMoves/Editor/SmoothMoves/SmoothMoves_Editor.dll: Check external application preferences"

    If I re select the script in the inspector, all is well, but doing that over and over again is a bit painful.
     
    Last edited: Dec 24, 2012
  7. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    You might try exporting the SmoothMoves dlls with your animations. Not sure if that will fix the problem, since I haven't had any issues sharing my animations. Also, be sure you are exporting the bone animation data (the assets), the atlases, the materials for the atlases, the textures for the atlases, and the source textures that comprise the atlases.
     
  8. hemdanw

    hemdanw

    Joined:
    Nov 5, 2012
    Posts:
    14
    Hi echo,

    I'm using smoothmoves v2.1.0, with Unity 4.0

    I am re-using a flapping wing animation, also reusing claw and leg bone animations on different creatures. I am doing this by adding the re-usable animations as children to the main animation. This all works well, but when I tried converting the animation into a prefab, I got the following errors and force-rebuild seems to go into an infinite loop. Am I doing something wrong?

    For example, in the hierarchy view, I have the following:
    - Enemy5 (Bone Animation)
    - Root
    - Main Body Root
    - ArmorBody
    - ClawA (Reused Bone Animation)
    - Root ...
    - ClawB (Reused Bone Animation)
    - Root ...
    - Head (Reused Bone Animation)
    - Root ...
    - Tail (Reused Bone Animation)
    - Root ...

    ClawA, ClawB, Head and Tail are separate bone animations manually inserted to this node.

    This setup works well as long as the bone animation is left as a non-prefab in the hierarchy. I can safely call "Force Rebuild All" on the control panel and it all works correctly. If I create a prefab for enemy5 and "Force Rebuild All", the rebuild process gives the errors below. It also seems to go into an indefinite loop (I have to click on the 'X' on the control panel to stop the build). After that, enemy5 is non-functional and all bone animations that were on it are lost.

    Here's the error I get during force rebuild:

    Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption.
    UnityEngine.Transform:set_parent(Transform)
    SmoothMoves.AnimationHelper:UpdateBoneAnimation(BoneAnimation)
    SmoothMoves.AnimationHelper:UpdateAnimationDataAndPrefabs(BoneAnimationData, Boolean, Int32, Int32, Int32)
    SmoothMoves.AnimationHelper:UpdateBoneAnimationsAndDataInAllScenes()
    SmoothMoves.ControlPanel:Update()
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

    Any ideas? Am I re-using bone animations in a wrong way... I would really like to be able to re-use animations as I will be creating many composite creatures that can share wings animations, claw animations, and other.

    I have a simple project that reproduces this bug if it helps.

    Thanks,
    - hemdanw
     
  9. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    Due to some limitations in the way Unity handles prefabs, I would suggest not having child animations attached to bones of a parent animation inside a prefab.

    To get around this, you can have each animation in a separate prefab. In your "parent" animation, you could have references to the child animation prefabs. At runtime, you can then instantiate your child animations and attach them to your parent's bones, using the GetBoneTransform function in the BoneAnimation class.
     
  10. kontrabida

    kontrabida

    Joined:
    Aug 29, 2011
    Posts:
    15
    We've been using this since 1.0, absolutely love it.
    Would be great if we can have a horizontal scroller for the bone hierarchy panel, though.


    Thanks and keep up the awesome work!
     
  11. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    Thanks! I agree, and it is on my list. I actually had started working on one, but the Unity GUI was giving me errors if I tried to scroll too far right. Very odd and difficult to pin down, so I shelved it for a later release. I definitely want to get it implemented though.
     
  12. deadswine

    deadswine

    Joined:
    Mar 27, 2012
    Posts:
    19
    Hello there, got issue!
    Sometimes when i leave animation editor and then come back to it after some time all images go to zero position and i need to make my animations again this is very annoing !:(
     
  13. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    Not sure what would be causing this. I haven't experienced this issue myself. Perhaps you are updating the animations or assets outside of the editor?
     
  14. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    We are trying to figure out the best workflow for our project. We have a character that will have alot of interchangeable body parts. We would like to be able to handle the process of creating the textures much like you did in the tutorial where you used swapmaterial to change the knight from green to red. However we don't want to change the material for the whole animation. We would want to change the material for an individual bone at a time. I know there are alot of SwapTexture functions but it seems they all require you to have SmoothMove TextureAtlases built for everything. We would rather not have to rebuild what are essentially the same atlases over and over. Is there an alternative I am missing? I guess something like a SwapBoneMaterial function would be what we need.
     
  15. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    I may be understanding this incorrectly, but it would seem that building the atlases through the Texture Atlas editor, or recreating the atlases in photoshop based on a source atlas would both require some work. In this scenario, I would say that using an image editor to make variations of your atlases would be more time consuming than just clicking on rebuild in the texture atlas editor for your alternate atlases.

    SwapBoneMaterial sounds like an interesting feature. I haven't thought it all the way through, but sounds good on the surface. I'll add it to my TODO list of items to consider.
     
  16. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Not sure what you mean by "just clicking on rebuild in the texture atlas editor for your alternate atlases"
    Don't we have to redo all the pivot points exactly the same for every atlas so that they work correctly when they are swapped in? Maybe we are misunderstanding what is required to make atlases with new textures that can be swapped properly.
     
  17. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    You are correct, you will need to set the pivot points for each of the textures comprising your atlas variations. You could set the x and y values explicitly to get the identical pivots going this route.

    I agree that the SwapBoneMaterial functions would be most useful (barring any unforeseen complications I haven't thought of yet).
     
  18. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Yeah, the pivot point issue makes it much more work than just creating a new material atlas in Photoshop. Using identical pivot points is made somewhat difficult because of some quirks with copy/paste in those fields and the large precision of the numbers. Please let me know when you have some idea when that feature could be implemented. Thanks!
     
  19. iwishash1

    iwishash1

    Joined:
    Jul 8, 2012
    Posts:
    11
    I'm using Smoothmoves (just only for animation) and 2Dtoolkit (background, any other sprite stuff).
    I need your tips about Camera setting and Bone scaling.
    I made bone animation using SM, then import the scene, it looks too large compare with 2Dtoolkit sprite images.
    So I should reduce scale of bone animation or scale up 2Dtoolkit sprites.
    Is that right move?
    Please give me an advice.
    Thank you.
     
  20. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    SM has a import scale setting u can try, saves time atleast so u dont have to start scaling the sprites if they look ok. spritecollections also have size settings, but if ur SM animation is too big i think setting import scale for it will do the trick, i had to do this myself.
     
  21. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    Kelde is correct. There is an import scale on each of your bone animation assets. You can scale up or down (> 1 = scale up, < 1 = scale down). This lets you merge SmoothMoves with other plugins or 3D environments.
     
  22. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    844
  23. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    Nice artwork! Can you email me your project so that I can have a look? It's probably something minor, but I'll need to have a closer look. You can send the zipped file to: support@echo17.com
     
  24. Rexcusei

    Rexcusei

    Joined:
    Jan 10, 2013
    Posts:
    9
    echo17

    HI , Thank you very much, I read your many posts !!!;):cool:
     
  25. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    You're most welcome. Glad you like SmoothMoves!
     
  26. Kyu

    Kyu

    Joined:
    Jul 27, 2012
    Posts:
    4
    Hey, loving the extension so far as a programmer (and I'm sure our artist loves it even more). Seriously, great job with this.

    I did however find a problem I've so far been unable to solve. I admit I didn't read the 52 pages this thread has now, so sorry in advance if I'm asking something that has already been answered.

    Basically our game stutters the first time an animation is played. If I stop the editor and play the game again, the stutter never occurs again, but if I close Unity and reopen it, the stutter happens again the first time the animation plays.

    So I guess what I need is some way to preload all the animations in runtime, in the Start method. I searched the API and the Sample method seemed promising, but going through all the bone animations and running sample on all of them, while iterating all of their states didn't seem to change anything either.

    So yeah, is there any way to preload the animations in runtime?

    Thanks in advance.
     
  27. oziriz

    oziriz

    Joined:
    Jul 4, 2012
    Posts:
    7
    I think this is not possible...
     
  28. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    You're welcome!

    Hmmm... I haven't seen this before. I'm not sure how Unity is loading the animation data behind the scenes. The curves and such that make up the animation are all converted to a Skinned Mesh and Animation components, so it should handle everything the same as if it were imported from a 3D modeling program.

    If you want, you can send me your project to support@echo17.com and I'll have a look. Not sure if there is anything I can do, but it may be worth a try.
     
  29. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    I also have a forum at http://www.echo17.com/forum. It's fairly new so there are not a lot of posts, but I'm edging toward using a dedicated forum over one massive post on Unity's forums. This lets you do stuff like searching and sharing too.

    Just thought I put that out there in case anyone is interested. Also, check out the links in my signature for more avenues of contact.
     
  30. danboutros

    danboutros

    Joined:
    Mar 26, 2012
    Posts:
    32
    Hi Echo! I LEARNED SOMETHING THAT MAY HELP OTHERS!

    We were struggling with failure issues on updating SM1.X to SM2.X.

    I've followed the instructions in the PDF (copying over DLLs...) and despite this, when I tried to convert my animations across, the process hung on failing to process an animation that was deleted from the project.

    Since then, I realized the animation that was blocking progress had a name "Fly / Dive Attack".

    Problem is, the "/" character was confusing the process and caused a fail. Once I remove the "/" from the name, the process went fine.

    Hope this helps!
     
  31. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    Interesting. Haven't used the slash character myself, so I guess I missed that. I'll take a look at this and see if I can get a fix in the next service release. Thanks for the feedback!
     
  32. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Yeah we had to scale all the way down to .01 to get our SM animations down to a reasonable scale to work with physics and 2d Toolkit sprites.
     
  33. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    I was wondering if you had plans to add this and if you could possibly share a timeline. Just trying to figure out if we can hold out for this or if we have to figure out a different solution. Thanks!
     
  34. BytesOfChicken

    BytesOfChicken

    Joined:
    Jan 12, 2013
    Posts:
    34
    Yay just bought smooth moves and am expecting great things, I know it will help with the animations and keeping the file size down anything else is a bonus :)
     
  35. YetiForge

    YetiForge

    Joined:
    Sep 29, 2012
    Posts:
    18
    Hi Echo.

    I know this might be a dumb question but so far I've spent most of my time working with 3d and alot of the stuff on show here seems to be more vector art/hand painted stuff.

    How well does Smooth Moves work with pixel art?
     
  36. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,276
    I am not good at animating, but it can give you few exemples:

     
  37. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    Yep, that sounds about right. SmoothMoves brings animations in at 1 pixel = 1 world unit. Makes 2D orthogonal cameras work beautifully without much extra work. 1/100th scale will get you back to making your animations like 3D elements.
     
  38. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    I haven't spec'd this out yet, so I can't give you a definitive answer. I'll try to spend some time this weekend to see what all might be involved.
     
  39. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    Awesome, welcome to the community!
     
  40. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    The source style doesn't really matter as long as you can get it into a 2D format (like psd, png, jpg, etc). You can do some pretty cool animations with pixel art, making it look like old school sprite animation with a super high frame rate (due to smooth bone animation).

    Thanks for the great example, Changchun!
     
  41. YetiForge

    YetiForge

    Joined:
    Sep 29, 2012
    Posts:
    18
    Thanks Changchun. It looks good so I'm not really sure what you're saying. Much better than I could ever attempt.

    Sweet thanks Echo. Just what I wanted to hear. Like I say it was probably a really dumb question just wanted to ask it before I picked it up :) and had a look into some artists.
     
  42. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    It seems this may be a little larger of a task than I had anticipated. The materials are tied closely with the atlases, which span bones / animations. Swapping them out will swap then globally (like the SwapMaterial function). It will take quite a bit of overhaul to de-tangle the materials so that they can be changed on a bone by bone basis.

    Not sure what the timeline for this would be. There are currently a lot of other features and fixes at the top of my list right now. Hopefully you can find some solution to work with in the near future.
     
  43. Kyu

    Kyu

    Joined:
    Jul 27, 2012
    Posts:
    4
    Hey, thanks for the offer, but meanwhile we've been doing some tests on different machines and as it turns out, my computer is the only one showing the issue. I'm running a Macbook Pro, while my colleagues are all on generic Windows machines. So the problem was either with Macbook Pros or with OSX Lion itself.

    To isolate the problem further, I compiled the game for iOS 6.0 and for OSX Lion, and the problem didn't manifest itself. So the problem is with Unity 3.5.06f on Macbook, and even then it only happens the first time each animation is played.

    So personally I think it's a non-issue, just a minor hardware glitch that only happens on the editor itself anyway.

    Cheers!
     
  44. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Yeah, I was afraid of that. Thanks for looking.

    Wondering if there would be anyway to duplicate an SM atlas so the pivot points are preserved, but then swap in alternative source textures. That way we can use the swapTexture functions.
     
  45. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    Should be able to create a copy of a texture atlas by clicking on the texture atlas asset, then selecting duplicate from the Unity edit menu. You'll need to rename the atlas and then rebuild it as well.
     
  46. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Sure, I know how to duplicate it, but I can't swap out the textures and preserve the pivot points at the same time can I?
     
  47. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    Ah, I see what you are saying. No, you'd have to delete the existing textures and add new ones which would remove all pivot information.
     
  48. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Right, so what I am asking is, if there might be an easy way to support that somehow since the idea of SwapBoneMaterial is so complicated.
     
  49. echo17

    echo17

    Joined:
    Nov 24, 2011
    Posts:
    1,195
    I'll add it to my list. It is quite long, however, so it will probably be a while before I can get to this.
     
  50. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Understood, Thanks. Ever consider providing the source code as many other assets do?