• International中文
  • 在同时存在多个皮肤的情况下,导出json文件的时候如何只导出其中一个皮肤

  • Düzenlendi

我在spine文件中做了很多个皮肤

但是当我导出json文件的时候,只能全部皮肤一起导出一份,不能每一个单独淡出一份

比如说,我想单独导出clothes_001这个皮肤的png,atlas和json文件,就只能把除了clothes_001这个皮肤以外的皮肤都删掉,再选择导出,如果不这样做,我导出来的png就会包含有所有皮肤的内容

请问有没有便捷一些的方式,让我在导出json的时候可以选择只导出其中一个皮肤

    Related Discussions
    ...

    Kyle When exporting skeleton data, it is expected that the information for all skins for which the export option is checked will be included in a single skeleton data file. This is because skins are a feature designed to change the appearance of a skeleton while using a single skeleton, rather than splitting it into several separate skeletons. Therefore, exporting skeleton data for each skin sounds like a useless thing to do.

    If you could explain why you want to do such exports, we might be able to advise you on how to better manage your skeletons.

    • Kyle bunu yanıtladı.

      Misaki 你好Misaki,我理解你说的内容,我打算更换另一种方式去做,目前遇的情况是:我为一个人物做了多个动画,但没有做皮肤,当我导出json的时候,会把所有动画和人物用到的插槽下的所有素材放进一个png文件,请问是否有其他方法可以把每个插槽下的素材都单独导出为一张png,也就是说,我导出json文件后,可以得到一个json文件,一个atlas文件和多个png文件?

        Kyle

        If you want a single JSON file, a single atlas, but multiple PNGs, you might want to consider the "Image Folder" option for the Texture Packer as shown in the screenshot below:

        When that option is selected, the texture packer will behave as described in the "Folder structure" section of the Texture packing guide.
        As you can read from the guide, the texture packer will create an atlas for each subfolder, rather than packing all attachments in a single atlas.
        This implies that you should reorganize your images into separate folders and update your attachments accordingly (you can rename attachments quickly with a combination of the find and replace tool and regular expressions).

        You can also run the texture packer separately,, or using it through the Spine CLI.

          Davide 感谢你详细的回复,按照你说的方法导出来后,我确实可以导出多个图集,而不是将所有附件打包在一个图集中,但我发现另一个问题,就是一个图集里面还是有多个附件,就像下面这张图:

          这个图集把一套衣服的所有部位都放进去了,实际上我是想把这套衣服的每个部位都单独放出来作为一个png,请问是否有方法可以实现呢?

            Kyle You can simply create a folder for each image you want to pack separately. Or, is there a reason you don't want to use a folder?

            • Kyle bunu yanıtladı.

              Misaki 明白您说的,但我目前有非常多的图像,几百上千个,如果要为每个图像都创建一个文件夹,那将会非常繁琐并且不方便,所以请问是否还有其他方法呢?

              We don't currently have a way to pack each skin into a separate atlas. We have an issue to track the enhancement:
              EsotericSoftware/spine-editor720
              You can subscribe to the issue to be notified when the status changes.

              If we had that feature, it would only help if you always want one atlas per skin. It would not be sufficient if you want multiple skins in one atlas.

              The most flexible solution is to write a script to copy your images into a temporary folder so you can pack them like you want. For example, copy all the images you want in a single atlas to a folder, then pack them. By using a convention to organize your images and then writing a script, this can scale to any number of images.

              A similar solution could be to parse the skeleton JSON data to get all the image paths for each skin. Then you can copy them to a folder and pack them. This has the added benefit that you could write application specific logic, like combining multiple skins into a single atlas.