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

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    This one sounds odd - do you get a line number for the error (and are you using p2d v2.0, you shouldn't have issues with source control with this version).
     
  2. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    For simple things like mouth and eye shapes its a breeze with sprite swapping -

    you just change the sprite and it will set a visual keyframe in the keyframe editor. You can even change this in code using getComponent<SpriteRenderer)().sprite = newSprite;

    If you want to swap a skinned mesh or FFD mesh (eg and arm or body part) you can switch them by changing their materials. You can see this as keyframes as well. The only restriction is that the image needs to occupy the same UVs as the original character.

    Hope that makes sense
     
  3. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Just to clarify: p2d has 3 ways of working:
    1. parented sprites. These don't want to be converted to mesh, and are directly parented to bones.
    2. skinned meshes to bones. This is where you convert to mesh, and bind smooth skin to the bones.
    3. FFDs. This is where you create a mesh with an FFD control at each vertex. These controls are then skinned to the bones.

    In answer to your question:

    using method 1: if this blurred circle doesn't need to deform leave it as a sprite.
    using method 2: This auto-decides the boundry of the mesh - you can set this manually by adding a polygonCollider2D and moving the points around before converting it.
    using method 3: You can manually set the vertices of the created mesh. If you dont want to use the FFD controls, you can actually delete them and then use the mesh in the same way you would in method 2.

    Sorry for the long winded answer - just thought it might clarify things better
     
    j-bomb likes this.
  4. thienohs

    thienohs

    Joined:
    Feb 6, 2014
    Posts:
    13
    Hi Jamie,
    Having the same problem with Texture Packer changing the mesh texture UV.
    I'm not sure I understand correctly what you described here about reskin the meshes.
    These are the steps that I follow :

    1. Drag a new sprite in.
    2. Select the new sprite and convert the sprite to mesh.
    3. Re-attach all the bones, spine control, FFD... to the new mesh.

    3 steps x 5 sprites of one character, taking a huge amount of time every time the texture atlas is updated.
    Is there a quicker way ?
     
  5. Deleted User

    Deleted User

    Guest

    Hi Jamie,

    Thanks for making Puppet2D! Really great so far :) I am also interested in the answer to this:

     
  6. mhope

    mhope

    Joined:
    Aug 14, 2013
    Posts:
    13
    You can use Puppet2D to blend animations in Mecanim by using Layers in the Animator.
    We are using this in our current to, for example, allow the character to swing a sword while running, and
    using re-using that sword swing for other states such as walking, jumping or standing and doing nothing.

    I think the issue you might find with trying to blend animations, though, is that due to the fact that a Puppet2D mesh has far less vertices than a typical 3D model, the results you will get will often be far more pronounced than in a 3D project.
    So, to deal with that we basically designed our Override animations with the expectation that they would override a controller's lower priority animations entirely.

    That is, for instance, when blending the sword swing animation with the run animation, we didn't want the override motion to effect the character's legs at all. So, the attack animation is firstly placed on an Override layer with a weight of 1, and we just made sure that each override animation didn't contain any keyframes for parts that we didn't want it to override.

    Depending on what kind of look and feel you want your mileage my vary, but this is currently working out for our needs.
     
  7. mhope

    mhope

    Joined:
    Aug 14, 2013
    Posts:
    13
    Jamie,

    I have another little issue I can't seem to figure out, and maybe you have come across it already.

    In our current project, we are manipulating an Additive Color property in a script which passes it to the custom shader in each sprite or mesh in the hierarchy order to turn the sprites / textures completely white. As I mentioned, there are some characters that are completely using Sprite Renders with parts being parented to bones, while others have a mix of both Sprites and P2D skinned mesh parts.

    With Sprites and, it appears, non-skinned meshes we can change that Additive Color property's values in the Animation timeline, and when the animation is binded to a state in Mecanim it perform as expected.

    However, in a case where the character has a skinned mesh in its hierarchy, not only will the skinned mesh not change color in the scene, but all of the other objects -- regardless of renderer type -- will also no longer appear to respond to the parameter adjustment.

    Some strange observations:
    ① While the meshes and sprites do not change color in the scene, if you view their materials in the Inspector, you will see that the material preview (sphere display) does change color as expected.

    ②The Color Picker which the script is intended to change, however, does not appear to be changing color.

    ③If we run the Scene with the character's Animator disabled (unchecked), then manually play the animation from the Animation tab interface (that is, play the animation without using Mecanim states), the script functions as expected and the colors change.

    ④However, if we enable the Animator while in play mode, the script function is immediately interrupted.

    ⑤Lastly, without leaving play mode, if we disable the Animator once again, the script remains non-functional.


    For your reference, here is a simple version of the script I am using to accomplish this:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4.  
    5.  
    6. public class WhiteFlash : MonoBehaviour {
    7.    
    8.     public string                targetProperty        =        "_AdditiveColor";
    9.     public List<Renderer>        targetRends            =        new List<Renderer>();
    10.  
    11.     public bool                    changeColor            =        false;
    12.     public Color                additiveColor;
    13.  
    14.     // Use this for initialization
    15.     void Awake ()
    16.     {
    17.  
    18.     }
    19.  
    20.     public void ResetColor()
    21.     {
    22.  
    23.     }
    24.  
    25.     // Update is called once per frame
    26.     void Update ()
    27.     {
    28.  
    29.         if(changeColor)
    30.         {
    31.             foreach(Renderer r in targetRends)
    32.             {
    33.                 r.material.SetColor (targetProperty, additiveColor);
    34.             }
    35.         }
    36.    
    37.     }
    38. }
    39.  
    We will keep investigating on our end, but if you or any other experienced users have any insights it would be most appreciated. Thanks!
     
  8. jakob_wit

    jakob_wit

    Joined:
    Mar 20, 2014
    Posts:
    2
    Hey jamieniman,

    i have a following problem:
    i have a character leg (left leg) and have reflected this leg for the right side. When i use the FFD for the right leg (reflected leg) It doesn't work. Must I create extra right leg in the sprite sheet or you have another solution.
     
  9. herbie

    herbie

    Joined:
    Feb 11, 2012
    Posts:
    237
    Hi,

    I was wondering how you can animate the mouth of a character (talking, laughing, etc.) with Puppet2D?
    What is the best way to do that? With a bone, FFD or switch the sprite?
     
  10. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Either of the methods could work depending on the style of animation/ look of the character.
    The simplest solution would be to have a few premade mouth sprite sheet and swap them out as parented sprites.
     
  11. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    The simplest solution would definitely be to have a separate leg image. If thats really an issue for you I can check to see if i have another way?
     
  12. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    I'm not sure - my first question would be - do u have any keyframes on the color attribute in any of the animations living inside the animator controller - even if they aren't on the current animation this can cause problems?

    Next question - what shader are you putting on the skinned mesh?
     
  13. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    I would try this - do all your animations on the "_CTRL"s and all your procederal animation on their parents ("_CTRL_GRP") That way you can have both working at the same time
     
  14. hasen

    hasen

    Joined:
    Apr 1, 2015
    Posts:
    29
    How does it compare with/differ from Uni2D?
     
  15. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Hey there, I sent you a PN with some questions, hope you don't mind :)
     
  16. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Must have missed it - I've replied now :)
     
  17. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Puppet2D concentrates more on the "rigging" side. Its made to be like how you would setup a 3d character for animation, with an easy to use "rig". Some of its unique features are FFDs, Spline, IK and other controls, etc Check out the features page of the website: http://www.puppet2d.com/#!about/c2414
     
  18. herbie

    herbie

    Joined:
    Feb 11, 2012
    Posts:
    237
    I watched the Puppet2d tutorials several times and now I understand how you make animations as done in this tutorials.

    I am a little bit a noob at 2D animating at the moment but what is the next step after Render Animation?
    How do you get your animation into your game? Do you have to Bake the animation?
    Is there a tutorial that explanes what you have to do after Render Animation?
     
  19. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    You don't want to be rendering the animation. Thats mostly a non game use feature.
    Baking animation on the other hand may potentially be an optimisation - but I wouldn't bother with it until you are looking at optimising ur game
     
  20. IMac

    IMac

    Joined:
    Apr 18, 2015
    Posts:
    1
    Hello Guys,

    I've been looking for a solution for 2D animation that integrates well with Unity, and Puppet2D seems like just the ticket.

    Is it compatible with Unity 5?
     
  21. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Yup! It sure is :)
     
    IMac likes this.
  22. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Hey there, I sent you another message/email, would be great if you could have a look!
     
  23. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    I replied :0)
     
    BTStone likes this.
  24. mogwhy

    mogwhy

    Joined:
    Nov 20, 2014
    Posts:
    36
    Please make a github page and use the free issue tracker for bug reports and questions. (you can tag the issues from the people with "question" "answered" "need more info" "confirmed bug" "will be fixed in 2.2", "how-to" ...)
    Using one forum-thread for eveything is really annoying for us to see if problems were already discussed.
     
  25. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    There
    You can track progress on my trello page here: https://trello.com/b/JHI4ybs4/puppet2d-feature-bug-list
     
  26. mhope

    mhope

    Joined:
    Aug 14, 2013
    Posts:
    13
    Hi Jamie,

    Thanks for your reply!

    Yes, actually, there were color value keyframes in some of the animations inside the Animator.
    I just tried the script with a fresh Animator, and it worked. Quite a bug! Glad you had come across it before.
     
  27. Emsw0rth

    Emsw0rth

    Joined:
    Apr 8, 2014
    Posts:
    11
    How would one go about doing a "blend" animation from one view of a character to another - standing (idle animation) facing the "camera" and smoothly transitioning to a "run" animation (as seen from the side)?

    Part of this seems possible using an FFD cage - but not the whole process. I do realize you could simply swap out sprites to complete the transition - but seems wasteful of resources.

    This seems to be the grail that I and many other 2D artists are seeking to employ in our games.

    I'm just now looking into it - but ToonBoom Harmony now has an API for Unity - and Harmony has the means to automate this process. Quite an expensive solution, however.

    Thanks,

    Greg Smith
     
  28. Mo_money

    Mo_money

    Joined:
    Apr 21, 2015
    Posts:
    5
    I'm thinking that your asset meets my needs for animating, especially after reading this post. I want the player to choose different armor pieces and between a few weapons at the start of the level, I believe that this is reminiscent of the above post? Thanks
     
  29. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    You can do a lot with FFDs,
    this is something a p2d user (spacemarine) posted recently:

     
  30. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Sure, you can swap out armour by just switching the sprite or changing the material if its a skinned mesh. (The new material should have a texture with the body part with the texture in the same uv place)
     
    Mo_money likes this.
  31. thematthopkins

    thematthopkins

    Joined:
    May 26, 2014
    Posts:
    2
    I'm working on a 2.5d game, and wanted to see if I'd be able to use Puppet 2D. Currently I'm animating a transform hierarchy, but managing animations is getting tedious and Puppet 2D is looking like a pretty fantastic alternative.
    Will a single Puppet 2D skeleton allow bones to be placed at different depths? I'm doing an overhead view game where the camera angles vary a bit, so different body parts at different depths give a nice effect, something like:

    Head: Z=10
    Shoulders: Z=8
    Arms: Z=6
    Etc.

    Thanks!
     
  32. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Sure - you can rig them in those positions, thats no problem
     
  33. Emsw0rth

    Emsw0rth

    Joined:
    Apr 8, 2014
    Posts:
    11
    Jamie:

    Everything in Puppet2D is well explained in your videos, except all of the parenting and control juggling that goes on - as well as layer creation. Basically there is a lot of "setup" that needs to take place initially and during different phases prior to actually animating. You do rather "breeze through" this setup phase - which primarily focuses on the Hierarchy view and the Inspector.

    Do you think you could make some slow moving videos that show everything you are doing in both of those panels - and why you are doing them? Could you make them in 1080p so that everything can be seen clearly?

    I've tried stopping your existing videos at various points throughout the presentation - but you do things so quickly - they are very hard to "catch" and then absorb.

    Also, is there a way to Translate an entire mesh part without using bones?

    I think it would also be beneficial to show how Puppet 2D is used in practice with Unity's animation state machines - Blend Trees, etc.

    Thanks,

    Greg Smith
     
    Last edited: May 1, 2015
  34. igUnity03

    igUnity03

    Joined:
    May 1, 2015
    Posts:
    2
    Jamie,
    I tried creating an FFD on an existing piece of art and watched your video.
    I wanted to recreate the croc head with the eye mesh.
    Once I created the FFD the art disappears. Only when I pan out does the art reappear.
    Is this a bug?
    Also, I agree with Ems0rth, Some of the videos go by very quickly and even when I pause to try and catch up I feel that I've missed something. Even trying to use the bone tool with your tutorial I've yet to get my bones to attach to the art. I just hope I'm not that dumb.
    Tony head.JPG
     
  35. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Could you send me the specific time codes you want me to explain ?
    Here's a few general pointers anyway:
    - Parent everything under the global_CTRL
    - keep the bones and control separate
    - whenever you have orient controls that you want to follow the same hierachy as the bones, do the following:
    say you have bones hip>waist
    and you have orient controls hip_CTRL_GRP>hip_CTRL and waist_CTRL_GRP>waist_CTRL
    parent the waist_CTRL_GRP to the hip_CTRL so it follows the same hierachy as the bones.


    After its been skinned? No. Although you can unskin the mesh and move it and then reskin it. (you can even keep the skin weights - ask me if you want to know how to do that)
    yes, thats a good idea. I'm busy working on an update - I hope to find time for stuff like that in the future
     
  36. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    You should tick "update offscreen" on the mesh should fix that bug.
    Are you working in 2d view by the way? that screen shot suggest you're not which could cause issues.

    To skin an ffd mesh to bones, just select the mesh and the bones and click "bind smooth skin".
     
  37. caiolima

    caiolima

    Joined:
    Feb 3, 2015
    Posts:
    2
    Hi Jamie,
    I think I'm with a similar problem of igUnity03, I was following your v2.0 crocAnim tutorial, but when I select the croc's right arm, its respective bones and I press Bind Smooth Skin the arm's mesh disappears. I've already tried to select 'Update When Offscreen'.
     
  38. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Could you select the mesh (in the mesh property of the skinnedMeshRenderer) and look at it in the small view box in the inspector window. Can yo see a mesh there or is it empty?
     
  39. caiolima

    caiolima

    Joined:
    Feb 3, 2015
    Posts:
    2
    Yes, I can see the mesh shape on the inspector, but in the Scene view its shape appears completely distorted, after the 'Bind Smooth Skin'.


     
    Last edited: May 5, 2015
  40. Emsw0rth

    Emsw0rth

    Joined:
    Apr 8, 2014
    Posts:
    11
    Jamie:

    I'm wanting to know the most direct way to move separate mesh pieces (after an FFD has been created for each one) - so that, as in the case of a turning head, for example - meshed eyes, nose and mouth could be moved, over time, from one side of the head to the other, while scaling, distorting them to give the illusion of perspective and rotation.

    If all facial features are contained in one FFD mesh, this is much more difficult to achieve (as in the example you showed). I suppose bones could be used for each independent piece - but I'm not sure if they can be moved as independent objects, themselves (the bones) - plus, the bone shapes get in the way of seeing what you are doing.

    In your existing videos - the interface elements are very small (Inspector, Hierarchy) and your mouse cursor is also very small and you are moving really quickly - so quickly I can't catch what you are clicking on and moving - even when pausing these videos and advancing the time indicator slowly. If your cursor were larger and you moved slower - zooming in on the relevant actions - I think it would be a lot clearer for those of us doing something like this for the first time.

    If I understand the layer setup correctly - (I don't think I do) - you need to set up, in advance - layers for Player, Bones and Controls? Are these regular Layers or "Sorting Layers"? In the Puppet2D interface, when do we need to manually select these layers - and for what processes? This is where a dedicated video would be so helpful.


    thanks,

    Greg Smith
     
  41. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    Have you got Puppet2d v2.1? There was a unity 5 bug in the previous version that did that.
     
  42. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    You can have individual FFd controls for each piece. Keep it simple with 4 points for each part. That way u can shear the part as well as squish them non-linearly

    Of course you can animate each bone separately. You can scale them down using the slider in the GUI. Plus you can make Parent controls out of them to make animating easier, and then hide the bones on global_CTRL.

    Ill pay attention to this in future vids

    They are for sorting layers. It makes the the layer of the control and bone sprites set to this layer. Its advised to set two layers - bones & controls before beginning with p2d, and make sure they are set in the p2d gui. That way every bone/control that you make gets the correct sorting layer on creation.
     
  43. herbie

    herbie

    Joined:
    Feb 11, 2012
    Posts:
    237
    In puppet2D you can convert Sprite To Mesh.
    I was wondering if it is also possible to convert Mesh back to Sprite.
    Or am I asking something stupid now?
     
  44. Echo_C_Delta

    Echo_C_Delta

    Joined:
    Apr 14, 2015
    Posts:
    1
    Hey guys, we've been having a pretty persistent issue that I've been unable to fix.

    Using the FFD seems to cause the mesh to become either inverted or refusing to be lit properly. We're using the SpriteLamp shader and non-FFD meshes converted through Puppet2D receive lighting just fine, so I'm not sure what I'm doing wrong. The troubleshooting I've performed so far is;
    - Converted the sprite using the converter and it works fine, it seems isolated to just the FFD process.
    - Tested shader, normals and other maps on every other sprite after they were converted to meshes and all work fine.
    - Binding smooth skin causes the shader to stop receiving light.
    - Tested to see if scale was an issue, confirmed it isn't.
    - Tested to see if other sprites can be converted/bound to smooth skin, all produce similar issues.
    - Lighting quality is set to high, as I thought maybe that was a problem.

    Ultimately I can't figure out what the problem is - the interesting part is that Standard material with cutout enabled works fine until normals are loaded, to which it immediately goes 'dark' and stops being lit properly.

    I know it's a very niche issue, but it'd be great to figure out if the problem is with the shader, the material setup, the mesh that is being created or maybe something even more obscure. Worst case is that we'll scrap using FFD altogether for now, which I really don't want to do.
     
  45. DigitalToy

    DigitalToy

    Joined:
    Oct 29, 2012
    Posts:
    11
    I am having related problems. I noticed that the Puppet2D script which converts the sprites to mesh creates a material with the Unlit/Transparent shader. This will not receive light, and has no provision for normals. When I try to change the shader on the material to the standard shader, and add normals, I have similar problems to the above poster. In addition, trying a variety of shaders, I am getting an odd flickering of the sprites - this seems to only be resolved with the Unlit/Transparent shader. I'd love some advice on how to get from what Puppet2D sets up for me and a solution whereby I can have response to light and normals.
     
  46. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    You don't need to convert it back - you can always redrag it back in from the project window.
     
  47. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    I think I've got a fix for this in my latest version v2.2 (soon to be released) Send me ur invoice # and I'll email it to you to try out.
     
  48. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    985
    As above - send me ur invoice # and ill send you a fix
     
  49. AmefuriSkeith

    AmefuriSkeith

    Joined:
    Sep 26, 2013
    Posts:
    3
    Hi Jamieniman,

    I am considering to buy your asset. But I have some question to ask you. I wanted to do some character animation like this :

    Which required deform and have to be able to change armor&weapon without too much extra work on my artist.
    Can you check my reference and tell me your throught that you think it was done in 3D Pre-Render or in 2D bone-based with deform?
    If you think it done in 3D, do you think that 2D bone-based can make something that have result as closed as that?

    Thank you,
     
  50. Tommassino

    Tommassino

    Joined:
    May 25, 2014
    Posts:
    7
    Hello guys, I would like to ask you whether you have some tips how to work with multiple characters using puppet2d ?
    Just with one character there si plenty of control objects under Global_CTRL and with more character it could get little bit messy :)
    How do you solve this situation ?