Search Unity

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:
    783
    Yes, thats right - you can't have any keyframes on the global_CTRL rotation on any of the animations as this will break the flipping.

    Sorry i wasn't able to get to your post sooner - to save you the pain :-(
     
  2. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    I haven't got a windows 8 computer to test this on. I haven't had any reports of issues lately, and I would certainly plan on fixing anything if it isn't working.
     
  3. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Love the art style! I would love to see some animations from your game - please feel free to post some vids on this forum!
    I haven't heard from anyone developing from those platforms - though doesn't mean they aren't, I also havent had a bug report about them so no news is good news I guess :)
     
  4. davidthehall

    davidthehall

    Joined:
    Apr 6, 2013
    Posts:
    12
    Hi, awesome tool! Thanks for all your hard work on this!

    I have a question about baking the animation... Is it possible to bake the animation to the sprites, themselves, without needing the bones? I hope that makes sense. I know you need the bones to set the rig up, but I'm curious if once the animation is made, if it can just be saved/baked into the textures/sprites.

    Thanks again!
    -David
     
  5. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Baking requires the bone gameObjects, but you can render out a PNG sequence if you want to remove it all. I wouldn't really recommend that though as it will add significantly to file size and memory consumption.

    For more info see here: http://www.puppet2d.com/#!performance-tips/c22l9
     
  6. HarisKap

    HarisKap

    Joined:
    Dec 10, 2012
    Posts:
    11
    Hello, We are using your plugin and its awesome!

    But we have a small problem, when we are disabling the game objects, the animations after we enable them are broken, the sprites are on the wrong position. Is there anyway to disable and enable the game objects and don't have issues with the position of the sprites?
     
  7. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,035
    How can i unbind mesh(bones and FFD)?

    Can i paint weights for FFD Binding? How?

    When i click on control it selects control. How can i select bone that related this control?
     
    Last edited: Aug 3, 2015
  8. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    What are you disabling? The control gameObjects?
     
  9. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Currently the way to unbind the FFD controls from their controls is to set the size of their bones, weight, and delta attributes to zero.

    You can't currently paint weights on FFD controls, instead you need to change the weight values directly in the inspector (notice how all the weights automatically normalize to add up to 1 - thats correct)
    To change which bones a specific bone is weighted to, you should select the desired bones and the FFD control and click bindSmoothSkin - that will change the bones for that specific control. (Don't try to set it manually as the deltas won't be correct)
     
  10. charmandermon

    charmandermon

    Joined:
    Dec 4, 2011
    Posts:
    351
    Have you considered adding mecanim support? Keep up the awesome work. Also do you have a public roadmap planned out?
     
  11. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    See here https://trello.com/b/JHI4ybs4/puppet2d-feature-bug-list

    Puppet2D currently works with the mechanim state machine and blend trees - do you have a specific mechanim feature in mind that you would like it to work with?
     
  12. Cereal_Killa

    Cereal_Killa

    Joined:
    Oct 20, 2013
    Posts:
    205
    If your characters have extra maps for normals, specular, etc will these deform/move correctly with the bones/meshes to match the image?

    Also, what would be the best way to swap in/out different pose sprites or different weapons/armor?

    Also, also, if I'm making custom shaders in Shader Forge, can I assign materials made with these to the meshes that I'm using with Puppet2D?

    Shader Forge supports mostly Forward Rendering and a bit of Deferred Rendering.
    https://www.assetstore.unity3d.com/#!/content/14147
     
    Last edited: Aug 10, 2015
  13. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    All the distortion is on the vertices - so it will distort all the maps in the same way

    If using sprites parented directly to bones. Just switch the sprite property in the spirteRenderer.

    For skinned meshes and FFD meshes you can have separate materials with textures that have the different bodyparts in the same UV space as the original texture, and then swap the material in the skinnedMeshRenderer

    I can't see any reason why it wouldn't work
     
  14. ben_playside

    ben_playside

    Joined:
    Aug 12, 2015
    Posts:
    1
    Hi jamieniman - I've been testing out Puppet2D, but am running into an issue. I save my character as a prefab, save the scene, and save the project, but when I close and re-open Unity, all my skin weighting is gone. The bones and animations are intact, and the Skinned Mesh Renderer components are still there but the meshes no longer move.
    The only thing I am doing differently from my other tests (that worked fine) is that I created the meshes myself in Maya, rather than auto-generating them from sprites. Everything behaved fine and the character was animating properly, so it's something that's not saving somewhere. Any idea what I've done? Thanks.
     
  15. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,497
    Hello jamieniman. I have just bought the asset and I am trying to set up my character with it.

    Everything seems to be ok so far, except that the control sizes (round and square) is too big for me even if I drop the size to 0.

    My game's scale is small so I think I need to be able to drop it further.

    If it is a quick script adjustment, let me know where I should be looking.

    thanks.

    -- Edit --

    Also there should be option to adjust the control and bones 's transparency..
     
    Last edited: Aug 19, 2015
  16. jamez

    jamez

    Joined:
    Jun 17, 2014
    Posts:
    14
    My artist is having some issues with painting skin weights.

    Suppose we set the strength to 0.1, now the points get painted at a reasonable rate, we can control which points get the paint. However, the points never get all the way to 1.0. So using a low value for strength doesn't work.

    Now set strength to a higher value like 0.5. The points instantly turn white. So it's not useful for gradually painting the weights.

    So either the paint flow is way too fast, or the paint doesn't go on thick enough...

    I hope that makes sense. Part of the problem might have to with scale - Puppet2D generally assumes a giant scale difference from what we're using in our game. For example all the controls default to being giant (I think this is issue common for many people using Puppet2d). I don't quite understand how Brush Size and Strength interact, but it is difficult to get a good mix of both because we're working at the extreme left of the Brush Size scale (i.e. we want a brush size between 0 and 1, but Puppet2d has a scale from 0 to 100...)

    Anyways, paint weights is very cool, but right now my artist just goes in and edits the weights manually.
     
  17. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,497
    Jamieniman.

    When I disable the control visibility, it works but when I apply the prefab or drag the applied prefab into the scene the visibility of the controls (IK etc) comes back on. The inspector still indicates that it is turned off.

    This doesn't happen for bones, they seem to keep their visibility setting.

    This is critical thing as we can't have characters in the game with their controls seen. :p

    any ideas?
     
  18. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,497
    Just found out that there are 2 puppet 2d global controls.. the one at the root and at the root of the control. I am not sure how this has happened.
     
  19. darshanamss333

    darshanamss333

    Joined:
    Aug 22, 2015
    Posts:
    1
    hi i have problem with puppet2D. I convert my character to mesh using puppet2D and my sprite is hide not visible. I don't understand what happened. But i convert puppetman sprite to mesh it work fine. I use version 2.1 Please help me thank you
     
  20. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Apologies for the late reply on this - I've just come back from a holiday.

    I think there may be an issue with changing weighting information on an imported mesh. Perhaps the read/Write checkbox on the mesh isn't actually allowing all information to be overwritten. When you reopen the scene it appears to overwrite ll the skin weights with the internal weights coming from the mesh.

    I think the best solution would be to save out the mesh as a new asset in Unity - let me know if you need help/ code to do this
     
  21. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    You can manually change the controls sprite size in the inspector (Change its pixels per Unit)

    I'll add the transparency thing to the trello feature list
     
  22. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Hmmm, this looks to be an issue I wan't aware of, I'm adding this to the bug list
     
  23. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    perhaps you renamed the Global_CTRL whilst you were still in the middle of rigging. It needs the name to be Global_CTRL to know what the current rig you are editing is,.
     
  24. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Can you try cleaning the alpha around your character, it picks the first path it finds to create the outline of the mesh, so sometimes if there is a small bit of transparency that exists in the image it will take that to be the surrounds of your mesh.

    You can debug this, by adding a polugonCollider2D to your sprite, then looking at the paths in the Debug window of the polygonCollider2D. Make sure the first path is correct.
     
  25. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,497
    Hi Jam.

    I am using the spline control and I have rotated the base to 90 degrees so they are facing top in xz plane.

    This works well for IK handle but for spline, the bones do not get the proper rotation except the very first and the last one.

    I am sure this should be possible but it is a bug?

    Please take a look at it ASAP.. thanks. :(
     
  26. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Yes, I need to do a fix for this,

    in the mean time you could change line 112 in the Puppet2D_SplineControl.cs script to

    Code (CSharp):
    1. bones[i].transform.rotation=Quaternion.LookRotation(outCoordinates[i]-outCoordinates[i+1],Vector3.down)*Quaternion.AngleAxis(90,Vector3.left)*angleOffset;
     
  27. TanteDante

    TanteDante

    Joined:
    Oct 28, 2014
    Posts:
    6
  28. schmoey

    schmoey

    Joined:
    Aug 30, 2012
    Posts:
    4
    Hi!

    I'm trying to figure out a workflow whereby I can overlay one of the sprites with an animated texture that respects the alpha of the original sprite. So something like a sprite mask and then I could do whatever with the second texture, like shifting its position around etc.

    Any thoughts? Doable?

    Cheers!
     
  29. TanteDante

    TanteDante

    Joined:
    Oct 28, 2014
    Posts:
    6
  30. Wrizzy

    Wrizzy

    Joined:
    Aug 31, 2015
    Posts:
    2
    Hi Jamieniman! I just started working in Puppet2d. I like it very much. I'm having problems while animating though: I Moved my character a bit, changed his position etc. and everything was good. Then I Rotated his hand, after that I looked back at what I had and all of a sudden his hand was also rotated in the beginning, so what I did last also affected the beginning, It's really annoying cause now I need to edit every keyframe. What am I doing wrong?

    Looking forward to your reply! Thanks in advance

    Greetings
     
  31. dreamhead

    dreamhead

    Joined:
    Apr 15, 2010
    Posts:
    124
    hey
    i had a qusition about the flip tool for IK Handle's sript ,can you ainmatite the flip too? Because if i do it now, when i flip there is no keyframe made.
     

    Attached Files:

  32. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Yes, you can use any shader on the ffd meshes as well.
    (Currently there is a small issue with vert colors on ffd mesh that are set to transparency 0, so if you want to use a shader that uses vertex colors make sure you set paint them.)
     
  33. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Yup, its all open C# code :)
     
  34. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Unity's animation timeline requires at least 2 keyframes. Thats why when you move the hand on frame 10, it creates a default keyframe at frame 0.
    This is something you need to work with when you animate the character. Whatever your start hand rotation needs to be, you should copy this keyframe to the zero keyframe
     
    Wrizzy likes this.
  35. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Its a bug I plan on fixing in the next version. In the meantime heres the fix:
    In Puppet2D_IKHandleEditor.cs, replace
    Code (CSharp):
    1. myTarget.Flip = EditorGUILayout.Toggle ("Flip", myTarget.Flip);
    2.  
    with
    Code (CSharp):
    1. EditorGUI.BeginChangeCheck ();
    2.         bool f = EditorGUILayout.Toggle ("Flip", myTarget.Flip);
    3.         if (EditorGUI.EndChangeCheck ()) {
    4.             Undo.RecordObject (myTarget, "Toggle Flip");
    5.             myTarget.Flip = f;
    6.         }
     
  36. dreamhead

    dreamhead

    Joined:
    Apr 15, 2010
    Posts:
    124
    thank you it works :)
     
  37. Wrizzy

    Wrizzy

    Joined:
    Aug 31, 2015
    Posts:
    2
    Sounds obvious, thank you very much!
     
  38. 2dSparrow

    2dSparrow

    Joined:
    Oct 4, 2014
    Posts:
    20
    I'm having trouble with android and mobile distortion for ffds, in my unity editor the images look perfectly fine however on mobile versions the images are being distorted.
     
  39. Keith90

    Keith90

    Joined:
    Sep 27, 2013
    Posts:
    116
    It seems Puppet2D has a lot of errors now due to Unity 5.2. I'm not able to work on the project until you make an update. Hopefully that won't be too long.
     
  40. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Hopefully it'll be easy to fix. I'll let everyone know when its done.
     
  41. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Could you try this: turn off mipmapping on all your sprites, and make sure they are all square textures and power of 2.
     
  42. 2dSparrow

    2dSparrow

    Joined:
    Oct 4, 2014
    Posts:
    20
    Cheers dude, looks like it's fixed!
     
  43. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    I've just installed 5.2 and I'm not getting any errors.

    Could you send me some of them - so I can see what the issue is?
     
  44. Leucome

    Leucome

    Joined:
    Aug 28, 2013
    Posts:
    6
    I got errors too when I installed 5.2 .. but I re imported Puppet2D and it fixed itself so I guess the problems is with the unity 5.2 Installer not really Puppet2D
     
  45. Leucome

    Leucome

    Joined:
    Aug 28, 2013
    Posts:
    6
    Just in case somebody was looking to animate a character the same way that is done with Live2D, which is creating poses first and blend those poses after to get final animation.

    It's possible to do it by blending still pose together with a blend tree in direct blend mode . So we attribute a blending parameter value like ex: Head_Up, Head_Left. Eye_Closed to the corresponding pose in the corresponding tree.
    Note that in most case each pose need to be alone in it's own tree an animation layer instead of being part of a large tree.
    The still pose are made with a standard unity animation so if we want we can also make moving pose instead of still.

    After we can create and empty object that have an animator and a script that control the blending parameter with a slider or add the parameter with the add property, and easily record a new animation made out of other animations blended together.

    Witch in many cases is a way faster than do each animation one by one. and also pretty useful to control face expression and thing like wind that blow the hairs ect,,,


    Example script that can control blending parameter....

    Code (CSharp):
    1. using UnityEngine;
    2. using System;
    3. using System.Collections;
    4.  
    5.  
    6.  
    7.     public class PoseBlender : MonoBehaviour {
    8.  
    9.     //The animator meant to control blending parameter
    10.     public Animator animator;
    11.  
    12.  
    13.     [Space (20)]
    14.  
    15.     //-------------------------------------------------
    16.     public string ParameterName;
    17.     [Range(0, 1)]
    18.     public float value;
    19.  
    20.     //-------------------------------------------------
    21.     public string ParameterNameA;
    22.     [Range(0, 1)]
    23.     public float valueA;
    24.  
    25.     //-------------------------------------------------
    26.     public string ParameterNameB;
    27.     [Range(0, 1)]
    28.     public float valueB;
    29.  
    30.     //-------------------------------------------------
    31.     public string ParameterNameC;
    32.     [Range(0, 1)]
    33.     public float valueC;
    34.  
    35.  
    36.  
    37.  
    38.     void Start() {
    39.         //animator = GetComponent<Animator>();
    40.     }
    41.  
    42.     void Update() {
    43.  
    44.         if (ParameterName != "")
    45.         {
    46.             if (value >= 1f)
    47.             {
    48.                 value = 1;
    49.             }
    50.             animator.SetFloat(ParameterName,value);
    51.         }
    52.         if (ParameterNameA != "")
    53.         {
    54.             if (value >= 1f)
    55.             {
    56.                 value = 1;
    57.             }
    58.             animator.SetFloat (ParameterNameA, valueA);
    59.         }
    60.         if (ParameterNameB != "")
    61.         {
    62.             if (value >= 1f)
    63.             {
    64.                 value = 1;
    65.             }
    66.             animator.SetFloat (ParameterNameB, valueB);
    67.         }
    68.         if (ParameterNameC != "")
    69.         {
    70.             if (value >= 1f)
    71.             {
    72.                 value = 1;
    73.             }
    74.             animator.SetFloat (ParameterNameC, valueC);
    75.         }
    76.     }
    77. }
    78.  
    79.    
     
    Last edited: Sep 11, 2015
  46. ivoviz

    ivoviz

    Joined:
    Aug 28, 2015
    Posts:
    3
    Hey!

    It's probably me doing something wrong, but I just cant make the flipping work for hours by now. (Originally I had -X scale, but that made the animation look bad.)
    It works in edit mode, simply rotates the body on the y axis to 180 and changes the z scale to -1. However, in play mode it changes x and z axis too and even the y axis is not set to 180. Seems like random numbers, can't figure out why.

    Made a little video about it:
    First I try it in edit mode, it works.
    Secondly I use my character controller to move the character around and it flips the character using Puppet2D's flip.
    Thirdly I just constantly keep pressing the flip checkbox.


    Any help would be appreciated! :)
     
  47. Leucome

    Leucome

    Joined:
    Aug 28, 2013
    Posts:
    6


    It look like it may be caused by the rigid body ... Maybe if you place the puppet2d global_CTRL inside an other root object and put the rigid body on this object instead of directly on the global_CTRL...
     
  48. ivoviz

    ivoviz

    Joined:
    Aug 28, 2015
    Posts:
    3
    Actually it did solve the problem, thanks!
     
  49. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Yup! I was about to say that. :)
     
  50. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    783
    Puppet2D is on Sale! Half Price!!