Search Unity

Puppet2D - An advanced skeletal animation tool

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

  1. Jiraiyah

    Jiraiyah

    Joined:
    Mar 4, 2013
    Posts:
    175
    no worries, i will make a video about it with all the problems i saw and i will send you the link by email.
     
  2. _watcher_

    _watcher_

    Joined:
    Nov 7, 2014
    Posts:
    112
    Thank you for the reply. I'm already using a different tool, but would totally come back to Puppet2D if it was fixed. The in-engine integration sounds just too good for fast iterations.

    To answer from what i remember, i was using the same mesh, i tried different sequential approaches, eg first i tried doing start FFD convert > path1 > finish FFD > select the same mesh > start FFD > create path 2 > finish FFD > .. > select the same mesh > start FFD > create path N > finish FFD.
    Then i tried doing all paths at once between start FFD and finish FFD.
    And other ways i could think of. Tried those again multiple times, sequentially, very slowly, paying attention where it breaks. When following these steps diligently and sequentially, your system seemed to hold fine. I seemed to notice it broke when i pressed Ctrl or Shift when out of FFD (eg when the mesh was already deformed) and there were other cases, ultimately the bugs seemed to pertain to unhandled exceptions from using controls. I was honestly pretty certain, that if you go sequentially and between each step you try to press random keys violently :confused:, and try some other stuff, like grabbing vertices and moving them around, criss-cross them, i dont know, do wild stuff - you might find few untested combinations that would break the mesh - and the Ctrl+Z will no longer function, and since the mesh is already deformed in a wrong way - and you cant go back - you have to start over. The starting-over part is the worst part honestly. We are talking "complex meshes" - where starting over means a lot of extra work before things break again. So yes, you need to isolate the use-case, i cant give you precise answer/breaking-point, all i remember is that there were multiple, and you gotta play with it in your free time. Id suggest just play with it, go wild, forget you know the system at all. Using Ctrl+Shift all the time like a robot? Stop using them. You dont know them. Use just mouse like a stoneage monkey. Limit yourself, and then allow yourself to violently smash the keyboard to expand the input range and see what your asset can handle. Lots of time i dont have to test and isolate the bugs.

    But you do.

    Good luck!

    PS Oh and i do like the idea of having 1 path and inner points, let teh system handle the triangulation based on inner points defined by the user (similiar to Spine2D -- if that's what you ment)
     
  3. KobiLe

    KobiLe

    Joined:
    Mar 10, 2015
    Posts:
    1
    hi, i have a simple matter i dont understand, when i create ffd around a sprite, it collapses the sprite. im adding an animated gif to show the problem.
    thx!

     
  4. skord61709

    skord61709

    Joined:
    Jul 13, 2018
    Posts:
    2
    @jamieniman

    We are using this tool and I am wondering why my sprite does this when I use the FFD tool? It pulls and stretches the image and the outline is not consistent with the image as well. Any help I would appreciate! Thanks
     

    Attached Files:

  5. skord61709

    skord61709

    Joined:
    Jul 13, 2018
    Posts:
    2
    Ok I just saw above same issue Thor posted and you answered. I will try that. Thanks.
     
  6. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    I'll keep looking..
    It actually already does this, the first path is the surrounding edge - and the rest of the inner paths are all handled independently (the thing thats wrong is white lines are visually confusing things)
     
  7. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    Make sure your sprite has its transform values reset, and its a square sprite.
     
  8. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    Make sure to leave some transparent pixels around the edge of your sprite.
    Also make sure the transforms are reset and it is a square image.
     
  9. rizu

    rizu

    Joined:
    Oct 8, 2013
    Posts:
    1,008
    On 2018.2, Puppet3D is spamming logs full of "MenuCommand is the only optional supported parameter." warnings. Offending scripts are at least AutoRigEditor.cs and CreateControls.cs.

    Reason is pretty obvious as you have optional parameters for MenuItems when you shouldn't. Can these be fixed for the future release so we get rid of the warnings?

    Considering you've had lots these issues for previous versions of the Puppet3D a lot too, seems weird that these still keep popping up as you surely know the cause already :) All you need to do is make another method for the menu entry if you need those optional parameters to be there.
     
    Last edited: Aug 18, 2018
  10. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,257
    Get this Error with the latest version:

    Assets/Puppet2D/Scripts/Editor/Puppet2D_FFD.cs(13,17): error CS0246: The type or namespace name `Puppet2D_FFDStoreData' could not be found. Are you missing an assembly reference?
     
  11. henkesky

    henkesky

    Joined:
    May 23, 2015
    Posts:
    36
    Hi guys, i want to know if i can transfer my 3d motion capture data(3d character animations clips) to my 2d rigged skeletal character. using 2d puppet
     
  12. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    Sometimes when you update an asset references to internal script variables lose their assignements.

    Are you able to revert back, then instead of updating P2d using the asset store, import it into another project and copy the scripts over?
     
  13. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    There isn't an out the box method.
    Theoretically you could write a script that would project the 3d skeletal positions into the 2D plane, and then you could attach the controls to these 2d moving positions. Sounds like an interesting thing to explore
     
  14. henkesky

    henkesky

    Joined:
    May 23, 2015
    Posts:
    36
    Am not really good at coding, if i request for a paid custom script, will be able to do it ?
     
  15. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    I had a quick try, the results didn't turn out too bad:



    If you email me at puppet2D@gmail.com I'll send you the package so you can try it out.

    (Not sure I have the capacity to support this for you, perhaps this will get you started though)
     
    elijahrockshout likes this.
  16. henkesky

    henkesky

    Joined:
    May 23, 2015
    Posts:
    36
    @jamieniman the video is not available anymore. I will email, so you can send it to my email
     
  17. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    sorry, just set it to be viewable
     
  18. henkesky

    henkesky

    Joined:
    May 23, 2015
    Posts:
    36
    @jamieniman tried using the AutoRig feature, but can't get my character to animate. I added my single sprite t-pose character to the scene, then used the Make 'Guide button' to move the guides and set them to correct position. Then after that, i clicked the Auto Rig button, as you did in the video, but my character still doesn't animate. The bone is actually animating, but not the the sprite.
     
  19. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    Anything you can send me to see whats going on would help me to get to the bottom of it (eg a video showing you do it, or even a package with your character before you click "Auto rig" would help)
    Just send to Puppet2D@gmail.com
     
  20. Brogan89

    Brogan89

    Joined:
    Jul 10, 2014
    Posts:
    132
    Hey just updated to 2018.3 and now getting errors due to Unity's new prefabing structure.
    upload_2018-12-15_21-48-27.png

    Is there going to be an update for this soon?
     
  21. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    Oh - yes, I'll take a look this week.
     
    jeo77 and Brogan89 like this.
  22. jeo77

    jeo77

    Joined:
    Jan 5, 2012
    Posts:
    3
    Just curious if there's any updates or thoughts on the 2018.3 compatibility. We've run into some of the same problems with the new prefab structure.
     
  23. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    On it. I've made the fix my end - just need to fully test it before releasing the update.
     
    jeo77 likes this.
  24. Ccrawler

    Ccrawler

    Joined:
    Feb 8, 2017
    Posts:
    9
    Hey! I'm using anima2D with some troubles, and I'm planning on switching to this tool, as it seems quite superior.

    Before I buy it, is it compatitble with Unity 2018.3? Also, does it support something like anima2D spring bones, for making fabric and the like? Can you swich sprites/meshes at runtime?

    Thanks!
     
  25. Brogan89

    Brogan89

    Joined:
    Jul 10, 2014
    Posts:
    132
    Its not 100% ready for 2018.3 but the dev is on it.
    Have you tried Unity's internal 2D animation tools package? Its pretty damn good.
     
    GameDevCouple_I and Ccrawler like this.
  26. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    I've submitted an update that fixes an issue with the new Prefab system in 2018.3. Hopefully it will be live soon.
    There isn't a spring bone feature currently.
    Sprites can easilly be switched.
    Meshes can be switched in a few different ways - either by skinning them to the same bones and toggling their renderers, or if they share the same UV space you can swap materials.
     
    Brogan89 and Ccrawler like this.
  27. Ccrawler

    Ccrawler

    Joined:
    Feb 8, 2017
    Posts:
    9
    Thanks a lot for your quick reply!

    I guess I can adapt the spring bone code to work with these bones, or at any rate just keep using anima2D for the fabric. Good to know meshes can be switched, that is a key feature for me.

    Will get this tool as soon as the update is live. Thanks again!

    Tried it, it's quite superior to anima2D in the rigging and skining process, but lacks some features such as the sprite/mesh switching and it's a bit green still.
     
  28. Caffeen

    Caffeen

    Joined:
    Dec 25, 2013
    Posts:
    27
    A few years back I used Puppet2D together with the Dynamic Bone asset to animate a character. I was pretty happy with the results. The animation is a simple run cycle.
     
  29. Ccrawler

    Ccrawler

    Joined:
    Feb 8, 2017
    Posts:
    9
    Looks amazing. Managed to adapt the spring bone code from anima2D to these bones, and it seem to work exactly as they did on anima2D, so I'm happy with that.

    Another question:
    Is there a quick way to edit meshes like you do in anima2D or the unity 2Danimation package? That is, change their vertices and so forth?
     
  30. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    Just to let everyone know I've release an update for Puppet2D that fixes it for the new prefab system. It also changes the way the bones are displayed - going forward you need the Puppet2D_bone component on bones. All the hidden bones can be deleted.
     
    Brogan89 likes this.
  31. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    546
    Is this safe and compatible to update the old projects?
     
  32. Brogan89

    Brogan89

    Joined:
    Jul 10, 2014
    Posts:
    132
    Thanks for the update. I did post in here the other day asking about then but then saw it so I deleted my post.
    I am concerned though that I'm sure that the migration went smoothly following the instructions in the warning. I was hoping it would be automated. Is there a reason why it wasn't automated? I created a script that helped, but there are some oddities as seen below in the elbows and chest.
    bone sizer.gif

    I used the following code

    Code (CSharp):
    1. using Puppet2D;
    2. using System.Linq;
    3. using UnityEditor;
    4. using UnityEngine;
    5.  
    6. public class Puppet2DBoneFixer : Editor
    7. {
    8.     [MenuItem("Mainframe/Puppet2D Bone Fixer")]
    9.     private static void RemoveHiddenBones()
    10.     {
    11.         var selectedObject = Selection.activeTransform.gameObject;
    12.  
    13.         // 1. remove legacy stuff
    14.         var allHiddenBones = selectedObject.GetComponentsInChildren<Puppet2D_HiddenBone>(true);
    15.         Debug.Log($"Deleting {allHiddenBones.Length} Puppet2D_HiddenBone objects");
    16.         foreach (var bone in allHiddenBones.ToArray())
    17.             DestroyImmediate(bone.gameObject);
    18.  
    19.         // 2. add Puppet2D_Bone to visible bones
    20.         var allVisible = selectedObject.GetComponentsInChildren<SpriteRenderer>()
    21.             .Where(x =>
    22.             {
    23.                 Sprite sprite = x.sprite;
    24.                 return sprite && (sprite.name == "BoneScaled" || sprite.name == "BoneNoJoint");
    25.             });
    26.  
    27.         foreach (var sprite in allVisible.ToArray())
    28.         {
    29.             if (sprite.GetComponent<Puppet2D_Bone>())
    30.                 continue;
    31.  
    32.             var newBone = sprite.gameObject.AddComponent<Puppet2D_Bone>();
    33.             newBone.Radius = 0.05f;
    34.  
    35.             // 3. remove sprite renderer
    36.             DestroyImmediate(sprite);
    37.         }
    38.     }
    39. }
    which works by selecting the root object and using the menu item. But can you confirm that the steps in the script are correct? Thanks. I really didn't want to go through dozens of bones and apply the fixes by hand.

    I also created another script to resize all the bones in unison which helps as well.

    Code (CSharp):
    1. using Puppet2D;
    2. using UnityEngine;
    3.  
    4. public class Puppet2DBoneSizer : MonoBehaviour
    5. {
    6.     [Range(0.01f, 0.1f)]
    7.     public float radius = 0.05f;
    8.  
    9.     private void OnValidate()
    10.     {
    11.         var bones = GetComponentsInChildren<Puppet2D_Bone>();
    12.         foreach (var bone in bones)
    13.             bone.Radius = radius;
    14.     }
    15. }
    Which can also be attached to root object.
     
    Last edited: Apr 2, 2019
  33. PawDragon

    PawDragon

    Joined:
    Dec 12, 2016
    Posts:
    2
    I have a problem after updating to the new version.

    After updating, some errors were shown in Unity's Console window.
    those messages said i have to take some actions.

    As the messagea,
    I removed SpriteRenderer and added Puppet2d_Bone component in Bones.
    I also removed all hidden_bones.
    After all, I selected the bones and converted sprite.
    When I clicked the 'Bind Smooth Skin' button, the progress is freezed in 'Setting Outside Voxel Weight'.


    OutOfMemoryException: Out of memory
    System.Collections.Generic.Queue`1[T].SetCapacity (System.Int32 capacity) (at <3845a180c26b4889bc2d47593a665814>:0)
    System.Collections.Generic.Queue`1[T].Enqueue (T item) (at <3845a180c26b4889bc2d47593a665814>:0)
    Puppet2D.Puppet2D_Skinning.GeosedicSkinWeights (UnityEngine.GameObject mesh, System.Collections.Generic.List`1[T] selectedBones) (at Assets/Puppet2D/Scripts/Editor/Puppet2D_Skinning.cs:1228)
    Puppet2D.Puppet2D_Skinning.BindSmoothSkin (System.Int32 isGeosedic) (at Assets/Puppet2D/Scripts/Editor/Puppet2D_Skinning.cs:374)
    Puppet2D.Puppet2D_Editor.OnGUI () (at Assets/Puppet2D/Scripts/Editor/Puppet2D_Editor.cs:428)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:310)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean customBorder, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:361)
    UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:320)
    UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:266)
    UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:438)
    UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:421)
    UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:401)
    UnityEngine.Experimental.UIElements.EventDispatcher.ProcessEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:511)
    UnityEngine.Experimental.UIElements.EventDispatcher.Dispatch (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:307)
    UnityEngine.Experimental.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.Experimental.UIElements.EventBase e, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:176)
    UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:245)
    UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:68)
    UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
     
  34. SaltwaterAssemnly

    SaltwaterAssemnly

    Joined:
    Mar 8, 2016
    Posts:
    80
    Hi. Purchased this today and after importing the plug-in and checking out the tutorial, we noticed the bone and control layers and scale box in our Puppet2D window s different from the documents in that it's missing the circle (bone) layer assignment.

    Also, in the editor window, we can't adjust the size of the control gizmo by entering in a number, and sliding the value doesn't always work.

    When we go to make a spline, we don't see the gizmo handles for the spline and bones until we finish spline.

    We followed your tutorial (one with the croc) precisely to our own sprite and when we finished the Create FTD and tried to demonstrate the sprite/mesh moving etc with the controls/bones as in your demo, nothing happened. Why?

    Overall seems quite broken at the moment and would like your advice or quick fix please.

    We've redownloaded and reimported twice with the same results.

    We're using Unity Ver 2018.3.0f2
     
    Last edited: Apr 12, 2019
  35. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    The controls should be made visible with the slider in the Puppet2D window. The bones have changed very recently. You can now resize each of the bones individually or together by changing the radius in the inspector. Just search for Puppet2d_bone in the hierarchy and select them all and change in the inspector.

    Are you seeing the controls?
    It won't move with the bones until you skin the FFD controls to the bones. Have you done that step?
     
  36. SaltwaterAssemnly

    SaltwaterAssemnly

    Joined:
    Mar 8, 2016
    Posts:
    80
    This is what we see in the inspector (see screenshot attached)



    OK - so we have to extend all bones and their children to select them all to make it work. Is there a faster way where there are a lot of bones/children of bones (where we can just select the parent of bones and it selects all children)?
     

    Attached Files:

  37. Emphy

    Emphy

    Joined:
    Feb 7, 2014
    Posts:
    9
    Will this soon work with Unity 2019? Bought it just yet but all I'm getting is weird behaviour and errors...

    Things like "'EventType.keyDown' is obsolete"
     
  38. jamieniman

    jamieniman

    Joined:
    Jan 7, 2013
    Posts:
    760
    Did you let Unity do the upgrade? Try right clicking on the Puppet2D folder and clicking reimport, then saying yes to let it upgrade.
    (It should, for example, have changed it to uppercase KeyDown) https://docs.unity3d.com/ScriptReference/EventType.KeyDown.html