Search Unity

EasyMotion2D - Make 2D Skeleton Animation in Unity3D easily.[RELEASED]

Discussion in 'Assets and Asset Store' started by typehm, Oct 18, 2011.

  1. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    Hi, iByte
    Answer is yes. In 0.43 provide two components named SpriteSceneRenderer and SpriteMeshRenderer.
    SpriteSceneRenderer can rendering sprites in scene without a Camera2D.
    SpriteMeshRenderer can rendering a sprite into a mesh in scene. You can use it like a normal mesh.
    You can find these components in menu item EasyMotino2D/GameObject or EasyMotion2D/Component.

    In your case, I think the reason is your other cameras can view the mesh of sprites in scene, so it will rendering to screen. This mesh attach at a SpriteBatchRenderer. So if you dont want your other camera view it, you should cull the layer of SpriteBatchRenderer to your cameras.
     
  2. yadoa

    yadoa

    Joined:
    Oct 24, 2011
    Posts:
    13
    Thanks to a kind reply.
    I checked one more time, RenderModeSetting problem is that my mistake was caused by.
    What was something goes wrong, I make re-settings my project and update to work nicely.:razz:
     
  3. yadoa

    yadoa

    Joined:
    Oct 24, 2011
    Posts:
    13
    I write again.
    Usually the that problem does not appear.
    but under what circumstances will occur again.
    Then restart the unity is expressed normally again.
    Please check this problem.
    Unfortunately, did not make the situation again
    Does not take a screenshot.

    And
    if a previous version of the animation data import then data is broken.
    The problem, first, import the animation and update to version 0.44, the data are maintained.
     
  4. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    Thank you for the feedback, I will check this issue.
     
  5. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,048
    Hi I have a GameObject with a Sprite Animation component on it. I made this GO a child of another object. When i relocate the parent game object the sprite does not show up until I start the animation. Is there a way to force a redraw when the parent is relocated?

    Okay - I found the update setting :)

    iByte
     
    Last edited: Dec 12, 2011
  6. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,048
    What do you do if there are no empty frames around? That is why i suggested a modifier key.

    iByte
     
  7. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    I got your point, I will add a modifier key.
    Thank you.
     
  8. PepperGameplay

    PepperGameplay

    Joined:
    Oct 21, 2011
    Posts:
    36
    You have an estimate of when would the version with Blendiing Animation and Animation Mixing???
     
  9. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    I think it will commit to asset store in this week end. I working for the samples and doucments now.
     
  10. PepperGameplay

    PepperGameplay

    Joined:
    Oct 21, 2011
    Posts:
    36
    This is excellent news. I'm waiting.

    THANKS!!!!!!!!
     
  11. crystani

    crystani

    Joined:
    Jul 29, 2011
    Posts:
    68
    Hi, typehm.

    EasyMotion 2d is the best best 2d solution that I purchased so far on the asset store.

    But Is there any way of using an animation clip to show multiple different characters sharing same motion/animation? For example, a warrior and a wizard might have same walking motion but with different appearance.

    I couldn't find how I can do that with EasyMotion2D, if I missed that feature please tell me what I should do. Or, if it is now implemented yet, I think adding this will be really great.



    Below are what I tried as a workaround.

    1. Duplicated the desired animation at project view and changed sprites for each component's frames manually or using SpriteAnimationClipUtility.ComponentDelegate. However, this approach changes the asset file for sprite animation clip permanantly when I run the game inside the Unity editor.

    2. So I tried to make a clone instance of the spriteAnimationClip using Unity's Instantiate method, changed things like sprite refs for this clone instance, then I finally Add the clone spriteAnimationClip to the SpriteAnimation that should Play the animation clip (cloned). (Using SpriteAnimationUtility.SetAnimationClips) The problem is, while non-instantiated clips are played successfully, the clone instance animation clip are not played. I am still finding what I have to do now.

    However, I don't think changing sprites at runtime is the proper answer. I hope I missed something basic to share animation clips for multiple objects, but looking at Sprite animation clip's data makes me conclude that easy motion 2d is not designed for this.
     
  12. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    EasyMotion2D v0.45 will coming soon. But still need 2-3 days to fix some issue.

    Here is the new demo of new animation system.

    This demo show you how to blending animatiions and mixing animations. Also, additivie animations include in it too.

    This demo will release in v0.45 with fully resource.

    Enjoy it.

    CharacterAnimation
     
  13. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161

    Hi, crystani

    There is two way the share the animation motion in EasyMotion2D now.
    1.) Static: Just duplicated a clip in project window in Editor, and replace the sprite in keyframes in copied clips.
    2.) Dynamic: Get SpriteTransform of sub sprite in clip at runtime. And assgin a new sprite to override the sprite.
    for example:

    public Sprite newSprite;

    //in function
    SpriteTransform sprTransform = spriteRenderer.GetSpriteTransform("subSprite");
    sprTransform.overrideSprite = newSprite;


    I think it looks like a avatar more the share motion.

    I will add a demo to show how to do this in runtime in v0.45. And add a helper component to do it in next version of v0.45.
     
  14. crystani

    crystani

    Joined:
    Jul 29, 2011
    Posts:
    68
    Thanks for your quick reply.

    With this approach, I could successfully override a subpart of character's sprite.

    However, this approach doesn't handle the case where animations with subparts whose sprites are changing by keyframes. For example, if there is a zombie animation clip with "head" sprite transform having 2 keyframes, and those 2 keyframes have different sprites (one is clean head and the other is bleeding), what I get with that override function is just one single sprite for each keyframe. (i.e. an exploded head)

    In other words, It will be great if it is possible to change sprites(like clean, bleeding, exploded heads ... maybe base on the names of the sprites) that are used for an animation clip, not the subpart of the animation clip at runtime without affecting asset itself. That was the reason why I was trying to iterate an animation clip with SpriteAnimationClipUtility.ComponentDelegate to affect every key frame in the animation clip. I think that this is already possible except for the fact that this approach will change the asset permanently.


    So I tried like below as a workaround.

    I did this purely in order to avoid affecting the animation clip asset.

    With this code,

    If I add 'clip' to 'spriteAnimation' and play it, it doesn't show animation clip that I was looking for. However, If I add 'clipAsset' to 'spriteAnimation' and play it, I can see the animation that is perfectly working. I think that this is because 'SpriteAnimation' is somehow disallowing an instantiated animation clip.



    The best solution for my case is having a method that accepts two arguments: Sprite group/ Sprite asset and animation clip. The method should compare entire keyframes while iterating the animation clip with sprite group's sprites (base on the names or sprites I think) and substitutes those keyframes's sprite refs with desired sprite groups's counterparts.

    Or at least, I hope there is a way of affecting a keyframes's sprite reference without affecting asset itself in editor. (I think you implemented this for the editor for authoring assets though.)
     
  15. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161


    Hi, crystani

    I will implement components or interfaces to support your requirement in v0.46.
    You suggestion is very nice. I think i can provide some utitlity to help people to clone a clip and replace the sprite at keyframes in sprite group or asset with same name at runtime.
    I will try it.
     
    Last edited: Dec 17, 2011
  16. crystani

    crystani

    Joined:
    Jul 29, 2011
    Posts:
    68
    HI,

    That's really nice. Really thank you for the future upgrades.

    By the way I realized that It would be better to have an option whether changes at runtime in editor should be applied to assets permanently or not. (And maybe this could be a solution to my requests.)

    For instance,

    With this code, assets (not the instance) are affected. There might be something similar to 'sprTransform.overrideSprite' but I couldn't find it yet.

    I think it would be better to have an explicitly way of deciding whether changes should be applied to assets or not. (Maybe for the commands/modifications that affect assets)
     
    Last edited: Dec 19, 2011
  17. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    Thanks for you suggestion. I will thinking more about it.
     
  18. Curious

    Curious

    Joined:
    Nov 19, 2009
    Posts:
    334
    Hey man, how's the 0.45 update coming up so far?
     
  19. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    In fact, I release a test version to some users in this monday, they feedback many issues.
    I finish fixing now. After testing, I will commit it to Asset Store.
     
  20. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    EasyMotion2D v0.45 available in AssetStore now. And v0.451 commit to review now.
    Sadly, some users feedback some issue of upgrade clip from 0.44 to 0.45, because 0.45 have a new animation system, so the clip include some new data member need initialize. But in some case, upgrade clip from 0.44 to 0.45 will failed, these member can not initialize success.
    I am keep working to fix these issues.

    If you just start a new work in 0.45, that is OK.
    If you need upgrade from old version, please backup your project at first. If get in troublue in upgrade, please contact me: typehm@foxmail.com.

    Importtant about Upgrade
    If you still working with 0.43, then you can not upgrade to 0.45 directly, you should be upgrade to 0.44 at first, then upgrade from 0.44 to 0.45.
    Before upgrade, please backup your work.
     
  21. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    Source of EasyMotion2D runtime is open.

    You can get it from: Github

    New reference manual is update.

    You can get it from: Wiki
     
  22. crystani

    crystani

    Joined:
    Jul 29, 2011
    Posts:
    68
    For v. 0.45, I have some issues (not the updating issues)

    1. With version 0.44, I could successfully get SpriteTransform with SpriteRenderer.GetSpriteTransform(string ..). However, after upgrading this, it doesn't work properly. (or at lease it doesn't work as before.)

    2. I am continuously experiencing below error messages whenever I run in the editor in some uncertain cases. (This happened even for v. 0.44)

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Utils.PerformanceChecks.CheckMaterial (UnityEngine.Material mat, BuildTarget buildTarget)
    UnityEditor.MaterialEditor.PropertiesChanged (UnityEngine.Material material)
    UnityEditor.MaterialEditor.OnEnable ()

    I am developing an iOS Game, with iOS Pro license.

    3. I tried to use easy motion 2d runtime source code. I believe that what I have to do is substituting EasyMotion2d.Runtime with contents of Git's Easymotion2d runtime source code. However, when i tried that, it didn't work properly. (Showing some frightening messages.) Is there anything I have to do before applying the runtime source code? Anyway, it is really nice to have runtime source code. I am sure that it will be much easier to figure out what is going on and find out reasons for errors. Why don't you put the runtime sources from the beginning on Asset store? (If you did so for 0.451 already, that is awesome.)


    Update:

    For the 1st issue, I found that this only happens when SpriteAnimtion's PlayAutomatically is turned on. But the previous version did work well! (or at least they work differently.)

    Update 2:

    4. PlayAutomatically has also somewhat strange effect on SpriteAnimationState. For example,

    spriteAnimation["abc"].enabled = true;

    above code has no effect if that spriteAnimation is automatically played. (If it is not checked, it works so well.)
     
    Last edited: Dec 22, 2011
  23. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    Hi, crystani
    1.) SpriteRenderer.GetSpriteTransform can not return a stable reference now. You should be re-get it when you need.

    2.) When you click play button in editor, EasyMotion2D will re-create all material in runtime. If your inspector display the materials inspector, it will lost old material in this time.

    3.) You need compile the source into a .NET dll. I provide a windows Visual C# express 2008 solution file in git. I will provide a monodevelop project file later.
    I can not put the source in the release package now, because all the exist asset will reference the class in the dll, if i remove the dll, all exist asset will damage. So I release the source on git, you can poll the source, and compile it to replace the dll in package.
     
  24. crystani

    crystani

    Joined:
    Jul 29, 2011
    Posts:
    68
    Hi, typehm

    What I was trying to do is overriding sprite transform after getting things with SpriteTransform. The problem is, even I consider the fact that SpriteRenderer.GetSpriteTransform doesn't return stable reference anymore, what I was trying shouldn't be affected. As I used it for getting transforms to override sprites once when it is starting, re-getting issue is not the culprit of the odd situation.

    More precisely, I overrode sprites using a script. The script's Start method find transforms with SpriteRenderer.GetSpriteTransfrom. Previous versions returned the transform as I wanted. Now, v 0.45 doesn't return proper transform now. Instead, it returns null. I don't think this is stable reference related thing. SpriteRenderer.GetSpriteTransform(with index) works well.

    In short,

    SpriteRenderer.GetSpriteTransform(with index) woks well. I can get proper transform.
    SpriteRenderer.GetSpriteTransform(with name) does work strangely (returning NULL instead of ref, even the ref is intended to be re-get when it is needed it should return proper ref at least once if I am correct.) when Play Automatically is checked. (If it is not checked, it works well.)


    ps) I asked about the issue below,

    I guess this is also somewhat related with the issue with automatically played animations.
     
    Last edited: Dec 22, 2011
  25. crystani

    crystani

    Joined:
    Jul 29, 2011
    Posts:
    68
    typehm,

    I recommend you to test EasyMotion on 3.5 public beta. When I tried unity3d version 3.5 (public beta),

    and got this message:

    Looks like I have to return to version 3.4 for now.
     
  26. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161

    Hi,
    How do you call the GetSpriteTransform()? You pass the paramater is a name or a path?
     
  27. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    I will check and fix it soon.
     
  28. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    A Known Issue in 0.45:

    If create a prefab and drag a gameobject with SpiteaAnimation component to the prefab will make Unity3D Editor hang.

    Please be careful this issue now.
     
  29. crystani

    crystani

    Joined:
    Jul 29, 2011
    Posts:
    68
    1. With name. Is it a pass? but code hint tells me parameter is name.... and this only happens when the animation is Automatically starting.

    2. Like first issue above, PlayAutomatically has also somewhat strange effect on SpriteAnimationState. For example, when animation clip 'cba' is running automatically by checking PlayAutomatically,

    spriteAnimation["abc"].enabled = true;

    above code has no effect. (If auto-start is not checked, it works well.)
     
  30. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161

    GetSpriteTransform can accpet the parameter is a name of bone, also it accpet the parameter is a path of bone.

    Thank you for the feedback. I will check and fix it.
    I will release the fixed runtime on Git with source and binary.
     
  31. PepperGameplay

    PepperGameplay

    Joined:
    Oct 21, 2011
    Posts:
    36
    The current version has Blendiing Animation and Animation Mixing???
     
  32. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161

    Yes, you can the see examples in Animation Blending folder.
     
  33. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    Fixed.
    Reason:
    Create prefab will call OnEnable if your component with a ExecuteInEditMode attribute. If in this time, insert a item to a hastable or a dictionary, Unity3D will hang.
     
  34. undream

    undream

    Joined:
    Dec 24, 2011
    Posts:
    27
    I really like this tool. However, I have one small concern that's stopping me from purchasing this tool..
    I had the chanceto try the 2D Toolkit before, and it has the "premultiplied alpha" option when dealing with alpha-texture atlases.. Does this tool have a similar option as well ? Or do we have to deal with the premultiplied alpha problem within our textures, manually ?

    Thank you.
     
  35. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    Hi, undream

    EasyMotion2D support to convert a sprite image to premultiply alpha now.
    You can do it in following steps:
    1. Create the atlas image.
    2. Use the atlas image create a sprite
    3. Convert the image of this sprite to premultiply alpha.
    4. Remove the sprite.
    Now, the atlas image is a premultiply alpha.
    Also, you can convert the sprites image at first, then pack them into a atlas.
     
  36. undream

    undream

    Joined:
    Dec 24, 2011
    Posts:
    27
    Thank you for the reply.. What about the sizing of the "sprites" ?
    Do they get their in-game size and positions depending on their original sizes ? Or do they get sized automatically ?
    I use cinema4D to create my animations, and would like to be able to use it when I need. I've tried ex2D but... it takes the control of the whole sizing and positioning, which makes it unusable for me when I import my own FBX...
     
  37. undream

    undream

    Joined:
    Dec 24, 2011
    Posts:
    27
    Also, is there any trial, light, or limited version ?
    Videos look really good, but would love to be able to try and see how fluently this fits into my current pipeline as a replacement to my existing tools..
     
  38. undream

    undream

    Joined:
    Dec 24, 2011
    Posts:
    27
    I bought this tool, but getting an error message when creating the sprite. I can not see anything in the camera. Followed your tutorial on the website.
    Here is the error message:

    NullReferenceException: Object reference not set to an instance of an object
    EasyMotion2D.SpriteRenderer.Init ()
    EasyMotion2D.SpriteRenderer.OnEnable ()
    UnityEngine.GameObject:AddComponent()
    EasyMotion2D.Easy2DEditor:CreateSprite()
     
  39. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    Hi,
    This issue fixed in 0.452, I will release it soon. Even you get this error, spriteRenderer can be work correct, you just need add a sprite to the SpriteRenderer in inspector.

    If you can not see the sprite in game view:
    In this case, please check the SpriteRenderer follow steps:
    Is these a gameobject with a Camera2D component in the scene? If no, will not renderering any sprite in the Scene.
    Do you select a sprite to the current frame of the SpriteRenderer? If no, will skip this sprite when rendering.
    Do you select a RenderModeSetting to the renderMode of the SpriteRenderer? If no, will skip this sprite when rendering.
    Do you set a color with 0 alpha to the color of the SpriteRenderer? If yes, you will can not see the sprite, because it will full transparent.
    Do you set the cullFlag of Camera2D but sprite's layer not one of these layers? If yes, will skip this sprite when rendering.
    Do you set the clipping of Camera2D and sprite out of the viewport? If yes, will clipping this sprite when rendering.
     
  40. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    Yes, you can get a trial at http://www.soft-hm.com/ccount/click.php?id=1.
     
  41. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    The sprite will sizing to their pixel size automatically. You can use transform.localScale to resizing them.
    Also, I will add a sizing factor in spriteRenderer in 0.452, you can use this factor to resizing the spirte without use the transform.localScale.
    And you can use the scale factor in Fbx importoer to reszing the fbx to a right size.
     
    Last edited: Dec 25, 2011
  42. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    Please a EasyMotion2D user named Murat Pak contact me. I will help you to sovle your questions.
     
  43. crystani

    crystani

    Joined:
    Jul 29, 2011
    Posts:
    68
    HI, typehm.

    With v0.451 Demo named Multi Animations, there are lots of consistent GC calls. Looks like this happens when animation clip is changed. And Of course, my game frequently changes clip for an animation, so it needs to be fixed soon I think.





    Hope this will be fixed soon.
     
    Last edited: Dec 25, 2011
  44. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161

    Hi, crystani
    The major target in 0.46 is optimize speed up and make memory usage less and gc less.
    After bug fixing, I will start the working for this.
     
  45. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    EasyMotion2D can running on Unity3D 3.5.0b6 now.
    I will release a new version with some bug fix soon.

    But export to Flash not work well. Because there is some template code in core code, it will made build to Flash occur error.
    I will try to rewrite these code to support export to Flash in 0.46.
     
  46. undream

    undream

    Joined:
    Dec 24, 2011
    Posts:
    27
    Hello typehm, I've sent a PM to you, please check it when you have time :)
    (Murat Pak)
     
  47. crystani

    crystani

    Joined:
    Jul 29, 2011
    Posts:
    68
    Looks like version 0.46 will solve the problem. But in order to reduce (potential) hiccups, reducing GC is very important.

    I moved on to this from my own rigging based (made with Maya) animation and need to release my project in January. I know you rapidly upgrade this but nowadays you update Easymotion2d by 0.01, so it is hard to tell when version 0.46 will come. To tell the truth I can't wait so much for this. Please consider re-prioritize optimization, especially with noticeable garbage collections.

    Thanks,
     
    Last edited: Dec 26, 2011
  48. nab477

    nab477

    Joined:
    Jun 14, 2011
    Posts:
    46
    is the current version (0.451) stable ?

    I bought it today Unity keeps crashing

    also, when it crashes, I usually lose one of the animations !! do I need to press "Rebuild Curves" after I edit anything or is it lost because of crash ?
     
  49. nab477

    nab477

    Joined:
    Jun 14, 2011
    Posts:
    46
    another question,

    does the sprite animation ( 2D camera) use the Z position ? if not, how do i arrange the sprites (example: higher in Y = further from camera)
     
  50. typehm

    typehm

    Joined:
    Jun 24, 2011
    Posts:
    161
    Hi, please contact me with mail. I will help you.
    typehm@foxmail.com