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. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,967
    @jamieniman Thankyou so very much :) I would be happy to add the feature to the package myself except that I am not so sure on how to do the colored-pie interaction similar to dragonbones and spine. I guess I could use some sort of interactable gizmo.

    But naturally I would rather have you add the feature rather than modify the package myself so that others can gain from the addition and so that it can increase the usability (and hopefully sales) of your package.

    Currently our artists when shown the paint weights function of your package were rather confused as it is difficult to quickly see ALL the bones that a point is weighted to in a visual way. While the current paint weights is great for blending, it offers a lack of control compared to the standard colored-pie approach, so I hope you can see the usefulness of this addition for all.
     
  2. DeVoutNumelran

    DeVoutNumelran

    Joined:
    May 16, 2017
    Posts:
    1
    Hey there. Im new to Unity and game development in general and I have been using Puppet2D for a week now almost because I want to use it to animate Sprites, since I dont have the time or skill to draw entire sprite sheets.

    Im having some issues of the FFD creating a new empty Object with a White flood-fill inside the FFD lines very often when I try to make the FFD for a Sprite piece. It doesn't happen often, but when it does happen I, so far, have had to create an entirely new Project to fix it (fortunately Im very very early in the stages so this doesnt effect much.)

    Any idea what causes this?
     
  3. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Did you perhaps not select the sprite when you clicked FFD tool?
     
  4. Eleid

    Eleid

    Joined:
    Dec 8, 2015
    Posts:
    7
    Hi! I'm using puppet2d and I have an issue with opening editor window. When I'm trying to do it I got following message in the console:
    Moreover, when I'm opening the Unity I got a lot of errors from Puppet2D:
    or:
    I'm using 5.6.0f3 64bit version of Unity. If you tell me where can I check Puppet version, I will write it. Anyway, I tried to install the newest version. The errors disappired but Puppet window does not show when I'm trying to open it.
     
  5. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Could you try importing it in a fresh project, if you dont have any errors, then either something went wrong when you updated, or perhaps theres a conflict in your project.
     
  6. AndreaKopi

    AndreaKopi

    Joined:
    Jun 28, 2017
    Posts:
    2
    Hi, I´ve downloaded your latest version od Puppet2d, and I don't know have I done it wrong because I can't draw a bone the way i should do. I made a click on a scene and I can't see the bone, but I can see a bone as written (bone_1) in Global_CTRL. Also I can't draw a series of conected bones, only one by one. I probably have other problems but for now I need my bones back :(.
     
  7. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    My first thoughts are you need to increase the scale of your bone scale slider (the top of the Puppet2d UI) - set this to something much higher and see if it sorts things out for you.
     
  8. AndreaKopi

    AndreaKopi

    Joined:
    Jun 28, 2017
    Posts:
    2
    Dear Puppetman,
    before I answer on your post, even though I have some problems with Puppet2d v3.3. I want to say that I am very Satisfied with Puppet2d, it's made my work much easier and faster.

    And now, problems that I have. When I downloaded the latest version the Puppet_Editor was not complete, I could not see the scale or the picturs of skeleton or your character on the left side. In Console it was written this:

    NullReferenceException: Object reference not set to an instance of an object

    Puppet2D_Editor.OnGUI () (at Assets/Playground/Andrea/Puppet2D/Scripts/Editor/Puppet2D_Editor.cs:196)

    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)

    While I was waiting for your answer I keep on with researching and I decided to make a new project and pull new Puppet2d v3.3. Puppet2d was worked properly, at least things that I checked. Out of curiosity I deleted the Puppet2d folder from Asset and again pulled the program from the internet. I did this with my first project and Puppet2d v3.3 was worked properly. The thing is that another problem has emerged. Only the head was left of my main character when I pull it to the scene although everything was remained in Global_CTRL, all the bones and the body of the main character.

    What is the difference between pulling Puppet2d v3.3. in first project where are all animations made and a new project where the program works well from the beginning?

    thank you in advanece,
    with respect,
    Andrea Kopi

    I want you a pleasant rest of the day
     
  9. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Hi,

    So sometimes there can be issues with Unity when you try to update to a newer version of an asset. Make sure you're completed backed up before doing it.

    When you experience these issues, it could be because the GUIDs have changed in the scripts and one end or another. I found a way to get it to work if that happens, here's how:

    Go back to before you imported the new Puppet2D. Import the new Puppet2D into a separate project and manually copy all the scripts over from outside of Unity (This will maintain all the previous GUIDs).

    That should hopefully fix it.
     
  10. sam_nau

    sam_nau

    Joined:
    Oct 26, 2013
    Posts:
    9
    Thank you!!! I had this exact same problem and I was going nuts. I was beginning to think I would have to recreate my left facing animation all over again just to make the player walk to the right! This fixed it so easily.
     
  11. cosmin-zhr

    cosmin-zhr

    Joined:
    Dec 27, 2013
    Posts:
    2
    @jamieniman Are there plans for a mesh editor (adding and removing vertexes)?
     
    WhiteGfx likes this.
  12. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Hi, I emailed you a version with Poly2Tri with a different namespace. Let me know if that fixes it for you.
     
  13. corvus821

    corvus821

    Joined:
    Jan 18, 2014
    Posts:
    6
    I just bought this and am getting an error when trying the FFD. I select the sprite I want the FFD on and draw the mesh, Finish FFD, but it doesn't bind to it:

    Is it because it's trying to make some folder called BuildSlave in the C: root?
     
  14. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Can you check you have a Models/Materials folder in the puppet2d folder?
     
  15. corvus821

    corvus821

    Joined:
    Jan 18, 2014
    Posts:
    6
    That worked, thanks.
     
  16. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    Ugh. I have the Poly2Tri conflict too. Any simple fix?
     
  17. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    I changed all of the namespaces for all of the puppet2d P2T files to P2DPoly2Tri which fixed the errors but of course that will break with the next puppet2d update...
     
  18. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,773
    I still have this in Unity 2017. Lots of warnings all over the place. Trying to get rid of all my warnings, finally.
     
  19. mgreene1

    mgreene1

    Joined:
    Feb 29, 2016
    Posts:
    5
    For some reason, sometimes when I save and later reopen my projects, underneath the bones I have created, rigged, skinned, and already begun animations on will suddenly be unselectable bones listed in the hierarchy as 'HiddenBone_#" There is no rhyme or reason for why it happens, the last time I saved while working on a walk cycle and when I came back into the program after a few minutes it had happened again. There seems to be no fix and it forces me to load the player prefab where it is still working and reattach all the scripts to the object. I don't think it's affecting anything in my project just yet, but I don't want to flush hours of work down the drain if there is something I'm doing to cause this bug. What is happening with my project?
     
    Last edited: Sep 5, 2017
  20. mgreene1

    mgreene1

    Joined:
    Feb 29, 2016
    Posts:
    5
    I have a bug.

    I was having a problem where using the flip in Glbl_Ctrl would mirror my skeleton over the pivot point, rather than the center of itself. So I took the advice I saw on a video tutorial and unchilded the skeleton from Glbl_Ctrl and re-positioned it to be centered.

    That worked great for the editor, in the window it mirrors perfectly. But when I actually test it at runtime, the skeleton is being mirrored over a distant pivot point again. The only other object in the group that has that pivot point is a spline_ctrl_grp, so I tried changing that in the same way, but this causes the entire animation to break.

    Has anyone run into this problem?
     
  21. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    If the hidden bones appear, make sure not to have the debug window showing and then toggle the bone visibility. No need to worry though its just a display glitch.
     
  22. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Check all your animations in the animator, make sure you dont have any keyframes on the global controls immediate children.

    Also you should really unchild everything before moving the global control, then reprent them.
     
  23. DudeItsMarck

    DudeItsMarck

    Joined:
    Jan 26, 2017
    Posts:
    3
    Hi

    Would it be possible to add Z-Order, like in Anima2D?
    So each bone has a different sorting layer if they're connected to the same sprite.
     
  24. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Actually there is a sort vertices button you can use. It uses the sorting order of bones to reorder the verices of the mesh so they sort correctly
     
  25. snugpixel

    snugpixel

    Joined:
    Oct 22, 2017
    Posts:
    1
    I just bought this and added to a fresh project and I am getting warnings about private FixedBitArray3 mEdgeIsConstrained;
     
  26. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Which version of Unity? MEdgelsConstrained is part of the poly2tri triangulation library that Puppet2d makes use of.
     
  27. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
  28. Bagoose

    Bagoose

    Joined:
    Nov 30, 2017
    Posts:
    2
    Hey there,

    I have an issue when animating the 'flip' vaule in the IK handle script. When playing back, a 1-frame animating of the arm flipping positions can have a 1 frame spaz in the transition. Even though when you scrub through the timeline this does not occur.
    Any thoughts on what I can do to fix this?

    link to gif of the issue

    Thanks for your time!
     
  29. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    It looks as if the issue is being caused due to the upper and lower arm being folded over itself when you do the flip. Perhaps try to adjust slightly the position of the IK when you do the flip so it IK doesn't get confused. (You might want to keyframe it either side of the flip keyframe as well)
     
  30. Smartivity

    Smartivity

    Joined:
    Nov 29, 2016
    Posts:
    3
    Hi, First of all I would like to thank you for making such an amazing tool.

    I am facing an issue. I have a sprite and when I convert it into a mesh, it get's distorted.

    You can see the sprite, my inspector settings and the sprite after it is converted to mesh, in the screenshots attached.

    Thank you.
     

    Attached Files:

  31. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Hi,

    You should leave a few transparent pixels around the border of your sprite image. That should fix it :)
    (Also id recommend making your sprite textures square and powerOf2)
     
  32. smartnspiffy

    smartnspiffy

    Joined:
    Jun 22, 2016
    Posts:
    9
    Hi!

    I have a couple of questions.

    First, is there an easy way to move a bone after skinning the character? For example, if I make a mistake and I need to move the bone so it pivots on another part of the sprite?

    Also, is there a way to swap sprites during an animation? I need to change hand poses and facial expressions. It's not clear from the documentation how to do that.

    Thanks!

    Ori
     
  33. smartnspiffy

    smartnspiffy

    Joined:
    Jun 22, 2016
    Posts:
    9
    Hi again,

    I'm having a pretty miserable time with Puppet2D so far. I'm running into what appears to be a bug (and a showstopper.) I have a bipedal character with feet that can rotate. I put an IK controller on the feel, and the bones extend past the IK controller to control the foot position.

    The problem is that the tip of the foot rotates independently when I move the IK controller. It basically spins around like a top. What's worse, Undo doesn't undo the rotation, so the character is pretty much ruined once this happens.

    Just look at this thing:


    Thanks,

    Ori
     
    Last edited: Dec 17, 2017
  34. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Hi,
    Im guessing chances are you parented the control to the bone. This causes a feedback loop where the control moves the bone that moves the control ad infinitum.
    Instead parent the orient controls parent gameObject to the ik control itself
     
  35. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Moving a bone requires detaching the skin (by selecting the mesh on its own and clicking bind smooth skin) or for parented sprites you would need to unparent it. You would also need to remove and recreate any controls.
     
  36. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Here’s a detailed explanantion on how to swap bodyparts (or other things) using Puppet2D:


    Depending on how you use Puppet2d there are different ways to swap the body parts:


    1. sprites parented to bones


    These are the easiest to swap. You can animate the changing of the sprite of the spriterenderer (it will show you a image of the switched sprite in the animation window).

    In code you can do it with:


    gameObject.GetComponent<SpriteRenderer>().sprite = newsprite;


    2. Skinned meshes


    With these you will need to pre skin all your body parts to the same bones and switch them by enabling and disabling them. In code this will be


    previousBodyPart.renderer.enabled = false;

    newBodyPart.renderer.enabled = true;


    Alternatively, if you make sure the meshes have the same UVs, you can actually switch the materials.


    3. FFD meshes


    These are handled in the same way as skinned meshes, although you can save time by embedding all the meshes into the same FFD controls - which saves you the work of tweaking skin weights for each body part. (Can be more expensive though as requires 4 bone skinning)
     
  37. smartnspiffy

    smartnspiffy

    Joined:
    Jun 22, 2016
    Posts:
    9
    In that case, why does the orient control spin when I move the other leg?

    And this may be unrelated, but I've had multiple cases of the sprite rotating on the Y or X axis, or both in response to unrelated manipulations of the skeleton. What's worse, these rotations weren't undoable in the editor, forcing me to start the whole process from scratch.

    In any case, it isn't at all clear to me how to get anything done with Puppet2D. I can reproduce the rather simple use case shown in the tutorial video, but that's pretty much it.
     
  38. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Parenting controls to bones is likely to be the root cause of these issues. Once you set it in a cycle all it takes is for any change to a control to cause the cycle to get updated so it doesn't surprise me that moving the other leg causes it.

    If you haven't got any controls parented to bones and your still experiencing issues let me know, and hopefully I can get to the bottom of it.
     
  39. smartnspiffy

    smartnspiffy

    Joined:
    Jun 22, 2016
    Posts:
    9
    I'm unlikely to have the time to look at this any further, since I don't find the product particularly usable.
     
  40. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Ok then, your issues are most likely all due to controls parented to the bones they influence.

    Im going to look into detecting for cycles and then throw a warning to assist future users.

    Thank you for taking the time to report your issue. Feel free to contact me should u need any more assistance with p2d
     
  41. Priabudiman

    Priabudiman

    Joined:
    Dec 22, 2012
    Posts:
    6
    Hello Jamie,

    I followed your guide on autorig, but apparently unity take a hell of a time to calculate my model, is there anything that i supposed to do before doing autorig? kinda stuck here, thank you

    P.S
    Its literally taking ages, im currently doing another autorig pass since 30mins before i post this message and its not even done yet.
     
  42. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Hi, i recommend downsizing your sprite texture in the inspector. Usually 1024 works well for me, but if its going too slow try 512.

    Then after making the autorig you can making it larger again
     
  43. tyroflux

    tyroflux

    Joined:
    Oct 4, 2015
    Posts:
    2
    Hi, I have a fully rigged humanoid character functioning well, but I'd like to make it so the head is displayed alongside their textbox when they're talking. I assume I have to duplicate all the folders under my Global_CTRL GameObject and translate everything to the other position, but do I really need to manually re-rig everything as well? Thank you for your time.
     
  44. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    No, just duplicate the Global_CTRL itself! You can have multiple instances of your character and place them anywhere!
     
  45. tyroflux

    tyroflux

    Joined:
    Oct 4, 2015
    Posts:
    2
    This worked perfectly. Thank you so much!
     
  46. Shindoh

    Shindoh

    Joined:
    Sep 30, 2014
    Posts:
    11
    Hey Jamie,

    Has the Save/Load Poses feature been deprecated?
    I've only just purchased your asset and experimented with it for a couple of days to learn the workflow and just got to trying out this feature.

    I'm on the latest Unity version, and I pretty much do the same thing I see in the video on your website.
    The only difference is that I am not working with an FFD mesh, so I don't have those FFD control points.

    (1) My settings in the Global_CTRL object:
    (a) Bones
    : Invisible
    (b) Controls: Visible

    (2) What I do:
    (a)
    Select everything via left-click drag in the editor.
    (b) Click "Save Selection" button in Puppet2D Window's Animation tab.
    (c) Move any of the controls on the model.
    (d) Right-click the "Load" button in Puppet2D Window's Animation tab. Select "Load Pose."
    (e) Result:

    NullReferenceException: Object reference not set to an instance of an object
    Puppet2D_Selection.LoadPose (System.Object index) (at Assets/Puppet2D/Scripts/Editor/Puppet2D_Selection.cs:142)
    UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/buildslave/unity/build/artifacts/generated/common/editor/GenericMenuBindings.gen.cs:119)


    And the model doesn't update of course.

    EDIT:
    Just stumbled upon another issue regarding PolygonCollider2D and FFD Mesh generation:
    When I attach a PolygonCollider2D to my sprite before turning on the FFD mesh generation feature, the polygon is created/adopted correctly, however its location seems to be moved to origin (0,0,0), which is not necessarily where my sprite happens to be, unless I placed it there manually. More precisely, the generated mesh/polygon seems to adopt the pivot point you set in the Sprite Editor, and places the resulting FFD mesh such that the pivot is at (0,0,0).

    Naturally, if the sprite is then not within the bounds of that generated FFD mesh and you click Finish FFD, the sprite texture will be cropped.

    The bones are also not necessarily at (0,0,0), because they will (of course) be at the location where I created them to align with the sprite.

    It's not really that big of a deal as I can work around it by just placing my sprite at origin (0,0,0) to begin with, but still a little weird, because this of course doesn't happen when you simply use the "Convert Sprite to Mesh" button. The disparity between behaviors is just a little confusing, that the two methods are not both placing the resulting mesh at (0,0,0), or that both methods leave the resulting mesh at the location the sprite was previously at.

    Just for your information, in case you were not yet aware of this issue.

    Except that, loving the possibilities, newfound flexibility, dynamisn and productivity boost this great asset is providing me. Fantastic job.

    Thanks for your feedback.
    Kind Regards
     
    Last edited: Jan 13, 2018
  47. j-bomb

    j-bomb

    Joined:
    Jan 14, 2018
    Posts:
    16
    New to Puppet2D. Sometimes when I convert sprites to meshes they cease to exist. The sprites are power of 2, square. Any idea of how to fix it?

    Screenshot 2018-01-14 02.01.39.png

    EDIT: The only fix I can come up with is reducing the size of the image down to 128px and then creating the mesh, but it looks a little funky. So I filled the empty U space in the sprite using an image editor, created the mesh and then replaced the image, which is the best I can do for now, unless you have a better suggestion.

    I have to say I've had a really positive experience using Puppet2D, but the mesh creator seems to be a little finicky, a lot more finicky than Anima2D.
     
    Last edited: Jan 15, 2018
  48. j-bomb

    j-bomb

    Joined:
    Jan 14, 2018
    Posts:
    16
    I ran into the same issue, but I wanted my images to retain the same quality and size that they had originally. This might be a little late, but I figured I'd share my fix:

    1. Download and install ImageMagick.
    2. Run CMD.
    3. Change directory (cd) to the folder where the image files of your sprites are located.
    4. Create a folder inside that folder. For the example we'll call it NewFolder.
    5. Run this command:
    magick mogrify -path NewFolder -bordercolor transparent -border 50 -format png *.png
    6. Replace images from NewFolder with parent ??? profit.

    A few notes:
    If you do this after importing your assets and creating meshes, your textures will be just a little bit smaller depending on the border you set.
    The folder can do any directory inside itself, you can go deeper by with "NewFolder/NewFolder2."
    The border can be changed, it's in pixels, I have it set to 50, but 20 works.
     
  49. Shindoh

    Shindoh

    Joined:
    Sep 30, 2014
    Posts:
    11
    Are you attempting to re-convert a sprite to mesh you previously converted?
    The sprite or mesh disappearing also happens when you already converted the same sprite to mesh, and used this mesh on another object.

    If you then attempt to say, drag out the same sprite into the scene, convert it again, and when it asks you wether or not you want to overwrite the previous mesh and you select yes, then any gameobject that previously was using this mesh in your scene will now lose its mesh (become invisible), as the one they were using is being deleted and created anew, but the new mesh is not reassigned to them.
     
  50. j-bomb

    j-bomb

    Joined:
    Jan 14, 2018
    Posts:
    16
    This is good to know but not the problem I ran into. When using the mesh converter, 4k textures and meshes took forever to work with, and I had a lot of issues painting weights and working with FFD. After reading a few forum posts, I found out that it's better to work with a lower sprite resolution, rig, paint, skin and convert everything and then set all the sprites back to native res after. I was a little frustrated about it at first, but I have a good workflow down, and if I ever run into the issue again, I can just throw the image in Photoshop, fill the transparency, save, convert to mesh in Unity, then go back into photoshop, undo my changes and save, and I'll have my original asset.