Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  5. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

2D Animation Preview Packages

Discussion in '2D Experimental Preview' started by rustum, Mar 14, 2018.

  1. jalemanyf

    jalemanyf

    Joined:
    Jun 16, 2013
    Posts:
    15
    I have a problem using this package...

    I follow step by step of the tutorials/videos:

    1. Install the package.
    2. Go to the Sprite Editor.
    3. Bone Editor: create the skeleton.
    4. Create the Geometry.
    But!
    When I come to the Weights and click AUTO to autoGenerate the weights of the bones... NOTHING HAPPENS!

    No change the color of nothing, no information messages, no error... Only Silence!

    I repeat it a lot of times but with the same result... Please, what step I have lost?

    I'm using UNITY 2018.2.17f1 on Mac.

    Any help is welcome.
     
  2. antk

    antk

    Joined:
    Dec 10, 2013
    Posts:
    17
    when you are generating geometry, what values are you using for outline detail, tolerance, and subdivide?
     
  3. antk

    antk

    Joined:
    Dec 10, 2013
    Posts:
    17
    Is there any follow up on this? Or anyone have some insight on how to do this? I'd like to use a different body part sprite for a few frames of animation, but I couldn't figure out how to do this within the 2d animation package. I ended up creating a separate game object and animating that and activating and deactivating via code. Seems like a janky way to go about it though. Is there a cleaner, more robust way?

    Thanks!
     
  4. jalemanyf

    jalemanyf

    Joined:
    Jun 16, 2013
    Posts:
    15
    I have Tested different values...

    The last ones are:

    Outline detail: 0.25

    Alpha tolerance: 65

    Subdivide: 45

    Any idea what I’m doing wrong?

    Thanks
     
  5. antk

    antk

    Joined:
    Dec 10, 2013
    Posts:
    17
    Hmm, not sure why that would cause any problems. It may not give a very precise outline, but it should still at least generate vertices. The values I used for my sprite were 1, 254, and 100 respectively. Can you try that and see what comes out of it? Just curious.
     
  6. jalemanyf

    jalemanyf

    Joined:
    Jun 16, 2013
    Posts:
    15
    Hi
    Hi antk,

    I have changed the Values on Geometry for 1,254,100 and Generate...

    Now the SpriteMesh is very very detailed! With a lot of point and subdivisiones. OK...

    After that, I try two workflow:

    1.-Click Apply and after the computer process, Weights: I see all the bones with colours and the generated geometry.

    2.-Go directly to Weights ( without click Apply before )

    When I finally clicks on Auto... If doesn’t works!

    Could you say me step by step what you do... probably I forget something.
     
  7. antk

    antk

    Joined:
    Dec 10, 2013
    Posts:
    17
    Here's what I do:
    Import Sprite Asset
    Click newly imported sprite asset
    Click "Sprite Editor" in Inspector
    Click Bone Editor submenu
    Add bones, click Apply
    Click Skin Weights and Geometry Editor submenu
    Click Generate
    Fill values 1, 254, 100, click Generate button
    Click Apply
    Click Weights
    Click Auto
    Move some bones around to see that bones are moving and deforming mesh as expected
    Click Apply

    At that point you should be able to bring in the sprite to the scene, add the SpriteSkin component and start arranging and animating your sprite.

    Hope that helps.
     
  8. jalemanyf

    jalemanyf

    Joined:
    Jun 16, 2013
    Posts:
    15
    It still not works Ank, but thanks a lot Antk for your help and patience.

    If I discover something about what happens I will share to other ones.

    Regards,

    Josep Alemany
     
  9. Sergi_Valls

    Sergi_Valls

    Unity Technologies

    Joined:
    Dec 2, 2016
    Posts:
    88
    Hi, can you please send a bug report? Thanks

    Weight generation might fail in some circumstances. We fixed some bugs in the next version that will reduce those cases.

    If both sprites share the same bones you should be able to swap them in the animation clip. If that's not the case, you did the right thing. Next version of the tools will enable multiple sprites sharing the same skeleton.
     
  10. HEROTECH70

    HEROTECH70

    Joined:
    May 24, 2017
    Posts:
    10
    Has anyone had any issues on iOS?

    My app has content which is downloaded with an asset bundle, on android it works fine, on iOS nothing is moving.

    I have not time to investigate this right now, will try to reproduce the issue on monday, just wanted to know if this is a known issue.
     
  11. b-king123

    b-king123

    Joined:
    Mar 1, 2017
    Posts:
    2
  12. nsfnotthrowingaway

    nsfnotthrowingaway

    Joined:
    Feb 18, 2016
    Posts:
    37
    @Sergi_Valls is it possible to set weights, vertices, etc of a spritemesh at runtime, even if it involves some roundabout method. Say if you wanted to make a runtime importer from another format that would control spriteRenderer or spriteMesh. I realize some of these values are hardcoded into the sprite asset, but I was hoping there was a way to directly inject the weights or final positions for the deformable mesh vertices to supersede the ones in the sprite asset. I'm particularly interested in a way to procedurally generate a mesh each update. I'm asking not about the math required to determine weights and such, but just how to get access to set those values for the renderer once you already have them.
     
    Last edited: Dec 8, 2018 at 11:33 PM
  13. drordoit

    drordoit

    Joined:
    Sep 7, 2013
    Posts:
    16
    Is it possible to switch the sprite to a similar one (via script) after applying bones to it ?
     
  14. Peppered_Pig

    Peppered_Pig

    Joined:
    Oct 28, 2016
    Posts:
    7
    I'm sure all are answers are gonna be answered soon :) but just to throw it out there I hope we don't have to create and bind spritemeshes to bones every time like we did in Anima2D. It was a real hassle and didn't work properly most of the time. I hope we can easily be able to swap sprites without having to make sprites meshes and binding it to the bones.
     
  15. Sergi_Valls

    Sergi_Valls

    Unity Technologies

    Joined:
    Dec 2, 2016
    Posts:
    88
    Please report a bug. Thanks!

    You can set the data into the Sprite by using this API: https://docs.unity3d.com/ScriptReference/Experimental.U2D.SpriteDataAccessExtensions.html
    To set the final deformed positions into the SpriteRenderer: https://docs.unity3d.com/ScriptReference/Experimental.U2D.SpriteRendererDataAccessExtensions.html

    You can switch the sprite in the SpriteRenderer via script. The only requirement is the bone list should be compatible.

    We are aware of the need for swapping sprites. Unfortunately this release won't bring specific improvements on that.