kamend

  • 28 sept. 2014
  • Inscrit 2 mai 2014
  • Great, thanks for the quick reaction!

  • Hi,
    I have updated to the latest C# and Unity runtimes and I have some really weird loop issues. I setup my states through..
    state.SetAnimation and state.AddAnimation. And for some reason SetAnimation does not respect the loop options I give it, I think the loop in the Inspector of the SkeletonAnimation is overwriting it in some weird way. Does anybody have the same problem?

    I am also exporting from the latest 2.0.15 version of Spine.

    Kamen


    Here is an example, if I set this script but I have loop set to false in the Inspector. The animation won't loop, even though I give it a loop true state.

    public class TempScript : MonoBehaviour {
    
       private SkeletonAnimation skeleton;
    
       void Awake() {
          skeleton = GetComponent<SkeletonAnimation>();
       }
    
       // Use this for initialization
       void Start () {
          skeleton.state.SetAnimation(0, "animation", true);
       }
       
    // Update is called once per frame void Update () {
    } }
  • Great, works now! Thank you.

  • I have sent you an e-mail with the project attached.

  • I have the latest version, tried exporting both in Animated mode and Setup, same result. It's animating the wrong vertices.

  • Yes, when I disabled the stripping, the Mesh aligned with the texture, but for some reason, the animation is still wrong, some of the vertices I animated in Spine are not moving at all. Seems like a weight problem.

    Kamen


    Something weird I noticed in the exported Skeleton JSON is that the number of vertices in the FFD animation section does not equal to the numbers in skins section.

    {
    "bones": [
       { "name": "root" }
    ],
    "slots": [
       { "name": "Circle", "bone": "root", "attachment": "Circle" }
    ],
    "skins": {
       "default": {
          "Circle": {
             "Circle": {
                "type": "mesh",
                "uvs": [ 1, 1, 0, 1, 0, 0, 1, 0, 0.23828, 0.76757, 0.16601, 0.68945, 0.13671, 0.58593, 0.13671, 0.45703, 0.16796, 0.36914, 0.4082, 0.81445, 0.73632, 0.7539, 0.8457, 0.60351, 0.83789, 0.3164, 0.7246, 0.1914, 0.53906, 0.125, 0.41992, 0.13281, 0.33203, 0.16601, 0.24218, 0.24023 ],
                "triangles": [ 0, 1, 9, 1, 4, 9, 9, 10, 0, 10, 11, 0, 11, 3, 0, 1, 5, 4, 1, 6, 5, 1, 7, 6, 7, 1, 2, 10, 9, 8, 14, 10, 8, 11, 10, 14, 17, 14, 8, 15, 14, 17, 17, 16, 15, 9, 4, 6, 9, 7, 8, 11, 13, 12, 13, 11, 14, 4, 5, 6, 11, 12, 3, 9, 6, 7, 7, 2, 8, 8, 2, 17, 12, 13, 3, 17, 2, 16, 13, 14, 3, 16, 2, 15, 15, 2, 14, 14, 2, 3 ],
                "vertices": [ 249.34, -274.82, -262.32, -262.84, -250.34, 248.82, 261.32, 236.84, -137.61, -146.77, -173.65, -105.93, -187.4, -52.61, -185.86, 13.33, -168.82, 57.93, -51.23, -172.79, 117.37, -145.74, 175.14, -70.1, 174.58, 76.89, 118.12, 142.2, 23.97, 178.4, -37.07, 175.83, -82.44, 159.89, -129.3, 123 ]
             }
          }
       }
    },
    "animations": {
       "animation": {
          "ffd": {
             "default": {
                "Circle": {
                   "Circle": [
                      { "time": 0 },
                      {
                         "time": 0.8333,
                         "offset": 8,
                         "vertices": [ -39.01, -43.34, -65.02, -40.45, -46.23, -8.66, -34.68, 5.78, -24.56, 5.77, -18.78, -36.12, 0, 0, 28.9, -2.88, 40.46, 0, 33.23, 24.56, 0, 23.11 ]
                      },
                      { "time": 1.3333 }
                   ]
                }
             }
          }
       }
    }
    }

    May be some error during the export?

  • Hey Nate,
    I have a problem with FFD and Unity, for some reason, the Mesh animation I do in Spine, comes different inside Unity. I noticed that the mesh inside Unity is a little bit different that the one in Spine or at least there is some problem with the size of the texture. I think inside Unity the mesh is not with the correct UV coordinates.

    I am attaching screenshots from Spine and Unity:

    May be I am doing something wrong?

    Thanks!