Search Unity

Puppet2D - An advanced skeletal animation tool

Discussion in 'Assets and Asset Store' started by jamieniman, Dec 31, 2013.

  1. cpavanelli

    cpavanelli

    Joined:
    Apr 11, 2013
    Posts:
    6

    Yes, that's it! haha

    It works fine on my project, I was just wondering if your component might not be compatible with it.

    I guess I will give it a try anyway, hehe.

    Thanks
     
  2. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Is it possible to use mecanim to retarget animations to other characters ?
     
  3. cpavanelli

    cpavanelli

    Joined:
    Apr 11, 2013
    Posts:
    6
    Oh good, so it will work, thanks man!
     
  4. eddie312

    eddie312

    Joined:
    Sep 13, 2012
    Posts:
    24
    Sorry for the late answer for the puppet in 3d World script i make it in my own script but i think you can add a function in the Puppet2D_GlobalControl.Cs

    Code (csharp):
    1.  
    2. void FaceCamera(){
    3.         foreach (Puppet2D_IKHandle p in _Ikhandles) {
    4.            p.AimDirection = Camera.main.transform.forward.normalized;
    5.                     //change the aiming of IK to the forward vector of the camera
    6.         }
    7. }
    8.  
     
  5. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    ha, so simple. I might actually make it aim from the rotation of the global_CTRL so that u could rotate the character into any plane you like - just in case u wanted to make paper mario $papermario.jpg
     
  6. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    483
    Is there any support to Skinned Meshes from Packed Textures from 2D Toolkit?
     
  7. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Not currently, it only supports using the 2D Toolkit sprites as parented children at the moment.
     
  8. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Perhaps I'm totally missing the point of this package but I was wondering if the following can be done?

    1. Rig and animate a character in the editor.
    2. Retarget the animation to another rigged character using mecanim.

    http://www.youtube.com/watch?v=RWGAeLBQg80
     
    Last edited: Feb 18, 2014
  9. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Thats pretty much what Puppet2D is for ;-)
    Currently Puppet2D works with Mechanim Generic Setups not Mechanim Humanoid. All thats needed is to figure out how to make an Avatar from code (usually avatars are created when u import from an fbx). Its on my list to look into adding this feature.( It would also require baking control animations to bones, which is also a feature I'm currently writing)
     
  10. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Very cool, this is exactly what I need.

    Q: Is it possible to create and rig a character during run time ?
    Would like to make a 2D avatar customization.
     
  11. MarioRuiz

    MarioRuiz

    Joined:
    Nov 7, 2009
    Posts:
    161
    I think it works better the other way around, I mean having the puppet2d char somewhere under UIRoot just like every other ngui widget
     
  12. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    I'm going to be exposing the important functions out of the editor so you'll be able to do this. In the meantime there maybe other ways for you to do the avatar customisation with puppet2D such as having the rig already made and swapping out the sprites
     
  13. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Thanx Mario, are you saying you've tried this and it works?
     
  14. MarioRuiz

    MarioRuiz

    Joined:
    Nov 7, 2009
    Posts:
    161
    Yes, AFAIK uiRoot applies a scaling base to all children to achieve the pixel perfect effect, so yeah, an ngui object outside of uiRoot will have a really big scale.
     
  15. MarioRuiz

    MarioRuiz

    Joined:
    Nov 7, 2009
    Posts:
    161
    Hey Jamie, any eta on ffd?

    And also, you mentioned there being a problem with changing sprites on runtime? could you elaboate on that?
     
    Last edited: Feb 24, 2014
  16. selimanac

    selimanac

    Joined:
    Jan 28, 2013
    Posts:
    12
  17. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987

    Cant give an exact date yet, recently made some headway that will make it possible. The convert sprite to mesh now can have vertices in its interior which is a key step forward.
    U can switch sprites at runtime and in animations, but you can't switch meshes .
     
    Last edited: Feb 24, 2014
  18. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
  19. raul82

    raul82

    Joined:
    Mar 27, 2013
    Posts:
    3
    is Puppet2D wokr in flash ?
     
  20. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Sorry, Puppet2D is a Unity only plugin :)
     
  21. raul82

    raul82

    Joined:
    Mar 27, 2013
    Posts:
    3
    i mean work in flash export )
     
  22. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Oh!

    Puppet2D works for Unity 4.3 onwards, and flash export has been removed I think.
     
  23. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Awesome,

    Is there rough ETA on this.

    No pressure, need to do project planning.
     
  24. Denis631

    Denis631

    Joined:
    Feb 5, 2014
    Posts:
    1
    Hello I just bought puppet2d today and I have a problem converting the sprites into meshes.

    $screen.jpg

    no matter what i click this is what follows

    $Screenshot-2014-02-26-18.09.11.jpg

    What am I doing wrong?
     

    Attached Files:

    Last edited: Feb 26, 2014
  25. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Currently you shouldn't move the pivot in the sprite editor, thats whats causing the textures to be mis-aligned. To fix, open sprite editor and centre the pivot on that sprite.
    In most cases you shouldn't need to move the sprite pivots as the bones act in place of the pivots.

    (Its on my list to fix this issue anyway)
     
    Last edited: Feb 26, 2014
  26. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    I'm working on some other cool puppet2d features currently, but I'll take a look next week and let u know a rough ETA, based on how difficult it is to change.
     
  27. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Hi All!

    I've released a new update to Puppet2D with the following improvements/fixes:

    - Ability to rotate character into any axis plane from global_CTRL

    - Bone Scaler size now goes between 0 1, accounts for much smaller scales.

    - Move bones with "CTRL" using Create Bone Tool

    - More prominent Bone Creation Edit Skin Weights

    - Refresh toggle on global_CTRL allows you to manually rearrange control execution order if turned off (for the more advanced user)

    - Vertex Handles default to controls layer

    - Fixed bug to stop you from trying to skin sprites,bones or controls
     
  28. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Hi Again!

    I've made a quick animal leg "advanced rigging" tutorial:



    here are the steps written down I know I'm a bit quick in the video :)

    1. create a bone chain bone_1 > bone_2 > bone_3 > bone_4

    2. duplicate it and rename it to bone_5 > bone_6 > bone_7 > bone_8 (leave bones in current position)

    3. Unparent bone_6 from bone_5 and delete bone_5

    4. Delete bone_4

    5. You now should have bone_1 > bone_2 > bone_3 and one_6 > bone_7 > bone_8

    6. Select bone_2 and rename it bone_2Hidden

    7. Select bone_3 and rename it to bone_3Hidden, and create an IK on it

    8. Create an IK on bone_8

    9. Parent bone_6 to bone_2

    10. Parent the bone_3Hidden_CTRL_GRP to the bone_8_CTRL IK handle

    11. Make sure the refresh is unchecked on the global_CTRL

    12. Remove the sprite renderer components on bone_2Hidden, bone_3Hidden and bone_3Hidden_CTRL
     
    Last edited: Feb 27, 2014
  29. peterfrog

    peterfrog

    Joined:
    Dec 13, 2013
    Posts:
    9
    animation bake button.. any changes?

    i am making mobile game. and dont' need realtime IK update. for performance issue.

    if you have project roadmap.. let me know. please.
     
  30. oleg9419

    oleg9419

    Joined:
    Feb 7, 2014
    Posts:
    9
    Hello I am currently having a problem setting the scale to -x in order to turn it the other way around.
    No matter if I put or I don't put a minus in the front of x scale it just doesn't affect it , if I set it to 5 for eg. it gets bigger , but if I put -5 it just doesn't affect it is like scaling to +5.
    A little bit of help please?

    Thanks )

    $0.jpg
     
  31. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Use the flip checkbox on the global_ctrl instead :)
     
  32. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Here is the trello link: https://trello.com/b/JHI4ybs4/puppet2d-feature-bug-list

    You can see what im up to generally, sorry I can't be more certain about timings tho. You'll see ive done some work on the anim bake script. Ill make a note on it when it's in a unbroken state and if u email me with ur invoice ill give it to u to try out :)
     
  33. oleg9419

    oleg9419

    Joined:
    Feb 7, 2014
    Posts:
    9
    Hello Jamie :)

    I did that flip thing , but it has caused a big offset during walk/attack animation in the right direction of x axis , and furthermore all my colliders are getting smaller .

    Any ideas why this happens?

    $Unbenannt0.jpg
    http://www.fileswap.com/dl/A0GiPccOU1/
     

    Attached Files:

    Last edited: Mar 2, 2014
  34. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Likely hood is ur global_ctrl pivot was in a strange place compared to the character. Its best atm to build ur character near the origin (0, 0, 0)
    To fix: unparent everything from the global_ctrl, move the global_ctrl gameobject to where u want his pivot to be, and then reparent everything.
    Not sure what happened to ur collider, very strange indeed. Could u perhaps package up just the character and send him to puppet2d@gmail.com
     
    Last edited: Mar 2, 2014
  35. oleg9419

    oleg9419

    Joined:
    Feb 7, 2014
    Posts:
    9
    I did that but it didn't work .
    Now I've added a box2d collider and a kinematic rigid body to your puppetman's hip bone and before playing its shoot animation I flipped it (his face is in the right direction now), I play the animation and the damn collider gets smaller and bigger as the animation plays.
    I can post some screens if you want .

    Thank you :)
     
    Last edited: Mar 2, 2014
  36. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Is it possible u could send him to me so I can take a closer look?
     
  37. oleg9419

    oleg9419

    Joined:
    Feb 7, 2014
    Posts:
    9
    Of course :D
     
  38. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    I see what it is now, actually this problem isnt unique to puppet2D.
    I'm gonna work on a solution that fixes it in puppet2d
     
    Last edited: Mar 2, 2014
  39. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Ok I have a temporary fix, I'll email you with the details - I'm also contacted Unity to see when they are likely to be fixing this bug
     
  40. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    I am following your video. It seems after you draw the spine. you right click then select the top spine joint by left clicking then draw the arm chain. this seems to parent it to the top spine joint. Mine doesn't work that way when I try to do it. What am I doing Wrong??

    Also I made a Joints Layer biut I can only select "default" in the Puppet 2D window.
     
  41. funshark

    funshark

    Joined:
    Mar 24, 2009
    Posts:
    225
    I think you've done a simple Layer and you now have to do a Sorting layer. Some things in the video are outdated.

    It's working for me.
    The parenting is done when you right click again or when you hit enter. ( so it's normal you don't see it parented at the beginning )
    Try again?
     
    Last edited: Mar 3, 2014
  42. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    No it makes a shoulder joint which isn't shown in the video. I right click then left click the last back joint then start the arm chain and get that extra joint I don't want.
     
  43. funshark

    funshark

    Joined:
    Mar 24, 2009
    Posts:
    225
    All right, it's because you're clicking on the very last joint ( the circle ) and you need to click on the joint before ( the "bone").
    If you click on the very last joint of a chain, it automatically continues the chain.
     
  44. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    Ok that worked for the first arm. But it always fails on the second arm. Also I wished it actually highlighted the joint like in the video. In the free version of unity it doesn't. Can't for the life of me get it to work past the first arm.
     
  45. funshark

    funshark

    Joined:
    Mar 24, 2009
    Posts:
    225
    The "highlight" occurs on the free version too, I can tell because i'm working with the free one and I have the same behavior :)
    It's definitely something you're doing wrong. Maybe a video capture or a precise workflow description may help here since I don't really know what you're doing exactly

    >> try to use that to do the capture http://www.cockos.com/licecap/ it's free easy to use
     
  46. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    Work flow is the same as on the video. I am on a PC. The only difference is that it is Definatly not working
     
  47. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    Found the issue. If you don't have "2D" Clicked above the viewport it goes loopy during skeleton construction.
     
  48. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Yes, Puppet2d expects you to be in 2D mode for all its construction. Glad its all sorted for you now :)

    Love your creepy mickey avatar by the way :D
     
    Last edited: Mar 3, 2014
  49. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Oh yeah,
    One new little feature I've added since v1.6 is that you can move the bone i construction mode by holding CTRL (its not in the tutorial, can be quite handy)
     
    Last edited: Mar 3, 2014
  50. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    Everything is going smoother except when I create the mesh for the back leg it is trashed. Part of the foot is missing and verts are in bad order. Adding a 2d polygon collider does not change the outcome.