• Runtimes
  • Skinning information in JSON

  • Editado
Related Discussions
...

Hello, we are improving our runtime to support the skinning feature, but I can't figure out where on the JSON this information is, I mean, when we export an skeleton with meshes that have weights in it's vertices, the only difference I see with a regular mesh is that the type says: "skinnedmesh" instead of "mesh", but the data is the same, plus "a wild attribute appeared" called hull, that is only a number and i don't know what it is for.

We have GPU FFD working smoothly on our runtime, maybe we forgot something with the "hull" attribute, but it works, so I'm sure we can reach skinning too (GPU skinning of course), we only need some hints about the new JSON format.

Thanks.

  • Editado

Hull is used by the editor. It's not necessary for rendering with a standard graphics library.
Though it's sometimes useful for people who want to make a physics polygon collider based on the vertices of a mesh.

The vertices array is arranged so that the first n value pairs defines the hull of the mesh, where n is the value stored as hull.

Which framework were you using again? libGDX?

Thanks for the response, we use our own C++ / OpenGL engine, as well as our own Spine runtime. For now, I'm totally lost about how the skinning information is stored in the JSON file, I think that's all I need to know to start with the implementation.

I'm away from the computer at the moment, but I can say the vertices are different for a mesh versus a skinned mesh. See how SkeletonJson and SkinnedMeshAttachment use the data. I can give more information later today or tomorrow.

Thanks Nate, as far as I understand:

vertex with 1 weight
[ 1, 28, 85.33, -49.59, 1 ]
num_bones, id_bone, pos_x, pos_y, weight

vertex with 2 weights
[2, 14, 13.02, -8.66, 0.28761, 19, 0.9, -8.62, 0.71238]
num_bones, id_bone, pos_x, pos_y, weight, id_bone, pos_x, pos_y, weight

Why I have one position for each bone? I mean, in a regular mesh the position is relative to the center (pivot) of the mesh right? why we have a relative (I suppose is relative) position for each bone? I would like to have the vertex position relative to it's mesh (as we have in regular meshes), I imagine I can get it from bone_position + vertex_bone_relative_position or something like that. I will look further in SkeletonJson and SkinnedMeshAttachment to understand that.

I mean, in a regular mesh the position is relative to the center (pivot) of the mesh right?

In an unskinned mesh each vertex is described in the bone's coordinate system. In a skinned mesh each vertex is described in the bone's coordinate system for each bone that influences it. This is how skinning works and is called the "bind pose". Try this page:
http://graphics.ucsd.edu/courses/cse169_w05/3-Skin.htm