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:
    987
    My first guess is that somehow you have lost the following folder:
    Puppet2D/Models/Materials
    If so then recreate the folder and that should fix it.

    Otherwise could you open the console and cut and paste the error log for me :)
     
  2. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    How do I use the latest features of Puppet2d v2.4
    Multi Edit FFD controls
    Fix to allow FFDs to be modified after they've been created.

    I cant find any tutorial and the userdocumentations does not mention it.
    I want to edit the FFD after/while I am creating it.
     
  3. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    • If you haven't yet skinned the FFD mesh you can start editing it by selecting it and clicking "Create FFD" button again
    • You can move the FFD control points around by selecting them in the hierarchy and then hold CTRL to move them in the scene view
    • You can add new FFD controls by left clicking in the scene view
    • You can remove FFD controls at the end of the list by pressing back space.
    • If you select the root FFD group you will see a component that contains a list of all the controls - this is the contains the information used by the FFD control creation to recreate your FFD mesh. You can actually also edit this manually - make sure that you don't have any null properties though.
     
  4. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    It doesnt work. When I do this I get a message saying: "You havent selected a sprite..." And I have selected the mesh.
     
  5. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Also a weird bug. When I make a new spine, sometimes the Hierarchy window stucks and I cannot rename any object. When I try to rename them after I click a character it immediately backspaces it and lose focus.
     
  6. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    This only happens when I look at the scene. It works ok if I look at the console for example.
     
  7. kauboglick

    kauboglick

    Joined:
    Oct 23, 2014
    Posts:
    7
    We just began using your great tool for a new project and really love it.
    But tjere is a Problem: When i try to convert this sprite to a mesh, we only get half of the mesh (the lower part). I did some FFD-Tests before on the upper part of the sprite - the one that is missing right now. Is it possible that there are some old infos from the FFD-Testing somewhere that prevents the corret Mesh-Conversion? The console shows no error.

    2016-06-30_21-00-22.png 2016-06-30_21-00-35.png
     
  8. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    The sprite you are using to convert has two images in it. Currently Puppet2D can only convert 1 piece at a time. You should separate them into two sprites.
     
  9. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    You should be selecting the FFD GameObject that has a skinnedMeshRenderer component on it in the hierarchy. Is that what you are doing?
     
  10. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Hmmm, I've heard about this one once before - but I wasn't able to reproduce it. Could you give me steps to reproduce, as well as what Unity version you are using, and what operating system you are on?
     
  11. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Windows 10 64bit. Unity 5.3.4f1. I just make one FFD, then make a spine to control the FFD. Attach the FFD skin to spine and I cannot raname any object. When I am looking the Scene view. When I am looking the console for example it works.
     
  12. kauboglick

    kauboglick

    Joined:
    Oct 23, 2014
    Posts:
    7
    Thx. That was easy :)
     
  13. kauboglick

    kauboglick

    Joined:
    Oct 23, 2014
    Posts:
    7
    Actually we are trying to do exactly that. The hand-Controller (handL_CTRL) of an IK-Arm is a child of a bone (belonging to the body) and follows the motion of it. Simultaneously we are animating handL_CTRL by script on top to move the Hand (and Arm) additionally. Like a kind of scratching-movement.
    It works fine right now! But could this lead to problems or are there any other pitfalls?

    2016-07-01_09-52-59.png
     
  14. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    This is a silly bug but its not letting me work...
     
  15. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I have narrowed the bug. It only happens when in the Global_CTRL FFD_Visibility is enables together with Bones Visibility. In any other combination it works ok.
     
  16. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    There is a skinnedMeshRenderer for every FFD point if I click those same thing happens. If I click the mane FFB object same thing happens... If I click the sprite that became a mesh it doesnt do anything. Is there any other skinnedMeshRenderer ?
     
  17. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    That may be ok - its an issue when you get cyclic influences - when you have bones influencing controls influencing bones in a never ending loop. An example would be if you parented the hand IK control to the hand bone.
     
  18. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    So odd, I'll take a look this week. Does either re-opening the scene or reopening Unity fix it temporarily?
     
  19. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Did you definitely update to the latest version of Puppet2D? Could you make a little video showing what your doing (with the console open) that would really help me see what is at issue.
     
  20. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    No, even a system reboot doesnt help.
     
  21. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Yes, but just in case I will delete all the Puppet2d folder and resintall.
     
  22. Trstek

    Trstek

    Joined:
    May 31, 2013
    Posts:
    4
    Hey there,
    First of all, I really enjoy Puppet2D, it takes some time to get used to it, but at the end is really awesome :)

    Now .. I'm prototyping a project with a bit more complicated mesh, what i did was
    - create mesh for sprite with FFD tools,
    - but because i had some artifacts when deforming, i decided to edit mesh in maya, added some edges, and vertex points, (it's pretty big mesh, so doing it externally is way quicker for me then redoing FFD)
    - import new mesh in scene, bind FFD points to a new mesh
    - worked pretty smooth, artifacts were gone, then I tried to fine-tune even further with painting weightpoints ...
    BUT -- when toggling "Paint Weights" the new Mesh 'exploded'/deformed/ :)

    so i was wondering, if there is a workaround for this ?
    or if there is a proper way to bind existing FFD to NEW MESH, with possibility to automatically create weightpoints ?
     
  23. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    Is it possible for the "convert sprite to mesh" to work properly for sprites with gradients?

    Like to only cut out the areas that's 100% transparent?

    For example if i were to use the convert to sprite button a gradient circle would be mostly cut off into a somewhat solid circle.

    If puppet 2D doesn't have the function, what are methods for custom sprite meshes to use with it?
     
    Last edited: Jul 25, 2016
  24. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    There are a few ways to have finer control over the bounds of the mesh.
    1. You can place a polygonCollider2D component on the sprite which gives you the ability to manually edit the mesh points before you convert it.
    2. You could use the FFD tool to create the mesh from scratch (You don't need the FFD controls, you can delete these)
    3. You can change the source sprite temporarily before the convert process. So with your circle example you could use an opaque circle to do the conversion then change it back to the transparent gradient circle.
     
  25. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Ok, so this will depend on how you plan on using the mesh, as a normal skinned mesh, or as an FFD :
    1. Skinned mesh
    So with this you wouldn't need the FFD controls anymore so first delete these. Then you should be able to bind the mesh with no problems (let me know if there still is one)
    2. FFD
    These are when you want to use those individual controls which each can be skinned to the bones. You cant bind these directly to a new custom mesh, but there is a way to embed the new mesh into the FFD controls. To do this you will need the original mesh that was created with the controls. You can then select the controls and the new mesh and bindSkin using the 4(FFD) setting. You wont be wanting to paint weights on this now, as it will get its positions based on the FFD controls. (The ffd controls can be skinned to the bones, and you can change their weighting in the property window)

    Hope that makes sense

    Jamie
     
  26. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    873
    Ok will do, it's worth noting the FFD solution is a problem if you want to bind a mesh made from FFD to a different FFD. It seem like the position of the sprite shifts to the origin rather than maintain it's position.

    The making a sprite mesh then changing the texture worked well enough for me.

    I now have a new question, so what are recomended methods for applying physics to the bones? specifically a spring joint.

    I have two issues.

    1) The physics appear to work and bounce in place, but when the body moves the hierarchy seems to make the physics enabled objects move ignoring the change in movement. So they're kind of in a physics bubble

    I guess this is because of the cntrl group hierarchy, this is for a characters hair, so there's body, head, hair, then maybe whatever joint the hair has. Not having the groups parented seemed to have odd behavior, should i just not do this or am i doing it wrong?

    This is how the hierarchy looks.



    2) when i move any other ctrl group the spring joint "falls" until it is let go. What would cause this?
     
  27. zsolt67

    zsolt67

    Joined:
    Jun 21, 2016
    Posts:
    19
    I just realized some of the controls duplicated. I didnt do that, how is it possible.
    Ver can I see the version number of Puppet2D installed?
    dupl.JPG
     
    Last edited: Aug 5, 2016
  28. lugard

    lugard

    Joined:
    Nov 27, 2015
    Posts:
    21
    I have a trouble with "Paint Weights". 2016-08-09 03.19.13.png 2016-08-09 03.19.05.png
    I am painting outside of the "bw area" and the "red zone" is changing. Weights are changing randomly.
    I am using Unity 5.3.4f1 (64-bit)
     
    Last edited: Aug 9, 2016
  29. mandarin

    mandarin

    Joined:
    Dec 8, 2009
    Posts:
    21
    Hi.

    You have an error in Puppet2D_Editor.cs when using Unity 5.4.0f3:

    Code (CSharp):
    1.  
    2. get_dataPath is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'Puppet2D_Editor'.
    3. See "Script Serialization" page in the Unity Manual for further details.
    4. UnityEngine.Application:get_dataPath()
    5. Puppet2D_Editor:.ctor()
    6.  
    You can fix it by replacing line 61
    Code (CSharp):
    1.  
    2. private string pngSequPath = Application.dataPath, checkPath;
    3.  
    with this one:
    Code (CSharp):
    1.  
    2. private string pngSequPath, checkPath;
    3.  
    and in OnEnable function, add this line:
    Code (CSharp):
    1.  
    2. pngSequPath = Application.dataPath;
    3.  
     
    CarterG81 likes this.
  30. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Yes, paint weights only works from the bind pose (where the character was when you first skinned it)
     
  31. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Thank you, I hadn't tried 5.4 yet. Is the only bug? I'll update the package with the fix.
     
  32. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    You can't really - if its the latest version there should be a material named 2.4 somewhere.

    Did you manage to figure out what was causing the duplication?
     
  33. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Really sorry for the late reply on this one - it seems to be to get springs working, you need to manipulate the root anchor directly.

    Did you manage to get it to work?
     
  34. mandarin

    mandarin

    Joined:
    Dec 8, 2009
    Posts:
    21
    There was a bug where Unity crashed when I pressed Cmd + Z (undo) after having created a Mesh from a Sprite. I sent the bug report to Unity along with my files, and an hour or so later someone from Unity replied and said he had managed to reproduce the bug. Seems like they're on the case.
     
  35. cursedj07

    cursedj07

    Joined:
    Sep 8, 2016
    Posts:
    2
    Hi, first of all, I want to say : awesome asset !

    So I have problem flipping my character :

    when I use scale -x to flip the character, all the bones are messed up,
    1. I have everything parented to global_CTRL (although i changed its name and all the script of the player are on it)
    2. All bones and Controls are separated
    3. In the scale value I have -1 1 1
    4. In the animation Im not using flip
    5. I have a rigidbody on global_CTRL

    I also tried to flip the character :
    -by changing the value of y rotation, but the value doesnt change (I think its because the animator is also using rotation)
    -by accessing the globalControl script to get the flip bool, and set it to true or false but it doesnt work (Im quite new to programming so this might be a script problem, if it is the right way to go of course -_-.)

    Spent the last 2 days looking for solutions but... help please :')
     
    Last edited: Sep 8, 2016
  36. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,773
    Have you tried to place everything in an empty gameobject & just flipping the empty parent?

    I always separate graphics from everything else.

    • Character (Parent- All player scripts)
      • Graphic (child- All graphic scripts, animator, etc.)
        • global_CTRL (child of child)

    Flip 'Graphic', not global_CTRL.
     
    Last edited: Sep 8, 2016
  37. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987

    You want to use the flip on the global control. You also can't also animate the global_CTRLs rotation and scale as this will interfere with the flip. This is also the case if any of the other animations in the animator have rotation or scale keys.

    Heres the code

    Code (CSharp):
    1. GetComponent<Puppet2D_globalcontrol>().flip = true;
     
  38. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    Its the IK controls and spline controls that need the flip on the global control to sort out the aiming.
     
  39. cursedj07

    cursedj07

    Joined:
    Sep 8, 2016
    Posts:
    2
    I managed to make it work by baking the animations, no controls = no messed up bones with negative scale/flip.
     
  40. geekchau

    geekchau

    Joined:
    Jun 13, 2013
    Posts:
    16
    I just came across this and was wondering if this tool is still being worked on (feature, bug fixes etc)?
    I'm interested in purchasing this in case I need it in the future (I don't need it for any project right now), but would like reassurance that it will be future-proof for the next few years at least. Thanks!
     
  41. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    I'm currently working on an autorig feature - (a bit like in mixamo). Hope that answers your question. Also see above, I'm always supporting my users.
     
  42. geekchau

    geekchau

    Joined:
    Jun 13, 2013
    Posts:
    16
    Thanks, that's great to hear. Just a few questions before I commit if you don't mind:
    - Does this work with 2DxFX?
    - Can you swap sprites in/out? For example, changing a weapon or character clothes.
     
    Last edited: Sep 13, 2016
  43. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Hi @jamieniman,

    Just a quick question. Is there any way an animation can be baked into a sprite sheet after creation?

    Thanks
     
  44. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    There is png sequence renderer feature included.

    Also someone made their own extended one https://www.assetstore.unity3d.com/en/#!/content/69192

    I haven't tried it, but its worth a look for $4
     
    Last edited: Sep 14, 2016
  45. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    I haven't tried 2DxFX but I imagine its a bunch of shaders, so I can't see a reason why it wouldn't work.

    Parented sprites can be swapped easily in code or in the animation. (In the animation window you see a visual image for the keyframe)

    Code (CSharp):
    1. GetComponent<SpriteRenderer>().sprite = newSprite;
    For Skinned meshes you can do the following - create another material with the new texture (it should share the same UV space as the previous texture) Then you can animate the switching of the material or switch it in code. (You also see the image as a keyframe)

    Code (CSharp):
    1. GetComponent<SkinnedMeshRenderer>().material = newMaterial;
     
  46. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Hi @jamieniman,

    Thanks for the reply. I did see that other asset. It says there are problems with the built in png sequencer showing bones. Is this an issue or is it easy to work around?

    Thanks
     
  47. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    987
    You can just turn them off in the global_CTRL, so not too sure what they are referring to.

    In any case, I would agree the png renderer in p2d is feature that could do with a bit more love :)
     
  48. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Thanks. :)
     
  49. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    As a temporary workaround there is a plugin for gimp called 'fuse layer' that creates spritesheets. If you have a good quality exported image then it can make the sprite sheets. The only problem I can forsee is reducing the spritesheet size without affecting the sprite quality so this woul probably need consideration at exporting the .png stage.

    Edit - In gimp you just select all the images and import as layers then use the fuse layers tool.
     
  50. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021

    Just thought and may be wrong. To avoid the loss in quality this is probably what that asset you mentioned above does but controls it more easily than doing it manually in gimp or some other pacakge
    .