• Editor
  • Linked meshes and an empty skin

I'm trying to setup a avatar system.

Many of the meshes in my rig are linked to various other meshes. I would like to have all my original meshes in one place: like a skin called "Meshes". But this skin would be empty. I can set the meshes not to export, but not the skin. Unity sees that the skin is missing and errors when I try to import.

Is there a workaround besides spreading my many original meshes throughout my many gameplay skins?

Spine is the best. I can't wait for 3.7. Thank you for your time.

Related Discussions
...
  • Modificato

Hi Toby, so you're saying:

  • you have a lot of skins in your skeleton
  • you currently have the source of a linked mesh in a skin, and the source of another linked mesh instead of the same skin, in a different skin as well, etc.

But are you deleting some skins on export? Why would the skin be missing otherwise? Why do you set the mesh so that they won't export? isn't it enough to simply not use the skin where all the linked mesh sources are?

Thanks for the quick reply.

All the mesh sources are in 1 skin, so I can easily keep track of them all. This Meshes skin serves no purpose in game, so exporting it with textures would cost memory. All my skins are grouped neatly in folders. But there is no Meshes folder because it has no textures.

Thanks again!

Btw This forum is better than stackoverflow, the cocos2dx forums and the maya forums combined. Thanks for all the work you guys put in.

You need to export the source mesh attachments because the linked meshes use them. The source meshes should export (with a warning) even if Export is unchecked (we'll ensure this is so). If you don't have images for the source meshes, at runtime it tries to find a texture region for them in the atlas and fails. You can either customize the AttachmentLoader, or set the Path for your source meshes to any image already in your project, just so a texture region is found at runtime.

To clarify:

  1. You're making an avatar system.
  2. You're using meshes for various skins.
  3. To share the animations, you are using linked meshes.
  4. You want to put the source meshes of those linked meshes into one skin (let's call it "meshes") so you can animate them in one place.
  5. You want to export this skeleton and atlas without exporting the images used by the source meshes.
    Is that correct?

If so.
The system works such that when meshes are linked, they get their animation, shape and weights from the source meshes. So they do need to be exported for linked meshes to work.
And when exporting them, I guess Spine will also count the images backing them as something you need, so it will export them too.
(I think Nate is adding this warning in a future update for clarity, and some better handling).

Personally, I think your workflow is very ideal and I hope we can properly support it, or something like it soon.

For now, the best workaround may be to use the backing images/path to images you are actually using, instead the images you don't want to include.

Pharan ha scritto

And when exporting them, I guess Spine will also count the images backing them as something you need, so it will export them too.

Note when talking about exporting images, you're talking about texture atlas packing, not JSON data. There's 2 ways to do packing. If packing during skeleton data export, then yes, Spine assumes the source mesh image is needed and puts it in the atlas. If using the Spine Texture Packer separately, you could put the source images in a folder with a pack.json with ignore: true and the images won't be packed.

Pharan ha scritto

(I think Nate is adding this warning in a future update for clarity, and some better handling)

The new warning is when you uncheck Export on a mesh that has linked meshes. The source mesh is required, so the mesh will be exported despite the Export checkbox being unchecked and you'll see a warning.

Excellent, glad to hear it. Yes I saw the 2 ways to pack, I really appreciate the flexibility throughout all of Spine! I'm packing seperately.

So, until I can look into a 'pack.json' with 'ignore ' true' i'll just make new silhouette mesh sprites. Part of this is that I don't want animators on the project to misunderstand why this extra, unused skin is in the rig. I want them to ignore it but still be setup clearly and cleanly.

This is a pretty good workaround for now. Thank you.

You could name the skin "source meshes dont delete" or something. :p
Comments and Annotations in various places in the skeleton format is still a planned feature. 🙂

un mese dopo

Ok, so it's hacky but we're getting close to a workaround...

I'm creating a 1x1 pixel texture to populate all the meshes in the 'Meshes' skin. For each skin export I'm deleting all skins except the skin to export and Meshes, then exporting with atlas.

Unfortunately I've got to do that for each skin (will be dozens eventually) but it will work with minimal extra work and memory; and without engineers spending time modifying the runtime!


Ok it's less ideal than I thought...

I often need to modify a mesh I'm using, like a reset kind of modification. But resetting a mesh crunches the mesh down around the 1x1 pixel. Even when I swap back to a correctly sized sprite for the mesh it collapses down to 1x1.

So I can't reset the mesh after using this workaround?

Also getting the occasional crash while trying to edit the mesh.

Ok I found the bit I missed: "If the image was made smaller by trimming, so the image contents are the same size but the image dimensions are now smaller, then the scaled down UVs may not be desirable. Spine currently doesn't have a way to scale the UVs, so the mesh will have to be recreated."

This kinda put me back to where I was. I have to create a big 'blank' sprite for each mesh and export those as part of every skin, effectively adding 50% more texture to the already quickly growing mip-mapped tatlases.

I'll try the ignore = true thing.

Update 4/18:

So I put a pack.json file that was saved from the export settings into my Meshes folder. It has 1 line between the braces "ignore: true". But images in the Meshes folder are still showing up in the texture atlas when I export from Spine. I can only guess the folder settings are being overridden, but that folder has no children folders. Could something else be overriding it?

Also, let's say I have a platformer game with many levels and many enemies. Let's say the enemies are all re-skins and each level introduces a new enemy (new skin). As far as I can tell, I have to either load ALL skins for every single level or export each skin as its own skeleton. Either way there's a bunch or redundant data loaded when playing the game. Is this right?

Thank you very much for your time!