Search Unity

Puppet2D - An advanced skeletal animation tool

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

  1. Keith90

    Keith90

    Joined:
    Sep 27, 2013
    Posts:
    116

    Can I make all the animations I need then bake it or do I have to bake the animations as I make them? If possible, I'd love to make my player, get that all done, then bake the animations as one of the last steps, just to see the difference.
     
  2. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    You can bake them at the end or as you go - the only thing is you can't use both baked and unbaked animations together at the same time on the same AnimatorController.

    The advice I would give you is to keep a second Animation Controller to test your baked animations out on. (Also after you bake don't forget to re-enable the global_Ctrl script to use you're controls again.)
     
  3. Keith90

    Keith90

    Joined:
    Sep 27, 2013
    Posts:
    116
    Thanks, I'll make sure to give it a shot.
     
  4. B0b

    B0b

    Joined:
    Sep 26, 2014
    Posts:
    5
    Hi :) i have already purchased Puppet 2D and it is a very advanced animation tool .
    When are you willing to release v2 cause i really need to use the FFD feature in my project .

    Thank you
     
  5. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Hopefully some time in October - I'm just finishing up a skin weight painting tool, and then need to make some support material, but should be ready once thats done.

    You can get a beta version now if you send me your invoice number to puppet2d@gmail.com
     
  6. JDuaneJ

    JDuaneJ

    Joined:
    Jul 26, 2014
    Posts:
    29
    Jamie, I'm seeing a new problem. I'm not sure if it's Puppet2D or the mecanim transitions, but I'm seeing non-baked animations not playing all the way through. The controls are playing all the way, but the sprites seem to stop halfway through the anim. You ever seen anything like that?

    My anims are not baked, and this seems to only be happening to a few of the 15 anims I have hooked up. The mecanim is transitioning from a long anim to a shorter anim. Again, I can see the longer anim being cut off (but still plays through because I can see the controls moving just not the sprites) Sorry if this is getting redundant. lol

    During Game
    upload_2014-10-2_11-36-51.png

    In Editor view, playing through Animation Window below.
    upload_2014-10-2_11-39-8.png
     
  7. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    You don't have any other "baked" animations mixed into your animator controller do you? Mixing baked and non baked animations can mess things up a bit.
     
  8. JDuaneJ

    JDuaneJ

    Joined:
    Jul 26, 2014
    Posts:
    29
    No, they are all straight from the 2D plugin.
     
  9. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    I'm not too sure then - do you notice anything different about the transition or the animations that are broken?
     
  10. Tor_Sprouted

    Tor_Sprouted

    Joined:
    Oct 7, 2014
    Posts:
    13
    Hi jamieniman.

    First, let me join the chorus of admirers and extend my own heartfelt thanks in first developing and then supporting your Puppet2D tool. Great work. I'm building my first mobile game using your tool, and I'm looking forward to sharing the end result.

    Got two questions:
    1) When will your new 2.0 version be out, and will it be a simple matter of updating through the asset store within unity? (A sneaky third question: will it be completely backwards compatible to v1.1?)

    2) What could have occurred in the following situation?

    My Global_CTRL lost it's IK_handles size parameter? There were 4 of them, which referenced the hands and feet of my enemy, and then it was 0 and lost it's reference. This occurred while I was building my second enemy with a different sprite sheet, but the same names for the various body parts. I was also getting a ton of NullReferenceExceptions too (still am in fact, so it may be something unrelated). Another symptom was that all my bones and controls' sprite renderers were toggled off.

    The animation in Mecanim was still there; I could see the controls animating, but they'd lost their connection to the bones and to the sprites.

    I typed "4" back in the IK_handle size parameter and all the IK controls instantly returned, correctly associating with the correct IK controls. I didn't have to manually reconnect them.

    Other things I did which may have caused the issue (let me know if any of them are not recommended):

    • I renamed Global_CTRL to the name of the enemy type and made it a prefab.
    • I've got sprites within Global_CTRL set to "None" so that I can sprite swap them in Mecanim.
    • I've got a mesh that I need to temporarily disappear, so I'm toggling it's sprite renderer in Mecanim.
    • My naming convention for my enemy's body parts are:
    "s_torso", "s_head_walk" etc... for the sprites and "b_spine_base", "b_foot_L" ... for the bones.
    I'm using these names in another puppet, with different sprites. Is this a problem? Must every bone and sprite name be unique?

    It was a simple thing to fix, but I'd like to know what I did that caused it to zero it's IK_handles size variable. I've got 5 animation states for each of my enemies, and each animation state has taken hours to build. It's scary when it all just disappears on you.

    I'm still getting:

    NullReferenceException: Object reference not set to an instance of an object Puppet2D_GlobalControl.TraverseHierarchy (UnityEngine.Transform root) (at Assets/Puppet2D/Scripts/Puppet2D_GlobalControl.cs:176)

    But I believe that's a bug and not critical?
     
  11. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Thanks! Please do post your progress, I'd love to see it :)
    I'm looking to try to get it hopefully this month or next depending on how things go. You'll just need to update when it comes, and it should work fine with all your previous stuff. (I presume you mean v1.10, v1.1 is pretty old now!)
    thats fine
    That could be a problem - there are a few bugs which I've sorted out in v2.0 where I didn't check if the sprite was null, so it would error.
    its only an issue if there two bones with the same name within the same character.
    I wouldn't leave it - which version of puppet2d are you using? I've checked v1.10 and that line error looks like its pointing somewhere else.
    If you haven't already done so, update to v1.10 and see if you're still getting the error. If you are please send me error you get in the console so I can track down what broke
     
  12. SecretItemGames

    SecretItemGames

    Joined:
    Apr 13, 2012
    Posts:
    32
    That fixed my problem a while ago. However I got another one because of it. Unitys 2D physic don´t work correctly by rotation 2D colliders on the x and y achsis.

    -Quote from Unity

    So Puppet2D messes up the physics behaviour of the attached 2D collider which leaves the in the screenshot shown collision problem on hills. Any way of fixing this?
    flip.jpg
     
  13. JDuaneJ

    JDuaneJ

    Joined:
    Jul 26, 2014
    Posts:
    29
    Nothing different. It's like it loses its bind to the arm IK halfway through the animation. Really frustrating! Can't figure it out. lol
     
  14. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    Just a heads-up to say that in the forthcoming 4.5.5p1 release, rotating 2D colliders on the X/Y axis is fully supported i.e. any arbitrary rotation at any point in a transform hierarchy.
     
    PolymorphiK Games likes this.
  15. Tor_Sprouted

    Tor_Sprouted

    Joined:
    Oct 7, 2014
    Posts:
    13
    Thanks for the speedy response. Really looking forward to 2.0. Have already watched the tutorial. :)
    You were right, I was on v1.10 already :)

    I get this error when changing animations clips in mecanim. From say a walk cycle to an attack cycle. Each cycle has different enemy heads that I am swapping out in mecanim. I'm not swapping out meshes, just "regular" 2D sprites, but I am switching off the renderer of the meshes when I want to show another regular sprite in it's place.

    I also have multiple sprites nested to bones so that they follow the position and orientation of the character.

    This is the error:
    NullReferenceException: Object reference not set to an instance of an object
    Puppet2D_GlobalControl.TraverseHierarchy (UnityEngine.Transform root) (at Assets/Puppet2D/Scripts/Puppet2D_GlobalControl.cs:176)
    Puppet2D_GlobalControl.TraverseHierarchy (UnityEngine.Transform root) (at Assets/Puppet2D/Scripts/Puppet2D_GlobalControl.cs:193)
    Puppet2D_GlobalControl.TraverseHierarchy (UnityEngine.Transform root) (at Assets/Puppet2D/Scripts/Puppet2D_GlobalControl.cs:193)
    Puppet2D_GlobalControl.TraverseHierarchy (UnityEngine.Transform root) (at Assets/Puppet2D/Scripts/Puppet2D_GlobalControl.cs:193)
    Puppet2D_GlobalControl.TraverseHierarchy (UnityEngine.Transform root) (at Assets/Puppet2D/Scripts/Puppet2D_GlobalControl.cs:193)
    Puppet2D_GlobalControl.OnEnable () (at Assets/Puppet2D/Scripts/Puppet2D_GlobalControl.cs:39)
    UnityEditor.PopupCallbackInfo:SetEnumValueDelegate(Object, String[], Int32)

    This is my hierarchy of one of my characters:
    s_ is a sprite, b_ is a bone, ps_ is a particle system.
    Screen Shot 2014-10-08 at 1.11.55 PM.png

    Thanks again for your time. The character in question:
    Screen Shot 2014-10-08 at 1.18.57 PM.png
     
  16. SecretItemGames

    SecretItemGames

    Joined:
    Apr 13, 2012
    Posts:
    32
    Does that also include the next 4.6 beta build? I am currently using 4.6.0b20. Or do I have to downgrade somehow to 4.5.5p1?
     
  17. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Just to let people know I'll be away until this sunday, in the meantime take a look at the Paint Skin Weights tool I'm adding to the v2.0 release -
     
    PolymorphiK Games likes this.
  18. PolymorphiK Games

    PolymorphiK Games

    Joined:
    Oct 5, 2014
    Posts:
    51
    Hey Jamie,

    I'd just like to take the time and say, bravo dude! I have been emailing you and you respond really quick with the issues I had with the flipping, skinning etc. I have to say, this is the best Plug-In I have bought for Unity since NGUI 9999999999/10 stars, its not perfect (which is why I took off one star ;) ) but as you edit and update the plug-in, its only going to get better.

    I have added some thumbnails as to what it is you can accomplish with Puppet2D, this is a character I created for an iOS game we will be releasing and without Puppet2D it would not have been this easy. Hands down Jamie awesome F***ing job!

    - Kevin Pacheco
     

    Attached Files:

  19. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    The 4.5 patch releases are ahead of 4.6 but AFAIK 4.5 gets periodically merged into the internal 4.6 branch. As to the timing of this, I'm not exactly sure but I can ask.
     
  20. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    So I just asked the UI team. 4.5 Patch releases are not merged into 4.6, only the final release so the last one was 4.5.5. The fix I mention above went into 4.5.5p1 so you'll see it in 4.6 sometime after 4.5.6 lands.
     
    SecretItemGames likes this.
  21. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    Hi Jamie,

    v2 looks like a very smart direction for skeletal animation.
    I'd really like to use your asset in my workflow,

    just wondering if this will work with my setup,

    I use the cut-out style character method but with rageSplines (live mesh using Mesh Renderers) instead of sprites,
    right now i've been using mega-fiers to deform the rageSpline meshes
    and it works but its not very practical for my use case, especially comparing it to your puppet2D workflow

    also, would I be able to switch out mesh instances and call something to refresh the deform onto the new instance

    Cheers,
    nick
     
  22. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    I'm thinkings its at a point where I'll need you to send me a package to look into the issue. (My emails puppet2D@gmail.com)
     
  23. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Excellent! Thanks for letting us know.
     
  24. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Would you like to try v2.0, and see if it fixes you're bug?
     
  25. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Nice work! Please let us know when its released - love to see some of it moving :)
     
    PolymorphiK Games likes this.
  26. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    At the moment the skinning stage is only at editor time, so you need to preskin the meshes to the bones and switch them at runtime.

    The FFD feature in v2.0 would make runtime skinning much more doable, so I will certainly include that feature on my future feature list.
     
  27. PolymorphiK Games

    PolymorphiK Games

    Joined:
    Oct 5, 2014
    Posts:
    51
    Of course man, gotta showcase your awesome plug-in. I saw the demo for FFD, that looks really awesome could make use for some cool looking animations.

    Again, awesome job!

    - Kevin Pacheco
     
  28. Headworker

    Headworker

    Joined:
    Sep 6, 2012
    Posts:
    28
    Hey Jamieniman,

    It might be just me, using not the right tool for the job, but is there a workflow that can make puppet2d work with absolute top-down characters? Ive been trying to get this to work for quite some time now. I tried animating bones in the x/z plane for instance, with the attached sprites in x/y, or to use stretch/squish and scale.

    As mentioned, it just might not be the right tool for topdown-animation, but perhaps you could show me a way :)

    The general problem seem to be, that parts of the arms, for instance get "smaller" from top down view when the are directed to the ground or the in-world-top-direction.

    Is there any way I can do this with puppet2D?

    For other readers: Puppet2D is an awesome tool for 2D-animations from the side, ive achieved a lot with it in short time, I am just asking for a special use case, which might not be the intended use of this awesome tool!
     
  29. funshark

    funshark

    Joined:
    Mar 24, 2009
    Posts:
    225
    @Headworker : is there a real benefit to be in the x/z plane for your game?
     
  30. SecretItemGames

    SecretItemGames

    Joined:
    Apr 13, 2012
    Posts:
    32
    Short notice Jamieniman if you simple replace transform.rotation.eulerAngles.z with -transform.rotation.eulerAngles.z on line 129 and 136 in Puppet2D_GlobalControl if fixes the from me mentioned rotation bug with the current version of Unity(4.5.5.p1).
     
  31. Headworker

    Headworker

    Joined:
    Sep 6, 2012
    Posts:
    28
    Hey funshark! Thanks for your interest!

    Its not about the x/z plane, its about the viewpoint. I am talking about absolute top-down here, no matter on which plane (x/y, which I do actually or x/z). The are tons of reasons for this, and I will tell you (maybe with pm) if you are interested, to not derail this thread.
     
  32. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Here's how I would do it - Create the setup and animate in the usual 2D view and then rotate the global_CTRL to face up in the Y or whatever view you need it to work in. Let me know if that doesn't work for you :)
     
  33. ekeldevious

    ekeldevious

    Joined:
    Oct 22, 2014
    Posts:
    2
    hey got a quick question, for some reason when I try to flip my global rigging It flips around the orign point(zero,zero)
    so when I check the flip box, my character mirrors from the center of the global y axis instead of just flipping from its local center, do you have any idea what I did wrong?
     
  34. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    When you build your character you should try to put it in a position where the zero zero would be the ideal pivot point.

    To fix it heres what you should do:

    1. Unparent everything from the global_CTRL
    2. move the global_CTRL to where you want the pivot point to be
    3. Reparent everything back

    That should do it - let me know if that works

    J
     
  35. ekeldevious

    ekeldevious

    Joined:
    Oct 22, 2014
    Posts:
    2
    thanks it worked!
     
  36. jamez

    jamez

    Joined:
    Jun 17, 2014
    Posts:
    14
    I'm using beta v2.0.49. I found one small problem with FFD. When playing the game the FFD animation is one frame ahead of the skeletal animation. This does not happen when editing the animation, only when playing the game.

    You can see the problem by opening up the crocScene demo, and running the game frame-by-frame. First frame, nothing at all animates. Second frame, the nose animates downward (FFD animation) and the control points animate - but the bones and sprites don't animate yet! Third frame, the bones and sprites animate, catching up to where the control points were in the last frame. So the end result is that the FFD animation is one frame ahead of the rest of the animation.

    Ordinarily this might not be too noticeable, but we had a case where it was was a problem:
    We have an animation of character wearing a skirt. The skirt is animated with FFD. The legs underneath are animated with bones. We animated in the editor and it looked good. But when running the game, the skirt was one frame ahead of the legs, causing the legs to show through on the sides during fast moving animation.

    There are probably many other cases where this would be annoying. (Any animation requiring precision alignment of different parts)

    One quick hack that fixes it is changing "Update Mode" in the Animator to "Animate Physics". I'm not totally sure why this fixes it, what the side effects could be, or if there is a performance penalty to doing this.
     
  37. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Could you try this - open up the Puppet2D_GlobalControl script and change the Update function to LateUpdate, and see if that fixes it?
     
  38. jamez

    jamez

    Joined:
    Jun 17, 2014
    Posts:
    14
    Yes that fixes it.

    I see, I think I understand this better now. So Puppet2d's Update is getting called before Unity animates the control points?
     
  39. mccann

    mccann

    Joined:
    Sep 24, 2013
    Posts:
    30
    @JDuaneJ - look at some of my previous posts -- I think I had a similar sounding problem. If you animated the 'wrong things' (control groups, bone, etc), it can cause problems with the animation.
     
  40. EBTzelly

    EBTzelly

    Joined:
    Apr 2, 2014
    Posts:
    2
    I seem to be having an issue creating IK Controls. I'm parenting the bones together in the same fashion as the video, but for some reason, when I parent my "hip" bone to the knees and feet of my character, only one foot can have an IK control on it. When I try to place the second, I get a warning that "hip" already has an IK control on it. It didn't seem to be an issue when viewing the tutorial. Any help?
     
  41. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Ok, so theres two things to note to answer your question:
    - There is a difference between the current version of Puppet2D and the tutorial in that there was a bug in the tutorial version where you only visually see the first child bone connection. This is why you don't see the connection to the leg bones in the demo character - this is a visual glitch which has been fixed in the latest version. You now see all the connections to all the child bones.
    - Ik controls require 3 bones to work - so for a leg you need a thigh,knee and foot. If you look carefully thats what I have for both legs in the tutorial. What I'm guessing is you are missing the thigh bones out and drawing the knee bones straight on the hip. This makes the hip act as the thigh bone on the first IK and so it wont let u create another IK as it wont allow 2 IKs on the same bones,

    This is your hierachy:
    hip - kneeL - footL
    hip - kneeR - footR

    This is how it should be:
    hip - thighL - kneeL - footL
    hip - thighR - kneeR - footR
     
  42. EBTzelly

    EBTzelly

    Joined:
    Apr 2, 2014
    Posts:
    2
    I just got the IK working, but now I'm having issues with the rigging. I have the bones setup and seem to be parented to the spine/hip correctly. However, when I start to parent objects to bones, things get ugly. There is no deformation in the sprites as seen in the video, and the sprites themselves aren't connected, so they separate, which again doesn't seem to be an issue for you.
     

    Attached Files:

  43. TheWarper

    TheWarper

    Joined:
    Nov 3, 2013
    Posts:
    112
    Hey Jamie, just letting you know that the BakeAnimation.cs file is having some issues with Unity 5. Fortunately, I don't bake animations, so I was able to remove the file and comment out an if statement in the Editor.cs file that called BakeAnimation.cs.
     
  44. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Puppet2D v2.0 is all fixed up for Unity 5.
    Anyone trying to get v1.10 to work should do like you and comment out the BakeAnimtion.cs script as well as using Unitys automatic API updater.
     
  45. JKot-

    JKot-

    Joined:
    Mar 1, 2013
    Posts:
    3
    Hi. I'm trying to make 2D physic ragdoll on character rigged by puppet2d. But I have some troubles. 2D physic works wrong and the reason is in rotating on Y axis.

    When i create bones they are alredy rotated 180 degrees on Y axis. It's weird, but not critical. Troubles come when i add IK control to bone. After that bones hierarchy has this view:

    Root (Rotation (0, -180, Something))
    Child_1 (Rotation (0, -360, Something))
    Child_2 (Rotation (0, -540, Something))

    I experimented a lot, i tryed to remove Y Axis rotation on IK controlled bones, but i couldn't.
     
  46. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    I don't believe you'll be able to ragdoll the bones if you also have an IK control on it. The issue is you'll have two things trying to drive the bone rotations - IK and physics. Either have a special ragdoll rig without IK controls, or perhaps you could try putting the physics on the IK control itself (only you'll need to work out how to keep it from moving too far from the body)
     
  47. JKot-

    JKot-

    Joined:
    Mar 1, 2013
    Posts:
    3
    Of course i disable puppet2D global control before enable ragdoll. I think it'll solve problem with two controls. Also i try to change bones parent transform to root, to remove issue wtih rigidbody in another rigidbody, but anyway all this does not apply to the basic problem. The main problem is bones rotations conflict with 2d physic. Let's see the picture.



    Here are two objects linked by hinge joint, also the top object is nailed to the world by hinge joint. Puppet2D global control is disabled in this case. And the main problem is bone and box collider on it are moving the opposite ways, and it doesn't happen if the bone doesn't have Y Axis rotation.
     
    Last edited: Oct 29, 2014
  48. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Could you check what Unity version you are using - there should be a Unity fix for this in v4.5.5
     
  49. JKot-

    JKot-

    Joined:
    Mar 1, 2013
    Posts:
    3
    Upgrade my unity from 4.5.5 to 4.5.5 patch 2 really resolved my problem with colliders rotation, but a new trouble is coming. Now joint anchor is rotating like collider before update. I know it's not puppet2D problem. I'll write unity bug report about this. Thank you for helping.
     
  50. Tor_Sprouted

    Tor_Sprouted

    Joined:
    Oct 7, 2014
    Posts:
    13
    Hey Jamie. Yep, that would be great. What's the process? You need my email? torgnyhylen@gmail.com
    thanks