• Runtimes
  • Spine JSON Mesh Attachment Attribute Clarifications

Does the order of triangles, triplets of vertices, matter? Does the clockwise rotation matter as well?

Related Discussions
...

@SilverStraw It depends on the runtime. Which runtime are you using?

In general: yes, the mesh is populated accordingly, some runtimes change the winding order to ensure all triangles have uniform winding (e.g. all CCW). Some runtimes rely on disabling backface culling in shaders, such as spine-unity for example, there the winding order is preserved as loaded from the .json file.

    The Spine editor does the triangulation (stored in the Spine data) so runtimes don't have to. The triangle order does matter: Spine sorts triangles based on the order of bone weights and that can be important when a mesh overlaps itself:
    http://esotericsoftware.com/spine-weights#Triangle-order

    Mesh vertices (and other vertex attachments, like clipping or bounding boxes) in Spine data are clockwise by default, but vertices can be moved in Spine in such a way that makes the winding counterclockwise (eg scale the attachment -1 on X or Y). Attachments defined in old versions of Spine may have used a counterclockwise default (and that winding remains even when saved with newer versions). Runtimes can make the winding order consistent, but this may not be desired if backface culling is on.

    The order of path vertices is different from other vertex attachments, it determines the start and end of the path.

    Harald I am using Spine Web-GL but I want the runtime export the JSON to be imported into the Spine Editor.

    I have a stupid idea, if it doesn't work, but brilliant idea if it does work. It's too early to tell until I have a test example ready. So far I think need to have a list of other API vertices, Spine vertices, and associate both set of vertices.

    • Harald ha risposto a questo messaggio

      SilverStraw Ok. Good luck with implementing your idea then! Curious what it will be, in case it turns out to work as desired. 🙂