Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Puppet2D - An advanced skeletal animation tool

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

  1. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Yes, bones are there to make joint selection easier and to show the hierarchy. I take you're point my wording and naming could have been clearer.

    By the way - I should take down that video now, as you can now change the IK control to use as many joints as you'd like, so you don't need to do this method for animal legs
     
  2. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Yeah, naming of the joints (or bones) should follow a convention, either use all bone names and no joint names, or visa versa. But although some joints are also bones like shoulder, hip and knee, an arm or a leg is not a joint. Seems to me it'd be better to go with joints as you are directly plotting the joints, and Puppet2D is filling in the bones in between.

    I followed that tutorial and it worked as long as it was a new project. As soon as I tried it in a project that already had controls it would not work. As soon as moved one of the 1K controls a bone behind the 2nd bone would appear. Exactly like the 2nd bone but the rotation about it's joint would be offset from it's 'sister' bone. I'll make a video tomorrow to show you.

    If you take that video down please make a new one using the new feature. By the way. That way of setting up that animal leg is really convoluted. It'd be nice to have a diagram of the logic of why some bones are deleted, some are parented with others, and why some renderers are deleted. Understanding the logic would be the only way anyone could do that without following that video step by step.
     
    Last edited: Jan 14, 2016
  3. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    I just wrote a review on the Asset Store for Puppet 2d. Here is what I wrote:

    Puppet2D is instrumental to my current project. It is allowing me to do things that I couldn't do without it. But what is better is the personal support: I wanted to use Puppet2D with the meshes created by another asset that I was thinking about buying...Simply SVG. I told the Puppet2D developer about this and to make a long story short, the Puppet2D developer worked closely with the Simply SVG developer to make sure that Puppet2D and Simply SVG worked well together, and they made sure that the functionality that I needed was there as well. Great job!

    Puppet2D is a 5-star asset on its own. I gave it 4 in this review but would have given it 5 stars if the tutorials were a bit more up-to-date and easier to understand.

    Get Puppet2D. You will love it. And if you plan on using SVG assets in your game, get Puppet2D and Simply SVG because the two assets are well integrated.
     
  4. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Thanks so much for your review.
     
  5. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Now, all you need to do is change the IK handle to be multi-bone in the inspector and you can select however many bones you want the IK to work across. So use 4 for an animal leg, and 3 for a human leg.
     
  6. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    I see. Thanks. In that case should there be two 1K handles (one on last bone, and one on next to last bone) like in the video? If so what settings would the 1K handle on the next to the last bone have?
     
  7. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Why am I getting this error? It is because _SplineControlsArray has no value. But I'm not using a spline anywhere.

    Puppet2D_GlobalControl.LateUpdate () (at Assets/Puppet2D/Scripts/Puppet2D_GlobalControl.cs:243)Puppet2D_GlobalControl.Run () (at Assets/Puppet2D/Scripts/Puppet2D_GlobalControl.cs:273)NullReferenceException: Object reference not set to an instance of an object
     
  8. neopica_francis

    neopica_francis

    Joined:
    Nov 5, 2015
    Posts:
    4
    Hi everyone,

    I've got the following issue which I cannot resolve for the life of me:
    My sprites do not render on my android device whilst they render fine in the editor (as android platform). The GEO meshes render fine on my android device, so it's just the stuff rendered by the sprite renderer which is acting up (as opposed to the skinned mesh renderer).

    I've disabled mip maps generation of the associated texture sheet and the size is a power of two. I use multiple texture sheets for the model though, presuming that's not an issue.

    Could someone help me with this one? Thanks in advance!
     
  9. funshark

    funshark

    Joined:
    Mar 24, 2009
    Posts:
    225
    Difficult to help without much more details. Never had any issue on android with the sprite renderer.
    Normally, P2D doesn't do anything with the Unity sprites, it just moves/rotates/scales them.

    Try to test your sprites without P2D?
     
  10. neopica_francis

    neopica_francis

    Joined:
    Nov 5, 2015
    Posts:
    4
    After testing the animations I've discovered that Unity messes up the rotation for android (it's worth mentioning I'm also using asset bundles for texture variants). As soon as I remove all rotations from the animation the sprites show correctly, I assume Unity transforms the sprites out of the viewport.

    Thanks for the respond though!
     
  11. funshark

    funshark

    Joined:
    Mar 24, 2009
    Posts:
    225
    You mean flip ?
    Because I have zero issue with rotations. It would be a real problem since most of the movements inside a hierarchy are rotation based :)
     
  12. neopica_francis

    neopica_francis

    Joined:
    Nov 5, 2015
    Posts:
    4
    Basically the interpolation method of transform rotations has to be put on quaternion instead of euler. Mine were set on euler which bugs out in 5.3.1
    You can read more about it in this thread: http://forum.unity3d.com/threads/animating-rotation-not-working-on-android-build.375078/
     
  13. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Why do I keep getting this error at the end of FFD creation when I select Num Skin Bones 4(FFD) then I click Bind Smooth Skin, when I click either Detach or Do Not Detach?

    NullReferenceException: Object reference not set to an instance of an object
    Puppet2D_Editor.OnGUI () (at Assets/Puppet2D/Scripts/Editor/Puppet2D_Editor.cs:337)Puppet2D_Skinning.BindSmoothSkin () (at Assets/Puppet2D/Scripts/Editor/Puppet2D_Skinning.cs:350)

    And this happens in a new project with just one spite (PNG) and latest Puppet2D newly imported from the Asset Store.

    I'm getting tired.
     
    Last edited: Jan 19, 2016
  14. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    It looks like you've hidden/deleted the original mesh that was created with the FFD controls. Its essential you keep this around - as it allows puppet2d to know where each of the FFD controls need to influence.
     
  15. ask80me

    ask80me

    Joined:
    Sep 17, 2015
    Posts:
    43
    svg importer support?
     
  16. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Nope. I don't even touch the mesh. I tried it with a new project, newly imported Puppet2D, and just one Sprite. Na d it happens the minute I click either Detach or Do Not Detach?
     
  17. ecutruin

    ecutruin

    Joined:
    Aug 19, 2014
    Posts:
    39
    Hey,

    I'm looking into your tool as a possible solution for a game I want to create. How well do these animated characters function in 3D space? What I'm wanting to accomplish is something akin to Don't Starve or Ragnarok Online in style, where most everything is billboard sprites in a 3D space.

    As a follow up, how easy is it to have multiple rigs and hide/show them based on the direction the character is facing (flip works for left/right, but what about up/down). In general I'm trying to gauge what this tool would offer me since I'm not aiming at a traditional 2D game.
     
  18. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    here is a video I made demonstrating this error I always get: https://www.dropbox.com/s/862lswafx8jimt0/Puppet2d-error.mov?dl=0
     
  19. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    You can parent SVG importer sprites to the puppet2d bones. If you want to use the skinning feature however I would recommend Simply SVG as this will work Puppet2d Skinning.
     
  20. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    I see whats confusing you now. Up until now you've been embedding SVG meshes into P2d FFD controls.
    Now that you're using sprites you're trying to do the same thing.

    But ordinary FFD meshes are much simpler than that! Once you've created the FFD from a sprite the controls already move the mesh! Don't click "Bind Smooth Skin" - the FFD controls are already influencing the character.

    You can now actually skin the FFD controls to other bones (with "2 bone" not "4 FFD" as this is only for embedding as mentioned earlier)
     
  21. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Great! Thanks. That completely stopped me in my tracks for a day as I had almost given up.
     
  22. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    One question...Then if I don't use SVGs, in what case do I use "Bind Smooth Skin"?
     
  23. Fai2

    Fai2

    Joined:
    Sep 24, 2015
    Posts:
    1
    Hi! I've purchased Puppet2D and it's very powerful. It's great for rigging and animation. However I've been running into problem when porting onto mobile. Part of the sprites were missing when animation was on.
    In unity:
    Screen Shot 2016-02-04 at 10.44.16.png
    Screen Shot 2016-02-04 at 10.30.48.png

    On mobile:
    IMG_3541.PNG

    The head sprite was missing, no matter it was parented to a bone as a sprite, skin or FFD. Strangely the hand and body are skins and they work just fine... Can you please give me some direction? Thanks very much!!
     
  24. berdanka

    berdanka

    Joined:
    Sep 29, 2015
    Posts:
    24
    How to prevent edge intersections in the mesh?
    I use sprites, that are very sensitive to distortion.
    It does not matter what type of mesh (0-5) I use or how I paint weights - intersections continue to occur when I bend the bones.
    Are there any possibilities to improve the algorithm for mesh creating? Or tracking the intersections with a script maybe?
    Or add the ability to correct the generated mesh.
    Looked Anima2D video recently. Their mesh editing method seemed convenient.
    Regarding the algorithm, Creature uses a better mesh creation algorithm.


     
    Last edited: Feb 7, 2016
    Sorapol likes this.
  25. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    You can define the mesh precisely by either adding a polygonCollider2D and edit the points that way, or create the mesh using the FFD mesh tool (you can remove the FFD controls and skin it normally).

    By the way, I just tried it, and got this using defualt weights:

    upload_2016-2-8_13-17-25.png
     
  26. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Are you using 5.3? Perhaps its the Euler issue mentioned earlier in the forum. See here to fix it if it is:

    http://forum.unity3d.com/threads/unity-5-3-rotating-problem-on-animated-object-in-android.373065/
     
  27. egem2015

    egem2015

    Joined:
    Oct 27, 2015
    Posts:
    84
    Hi everybody

    i had a dilemma now i want to buy this asset but i have some doubts.

    i do not know so much 2d character animation tools. i have just heard them and i am investigating now them such as Spine,Spriter,Puppet2D .

    Puppet2D is much affordable now.But i do not know.

    i want to ask

    i have a character that had some body pieces. can i make a walk animation or run or malee attack with this character in Puppet2d and after can i export this animated character as spritesheets to use in my game?

    and did the problem in unity 5.3 solve?

    thanks in advance.
     
  28. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Yes, but you don't need to export it as a spritesheet - you can use it straight as is - which will will save on memory/file size and will allow you to make use of Mechanim animation blending.
    This is a Unity 5.3 Android bug that has a simple solution:

    Right click on rotation property in Animation window and in the drop down menu changing interpolation from Euler Angles to Euler Angles(Quaternion approximation).
     
  29. ask80me

    ask80me

    Joined:
    Sep 17, 2015
    Posts:
    43
    Hello
    SVG Importer support please :)
    Thanks
     
  30. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    is this easy to use in code? Can you enable and disable the IK chain and keep the rigged skeleton to apply ragdoll physics easily? (through code)
     
  31. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    There are issues with how the SVG sprites are made in that package I think.
    I would recommend Simply SVG though - we've worked together to make sure they are compatible https://www.assetstore.unity3d.com/en/#!/content/46496
     
  32. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Yes, you can disable all the controls by using
    Code (CSharp):
    1. GetComponent<Puppet2D_GlobalControl>().ControlsEnabled = false;
     
  33. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    hmm, thanks, I'm working on (i bought it onsale) a ragdoll who can interact with physics. I guess I call this on the top_level GLOBAL_CNTRL object and use this object for all game logic? or should I child this global_contrl under a master object itself and call this on its child global_control?

    like gameobject_duder>>>Global_Control

    or


    Code (csharp):
    1.  
    2. public class DuderObject : MonoBehavior
    3. {
    4. GameObject MyRagDollGlobalControl;
    5. Puppet2D_GlobalControl MyRagDollControls;
    6.  
    7. void Awake()
    8. {
    9. MyRagDollGlobalControl = //find child game object named GLOBAL_CONTRL;
    10. MyRagDollControls = MyRagDollGlobalControl.GetComponent<Puppet2D_GlobalControl>();
    11.  
    12. }
    13.  
    14.  
    15.  
    16. }
    17.  
    18.  
    is that how i can begin registering each entity on screen with its individual puppet2D skeletal controller?
     
  34. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    I actually would recommend having a parent GameObject for the global_CTRL - that way you can still animate the global control itself with all the movement scripts on the parent.
    You can still keep a reference to the global control script on its parent script for easy access
     
  35. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    thanks again I will experiment more with this
     
  36. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    This looks like just what I need for my shmup game. I will probably pick this up tonight and give it a try. Thanks for making this tool. The ability to do everything right within Unity is a huge selling point.
     
  37. SpittingLlama

    SpittingLlama

    Joined:
    Mar 10, 2015
    Posts:
    2
    Hello Jamieniman. First of all. Good job on Puppet2D. I'm linking it so far.

    So here is my problem.
    When I start a new project I import the Puppet2D package and I can open it by going to windows > Pupper2D
    But when I import the package in a existing project I can't seem to find the Puppert2D window on Windows.

    Is there a way to fix this. Or can I just make my Puppets in a seperate project and then import my character in my existing project?
     
  38. SpittingLlama

    SpittingLlama

    Joined:
    Mar 10, 2015
    Posts:
    2

    Derp fixed it.

    Had an error in a script... :D
     
  39. Steve-Macintyre

    Steve-Macintyre

    Joined:
    Jul 10, 2015
    Posts:
    8
    edit:Never mind, I'm an idiot. The pivot was set to center. Derp.



    Been having more issues recently, I'm using the latest version of Unity, 5.3.4f1 in Windows 7 Pro 64bit, and am getting script error messages saying some line endings are mac/unix and some windows which I think are causing many errors, I had sprites not turn to meshes properly and bones median points be way off than the actual element. (see pic)

    I've also included a file with the issue on my box account it's around 5 megs:
    https://app.box.com/s/s3exu2717vibg64hwj73dtuzayxr920f
     
    Last edited: Mar 18, 2016
  40. GreenHatJohn

    GreenHatJohn

    Joined:
    Nov 27, 2014
    Posts:
    8
    Hello there,
    Thank you for creating this tool; it's been pretty useful so far. I haven't been able to successfully convert any sprite to a mesh, which is a bit of a bummer so far and I'm wondering if anyone can shed some light on this problem. I've been getting the following error when attempting the procedure.

    Code (CSharp):
    1. Couldn't create asset file!
    2. UnityEditor.AssetDatabase:CreateAsset(Object, String)
    3. Puppet2D_CreatePolygonFromSprite:Run(Transform, Boolean, Int32) (at Assets/Plugins/Puppet2D/Scripts/Editor/Puppet2D_CreatePolygonFromSprite.cs:102)
    4. Puppet2D_Skinning:ConvertSpriteToMesh(Int32) (at Assets/Plugins/Puppet2D/Scripts/Editor/Puppet2D_Skinning.cs:46)
    5. Puppet2D_Editor:OnGUI() (at Assets/Plugins/Puppet2D/Scripts/Editor/Puppet2D_Editor.cs:319)
    6. UnityEditor.DockArea:OnGUI()
    With that console error, it also throws the next one right after:

    Code (CSharp):
    1. UnityException: Creating asset at path  failed.
    2. Puppet2D_CreatePolygonFromSprite.Run (UnityEngine.Transform transform, Boolean ReverseNormals, Int32 triangleIndex) (at Assets/Plugins/Puppet2D/Scripts/Editor/Puppet2D_CreatePolygonFromSprite.cs:102)
    3. Puppet2D_Skinning.ConvertSpriteToMesh (Int32 triIndex) (at Assets/Plugins/Puppet2D/Scripts/Editor/Puppet2D_Skinning.cs:46)
    4. Puppet2D_Editor.OnGUI () (at Assets/Plugins/Puppet2D/Scripts/Editor/Puppet2D_Editor.cs:319)
    5. 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/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    For the project we've been working on, we have the Puppet2D folder nested in the plugins folder. Am I selecting incorrect parameters in the skinning tab? I'm leaving everything as defaults, but I'm not sure what the "Type of Mesh" dropdown is supposed to be changing. It only offers number values which seem arbitrary to define a type of mesh. To add, I am using Unity's latest stable build (5.3.4) and the latest update of Puppet2D.

    Thank you to anyone that can help me out here.
     
  41. GreenHatJohn

    GreenHatJohn

    Joined:
    Nov 27, 2014
    Posts:
    8
    Looks like I fixed my own issue. Since we were nesting the package into the plugin folder, the update was only altering a few files not in the plugins folder. I had to simply delete our previous puppet2d folder completely, then reimport, then re-nest into the plugins folder. Then it creates proper paths for new converted meshes and mats. Only small issue I had to tweak was offsetting the new UV's by -.5 on the Y axis for my mat to line up correctly. Package still has plenty of inconsistent line endings on reimport, but that's not a huge problem to fix.
     
  42. Robiwan

    Robiwan

    Joined:
    Dec 29, 2013
    Posts:
    92
    Hi. Looks Puppet2D looks to be a great asset!

    But I would like to add a feature request, to export to png, with alpha. I understand you need to use a third party tool to key out the alpha as it is now, but for me I would love to have them "alpha ready". Please consider to add that in a future update.

    Much appreciated
     
  43. iodinex64

    iodinex64

    Joined:
    Mar 25, 2016
    Posts:
    7
    Hey!
    Been trying out Puppet2D lately, and I have run into a problem rigging my character.

    The problem is that once I have the bones and controls all set up, when I convert a sprite to a mesh, instead of the sprite actually converting to a mesh, all it does is create a purple mesh at 0, 0, 0, and add a 2D polygon collider to my sprite. I need it to actually convert, and it isn't happening for me.

    I have re-watched all the tutorials, and it seems to just work for you, while it does not work for me.

    I would appreciate any support, as this is halting our workflow.

    Thank you!
     

    Attached Files:

    • why.png
      why.png
      File size:
      69.4 KB
      Views:
      886
  44. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Could you check you still have the Puppet2D/Models/Materials folder?
     
  45. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    It's on my list :)
     
    Robiwan and StefanoCecere like this.
  46. iodinex64

    iodinex64

    Joined:
    Mar 25, 2016
    Posts:
    7
    It doesn't seem that way, though there is a folder within "DemoModel" called "Materials", but that contains the materials from the models that come with the plugin.
    I take it that there should be a folder there, but just isn't? Would creating a folder there called "Materials" fix this issue?

    Thank you very much for replying!
     

    Attached Files:

  47. iodinex64

    iodinex64

    Joined:
    Mar 25, 2016
    Posts:
    7
    APOLOGIES, I just created my own "Materials" folder where it should have been, and boom- everything works perfectly.

    Thank you for the pointer! I love the plugin.
     

    Attached Files:

  48. Robiwan

    Robiwan

    Joined:
    Dec 29, 2013
    Posts:
    92
    Very nice!

    Can you say anything about when you plan to implement it and/or how high it's on your list, or is it to early?
     
  49. FadhliSani

    FadhliSani

    Joined:
    Nov 18, 2013
    Posts:
    2
    Im having a problem with the flip function in the Global Control script. when i tick the flip box it was perfectly fine. but when i run the game, the rotation y value gave random value. i dont know why it does that

    Please help me
     
  50. FadhliSani

    FadhliSani

    Joined:
    Nov 18, 2013
    Posts:
    2
    Nevermind. i solved it already lol