Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Puppet2D - An advanced skeletal animation tool

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

  1. rockybomb

    rockybomb

    Joined:
    Jul 5, 2013
    Posts:
    1
    Hey thanks for a super great plugin. just digging into v2 and made a body using the ffd-method. i want to switch the face (currently on a separate sprite map). is that possible?

    and while at it, is there a way of adding control-points later? like if you need a chest-control or adding a tail. remake the bones?
     
    Last edited: Dec 12, 2014
  2. shopguy

    shopguy

    Joined:
    Jan 12, 2013
    Posts:
    282
    Just purchased and trying it out. Ran in to one possible issue with my current project... I'm animating insects, and the legs have 4 segments each, instead of 2 like a human arm. In other words, I have 5 bone objects for each leg, instead of 3. With the current version only supporting 3 bones for IK, does this mean I will not be able to use the IK system, and do you have any recomendations for this type of rig?
     
  3. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    You can embed other meshes into the same FFD controls - Convert your other character's face's to meshes and select the controls and the mesh, set the num skin bones to 4 (FFD) and click Bind Smooth Skin. That will make the FFD controls affect your other faces. You can then switch them in and out by turning their skinnedMeshRenderers on and off.

    You will need to remake the all the controls currently. The first mesh you make with the controls is important for the FFD controls to know how to embed future meshes into the controls
     
  4. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    you can use this advanced technique:



    or you can it do more simply by having the IK on the bottom bone of the legs and have a parent control on the top bone so you can rotate the animal "knee"

    Hope that helps
     
  5. spacemarine

    spacemarine

    Joined:
    Mar 28, 2013
    Posts:
    14
    Hi, thanks for great animation plug-in!

    By the way, I wanna do this with puppet2D :)

    Applying 3D motion to puppet 2D skeletal.

     
  6. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    The first thing I'd try is making a small script on each bone to receive the positional and rotation info from the 3d rig without the z part.
    Let us know how you get on :)
     
  7. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    first try got trouble when set ik it's have kill skeleton
    paint weight look very hard workflow at this time
     
  8. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Could you give me some more information regarding your issues? A video showing the issue, or detailed steps to reproduce would be great.
     
  9. spacemarine

    spacemarine

    Joined:
    Mar 28, 2013
    Posts:
    14
    Thanks for interest :)

    When some fbx animation imported to unity, we got something like this
    2014-1223-3DFBXMotion2Puppet2D.png

    How can I remap(retarget) only import animation element from source fbx animation?
    In general fbx animation have not only pure rotation and transition, especially for quarternion animation.
    and they are not x-rotation, y-rotation, z-rotation, but Twist In-Out, Down-Up, Front-Back expression..

    I think we need to drag&drop animation rotation element(x-rot, y-rot... or Down-Up, Front-Back..) and
    or translate quarternion rotation element(q.x, q.y, q.z, q.w) to general 3-axis rotation.. and transtion
    , for example (T.x, T.y, T.z) like above image..

    I'm not progammer so I can't solve this situation.. I hope Puppet2D can care this functionality :):)
     
  10. spacemarine

    spacemarine

    Joined:
    Mar 28, 2013
    Posts:
    14
    I tested this using Puppet2D's FFD functions :)
    after looking Live2D animation tool
    2014-1228-Puppet2D head rotation test.gif
     
    Last edited: Dec 29, 2014
    jamieniman likes this.
  11. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
  12. spacemarine

    spacemarine

    Joined:
    Mar 28, 2013
    Posts:
    14
    Yes, with pleasure ^^.

    1. Make 3x3 FFD controls like following(from outside to inside), do not finish FFD yet.

    puppet2D_ffd_rotation_01.png

    2. Add following FFD zone for different speed moving.(Refer Puppet2D'S Croc. making tuto for eye area)
    With 2 shells of certain zone, we can control inside and outside FFD controls.
    puppet2D_ffd_rotation_02.png puppet2D_ffd_rotation_03.png

    3. Start FFD control animation like Puppet2D FFD tutorials.
    puppet2D_ffd_rotation_05.png

    4. Move front FFD controls for rotation-like looking.
    puppet2D_ffd_rotation_06.png

    5 images are max for 1 post..;; continues to next post. -0-
     
  13. spacemarine

    spacemarine

    Joined:
    Mar 28, 2013
    Posts:
    14
    6. Move next FFD controls to a little bit right.
    puppet2D_ffd_rotation_07.png

    7. Move next FFD controls to a little bit right again.
    puppet2D_ffd_rotation_08.png

    8. Simply moving left FFD controls are making wierd result. So cancel or don't do this.
    puppet2D_ffd_rotation_09.png

    9. Because head skull is always look like a sphere in rotation, left area need to be tweaked.
    Hairs on left moves faster than face surface because they are near to observer's eye.
    Anyway, move each following points to make hairs move faster than face surface.
    puppet2D_ffd_rotation_10.png

    10. Head skull always looks like a sphere. So tweak following points to look skull perpect sphere.
    puppet2D_ffd_rotation_11.png
     
  14. spacemarine

    spacemarine

    Joined:
    Mar 28, 2013
    Posts:
    14
    11. For more good result, move inner FFD controls. Human fore head and noses are more
    faster rotate.
    puppet2D_ffd_rotation_12.png

    12. Test animation. All done:)

    This is like Photoshop's liquify function I think..
    Of course, you may make 4x4 or 5x5 FFD cage if you want more precision control.

    * You can separate hair sprite from head(face) for no hair-specific zone, or for if some part
    of hair exits from head(face).
     
    Last edited: Dec 29, 2014
  15. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Thanks for this spacemarine - when I get a chance I'd like to make room for this on my website. Its a great example of what you can achieve using FFD controls - Great work!
     
  16. toxicwes

    toxicwes

    Joined:
    Apr 20, 2014
    Posts:
    1
    Has anyone successfully used puppet2d with any of the cutscene editors, like uSequencer, Animator, Flux, etc.?
     
  17. Rodlaiz

    Rodlaiz

    Joined:
    Jul 30, 2013
    Posts:
    38
    Hello! I wanted to know if someone found a solution for this issue mentioned before:

    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)

    I'm having the same problem and I can't seem to find the solution, I've tried installing V2 but that didn't quite made the trick, so, if anyone solved this problem a tip will be greatly appreciated ;) Thank you!
     
  18. Rodlaiz

    Rodlaiz

    Joined:
    Jul 30, 2013
    Posts:
    38
    To be more specific, this is the line of error I'm 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:103)
    Puppet2D_GlobalControl.TraverseHierarchy (UnityEngine.Transform root) (at Assets/Puppet2D/Scripts/Puppet2D_GlobalControl.cs:120)
    Puppet2D_GlobalControl.TraverseHierarchy (UnityEngine.Transform root) (at Assets/Puppet2D/Scripts/Puppet2D_GlobalControl.cs:120)
    Puppet2D_GlobalControl.OnEnable () (at Assets/Puppet2D/Scripts/Puppet2D_GlobalControl.cs:29)
     
  19. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    I'm surprised its not working for you in v2.0 - as that line points to a bug in the previous version (now fixed) where it errors when you had a missing sprite. (You couldn't have a null sprite in any of your sprite renderers).

    Perhaps your having trouble updating your package to v2.0? Let me know if you need help updating your package to v2.0.
     
  20. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    I haven't specifcally tried - but as Puppet2d essentially use Unity's in built animation system I'd be surprised if there are any issues. Is there anything specific feature you anticipate a conflict?
     
  21. Rodlaiz

    Rodlaiz

    Joined:
    Jul 30, 2013
    Posts:
    38
    Hello Jamie, thanks for the quick reply as always. I've just imported the whole package but that kind of trashed all the animations, maybe you can tell me what script should I replace specifically and see if only with that I can fix my issue.

    EDIT: Since the V2 doesn't work well for me in this OLD project I went back to the V1.
    EDIT2: When I install V2 the option Puppet2D dissapears from the Menu Window
     
    Last edited: Jan 5, 2015
  22. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    That sounds like you're getting an error when you update to v2 - can you check your console for any errors?

    I'd like to help you get v2 working, otherwise if you're in a rush the quick fix using v1 would be to go through all your sprite gameobjects and make sure they are not missing sprites in the spriteRenderer.
     
  23. Rodlaiz

    Rodlaiz

    Joined:
    Jul 30, 2013
    Posts:
    38
    Yes, I'm getting problems trying to update to the V2, I'll probably start from scratch since I don't have that many animations. Thanks for your help :)

    EDIT: Finally! Found the missing sprite!! Thanks for the tip
     
    Last edited: Jan 5, 2015
  24. zee_ola05

    zee_ola05

    Joined:
    Feb 2, 2014
    Posts:
    166
    Does this support retargeting animation?
     
  25. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    As Retargeting in Mechanim requires an avatar, you can't currently use this mechanim feature for Puppet2D.

    On the other-hand, there is a way you can use puppet2d that will make it easy to retarget the animations to a different proportioned characters.

    Essentially you need to move all the control groups to the new positions and scale the bones to the new proportions, and bind to this new skeleton. This can work to retain most of the animation on a new proportioned character ( scaling animations might be trickier).
     
  26. kdshay

    kdshay

    Joined:
    Oct 1, 2013
    Posts:
    4
    Hey there! Thanks for a great plugin.

    I am having an issue with Convert Sprite to Mesh. When I try to convert the tail of the character to a mesh, the tail disappears and I get a very small piece of geometry. See images.

    Here's what I have tried so far:
    1. Added a polygon collider component.
    2. Adjusted the scale of the character.
    3. Increased the number on Type of Mesh.

    Additionally, I decreased the scale of my character before starting my rig. I decided to check to see if I was having the same issue with the other sprites on the character. Convert Sprite to Mesh does work for the other sprites but it creates a mesh that is the original size of the character. I'm not sure if there's a way around that, perhaps I should just scale down the character in photoshop instead but thought I'd mention it.

    Apologies if this question has already been asked, I did some digging on this thread and couldn't find anything. Perhaps this is simply a user error : /

    Thanks for your time!

    -Katie character_spline_test.jpg TailGeo_Issue.jpg
     
  27. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    My first suggestion is to make sure you totally clean up around the mesh - its very often possible that you have a tiny bit of colour there which is almost transparent but not completely. That can mess up its ability to find the outside of your mesh. Rub out anything outside with a hard eraser in photoshop to make sure its completely clean.

    Love the look of your character - I'd love to see your animations when your finished :)
     
  28. kdshay

    kdshay

    Joined:
    Oct 1, 2013
    Posts:
    4
    Ah ha! That fixed it. Thanks very much for your help! And thanks for the compliment. :)

    Cheers.
    -Katie
     
  29. jameskyle

    jameskyle

    Joined:
    May 7, 2013
    Posts:
    37
    This is probably a simple problem but I'm having trouble finding a way around it. The "bones visibility" checkbox doesn't seem to hide the bone structure. The "controls visibility" checkbox works fine. If I change the sprite renderer on the bones to inactive I can still see them, both in editor and in the build. What have I done wrong?
     
  30. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    You need to make sure you parent all the bones under the global_control for the bone visibility toggle to work :)
     
  31. jameskyle

    jameskyle

    Joined:
    May 7, 2013
    Posts:
    37
    Ah, righto. The way I have it currently is separate bones and controls hierarchies in a container object, which is why it's not working then.
     
  32. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Other reasons to have it under the global_control is that it will scale and flip properly (flip using global_control checkbox)
     
  33. Nekochan

    Nekochan

    Joined:
    Jan 16, 2015
    Posts:
    1
    Hello
    I have a problem with the meshes...
    This is the error:
    UnityException: Creating asset at path failed.
    Puppet2D_CreatePolygonFromSprite.MakeFromVerts (Boolean ReverseNormals, UnityEngine.Vector3[] vertsToCopy, System.Collections.Generic.List`1 pathSplitIds, UnityEngine.GameObject FFDGameObject) (at Assets/Puppet2D/Scripts/Editor/Puppet2D_CreatePolygonFromSprite.cs:498)
    Puppet2D_FFD.FFDFinishCreation () (at Assets/Puppet2D/Scripts/Editor/Puppet2D_FFD.cs:176)
    Puppet2D_Editor.OnGUI () (at Assets/Puppet2D/Scripts/Editor/Puppet2D_Editor.cs:486)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

    Somebody can help me??
    Thank you
     
  34. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    hello,

    I picked up Puppet2D yesterday, and on my first attempt to add the asset package, I receive about a half-dozen warnings all similar to:

    "
    Assets/Puppet2D/Scripts/Editor/Puppet2D_Editor.cs(958,33): warning CS0618: `UnityEditor.TextureImporter.spritePixelsToUnits' is obsolete: `Use spritePixelsPerUnit property instead.'
    "

    at lines:
    908,33
    918,33
    924,33
    930,33
    936,25
    942,25
    948,25
    958,33

    Unity version 4.6.1f1
    Puppet 2D version 2.0 (? not sure how to tell this lol)

    Is it safe to say I can edit these scripts and replace the obsolete methods with the Unity recommended one?


    [EDIT]
    yes, it is safe to say I can .. lol, sorry, just edited and opened your examples. things work fine :D
     
    Last edited: Jan 16, 2015
  35. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    I liked how simple Veli made setting angle limits (constraints?) to the joints in his Simple CCD component from Unite:



    Is it possible to implement something similar in Puppet2D?.. if so, i'm not finding a way to do so.

    Would be nice to be able to select a joint, and have a gizmo visible... his solution looks quite simple, perhaps this could be an added feature?

    He has the code here: http://goo.gl/6oSzDx
     
    TokyoDan likes this.
  36. zee_ola05

    zee_ola05

    Joined:
    Feb 2, 2014
    Posts:
    166
  37. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    zee_ola05 tswalk It something I plan on exploring - I need to to test the performance - perhaps I might add it as an alternate IK choice
     
  38. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    I'll add that to my next release
     
    tswalk likes this.
  39. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    For some reason its unable to create the asset on your disk - do u have any restricted permissions? Could you give me steps to reproduce?
     
  40. JimmyFelon

    JimmyFelon

    Joined:
    Jan 18, 2015
    Posts:
    3
    Sorry if I'm posting a repeat question, there is just way too much to sort through while I'm at work. I asked this on YouTube but it was removed, then I found the link here while searching the comments for any kind of response.

    Our animator can't get the tab view on the left side of your videos to appear. We're very new to Puppet2D, having purchased it only a week ago. Your videos already have it present and set up. He viewed tutorials by the few others and theirs is the same.

    Any direction as to how to set this up? He says he really needs it. He's working from a Windows 8 PC.
     
  41. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    I replied to the video - not sure why it got removed.
    You can bring up the UI by going to the menu Window>Puppet2D
    If that doesn't work It sounds like you may have had a conflict with another asset. Could you try it in a clan project first, and then tell me if there was any errors in the console in your project when u imported it?
     
  42. JimmyFelon

    JimmyFelon

    Joined:
    Jan 18, 2015
    Posts:
    3
    I'll have him try that and I'll get back to you as soon as he responds. Thanks for the help.

    Yeah, I found it weird the comment disappeared too. Maybe it only vanished on mobile. I'll check for it from my computer after work today.
     
  43. JimmyFelon

    JimmyFelon

    Joined:
    Jan 18, 2015
    Posts:
    3
    That was what he needed! Thanks a ton! You just saved our project!
     
  44. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    842
    Can't believe the amount of work he is put into this, I passed back in May, and bought Spine, Spine is great and all, but I have the regular version, not Pro which is 200 bucks extra I paid 70. Now Puppet 2D, looks like it does what Spine can and more with 45 bucks.. Still less than Spine.. Truly amazing. Ya I can use Spine outside of Unity, but that's all I will use Spine for now.

    The new features just sold me on Puppet. Buying this today, great work.. Money will be well spent. Keep up the good work and I bet you will see more Spine users making the switch.

    I wish I bought this sooner, another reason I did not seem to work well with 2D tool kit, but again, I don't care now. I don't use 2d tool kit for character stuff anymore. I use it for batching and such mainly and atlas.

    Great work!
     
  45. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Thanks! I've really been enjoying developing it. Any questions, don't hesitate to get in touch :)
     
  46. ketchup_scaredcrow

    ketchup_scaredcrow

    Joined:
    Mar 26, 2014
    Posts:
    43
    Sorry if this has already been answered but I'm wondering how you are flipping these sprites because I tried negative scaling and rotating and they both give me crazy bone-flippin' results. Also, when I go and do something else and come back to my skeleton rig the IK controls no longer work. Could you possibly make another longer, more in depth tutorial?
     
  47. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    To flip the character, makes sure all bones controls and meshes are parented to the global_CTRL and use the "flip" checkbox on the global_CTRL.
    In code you can use GetComponent<Puppet2D_GlobalControl>().flip = true;
    and GetComponent<Puppet2D_GlobalControl>().flip = false;
     
  48. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    This system is *very* cool! I've only scratched the surface of what it can do! I'm pretty new to 2D but this was easy to use. Thank you!

    I had one "issue" that forced me back to 3D on my current project, I needed to use "Dynamic Bone" which didn't "see" my Puppet2D bones... I know it's outside he scope of what you offer, but it's an effect I come back to often for tails, streamers, etc.... Is there maybe an equivalent I could use on a figure made with Puppet2D? or alternatively, is that something you would consider? I can imagine all sorts of "jelly"-like motion, dynamic squash-stretch, trees bending...

    (ahh, reading above I see you suggest writing a script to parent the Puppet2D rig to a 3D rig.... I'm a Playmaker kinda gal, LOL my scripting ability is nearly zilch... haha)

    I tried a 2D Spring joint, but the sprite disappears after a few frames.... Maybe I just need more practice until I know what I am doing...?
     
    Last edited: Jan 22, 2015
  49. Tor_Sprouted

    Tor_Sprouted

    Joined:
    Oct 7, 2014
    Posts:
    13
    I'm busy optimising my project, looking for places to reduce draw calls, overdraw, help with batching etc, when I noticed something a little troubling. All the bones in my character are at wildly different scales, sometimes making the nested sprite a scale different from 1 too.

    For example, I've got a typical humanoid character. He's got a b_spine_base (tail bone), b_spine_mid (ribcage), b_spine_top (collar bone), b_shoulder_L, etc...

    b_spine_base is 0.2370241 scale on x, y, z
    b_spine_mid is 1.743313 scale
    b_spine_top is 0.3019115
    b_spine_shoulder_L is 6.818525
    s_upperArm_L (sprite) is 1.175606

    the bones are all wildly different scales, their nested sprites are scales that when multiplied to their parent bones scales look like they equal 1. There is no visual distortion... i.e., everything looks "right", but I am concerned that all these various scales are screwing up batching. I've tried to manually reset everything to 1, but due to inheritance this is very troublesome, distorts the skeleton and takes an age.

    If anyone can shed any light on this, that would be great? Why does Puppet2d do this? Does it break batching? Is this something I may have done incorrectly?
     
  50. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    It doesn't break batching on the character sprites themselves (bones would be hidden in the game).
    Skinned meshes only combine to 1 draw call per character, it is however possible to use a skinnedMeshRenderer combining script to combine multiple characters together into 1 draw call.

    For more info please see here: http://www.puppet2d.com/#!performance-tips/c22l9
     
    Tor_Sprouted likes this.