• EditorBugs
  • Meshes having weight and bones added to skin distort when importing data.

Problem statement

I'm frequently using [Import Data] to combine 2 files into one.
Both files has meshed, weight, skins set up. Some skins have bones that are using [Add to skin] function, so they are only active when the skin using those bones are active.
Everytime I imported one file into another, these skin's meshs are distorted.

It's a bit like this issue in 4.1 version
The differences happened to me in 4.2 when importing are:

  1. Meshes won't collapse into point as 4.1. Only distortion.
  2. If I remove the bones from the skin, the mesh becomes fine. If I add them back, it distorts again.
  3. I have skins that doesn't have any bones added to it (which means they are always active no matter the skin is active or not.) These skin's meshes are fine.
  4. If I bind bones to meshes and add bones to the skin but don't paint weight to those vertexs (keeping all vertexs with 100% weight as first bone in binded.) These skin's meshes are fine too.

According to my understanding, meshes that contains "weight" and "add to skin" seems to have the problem when importing. It would be great if this problem can be solved while importing data.

Repro steps:

  1. Prepare 2 project files. (A will be imported to B)
  2. Setup meshes, bind bones, add bones to skin. (In both files.)
  3. Export A.json.
  4. Import A.json into project B. Select [Import into an existing skeleton.] (Don't replace.)
  5. Check out the imported mesh.

My screen shots:
Project A (Exported as A,json.)

Project B with A imported. Mesh from A.json is distorted.

Editor information

Tell us your Spine Editor version.
4.2.35

    Related Discussions
    ...

    The issue you're experiencing with importing data and having meshes distort when using the "Add to skin" function is indeed similar to the problem described in the Importing weighted meshes issue for version 4.1.

    From the provided contexts, it appears that this issue has been acknowledged and fixed in version 4.2.10-beta. Here are some steps you can take to address the problem:

    1. Update to the Latest Version: Ensure you are using the latest version of Spine, as the bug has been fixed in 4.2.10-beta. You mentioned using version 4.2.35, which should include the fix, but double-checking for any updates might help.

    2. Check Skin Bones: Ensure that the skin bones are set correctly. If the skin bones are not set properly, the vertices of the mesh might move to incorrect coordinates, causing distortion. Refer to the Attachment warnings section of the User Guide for more details.

    3. Re-export and Re-import: Sometimes re-exporting the JSON file and re-importing it can resolve issues. Make sure to follow the correct steps for exporting and importing data.

    4. Simplify the Setup: As a temporary workaround, you can try simplifying the setup by avoiding the use of "Add to skin" for bones that are causing issues. Instead, keep all vertices with 100% weight to the first bone in the binded setup.

    If the problem persists, it might be helpful to provide detailed steps and project files to the support team for further investigation.

    FYI:
    Selecting [Import into an existing skeleton.] + [Replace existing attachments] will 100% cause this distortion problem. If I don't replace the existing attachments while importing, only the imported part will be distorted.

    And I don't see any warning marks on an attachment's tree icon.

    XII You have written a procedure to reproduce the problem, but unfortunately it is difficult to reproduce the problem without the actual project, since your Spine project is quite complex.
    In any case, we are aware that there are several cases in Spine where it is currently difficult to merge different skeletons into a single skeleton. We have an issue ticket here to improve this:
    EsotericSoftware/spine-editor582

    Importing into an existing skeleton is primarily intended for importing data from scripts. If you need to work on one skeleton separately from another, you should only make changes to the animations, not the rig.

    OK!
    It will be very convenient if rigging can be successfully moved accross skeletons but I also understand that there will be lots of technical difficulties doing this. It is already smooth enough when working on skeletons and animations in Spine which I appreciate a lot.
    Thanks for the reply and the information about this issue ticket.

    I will just avoid making changes to the rigs when importing skeletons to prevent my meshes distort. 🙂