• EditorBugs
  • Using pack problem

@semgilo Thanks for posting the question again on the forum.
(Remark: this question was originally posted as a github issue ticket here:
EsotericSoftware/spine-runtimesissues/2456#issuecomment-1924255239)

Please note that you can also post in Chinese if you are more comfortable with that, as this forum provides a translate button which translates any posting into the viewer's language.

Please note that when using packing mode "packing": "polygons" it requires the Spine project for proper packing, as documented here as follows:
" 打包矩形或多边形。打包多边形效率更高,但速度较慢,并且需要了解项目文件的上下文。"

The Current Project option in the texture packer pack options are described here:
http://zh.esotericsoftware.com/spine-texture-packer#%E5%BD%93%E5%89%8D%E9%A1%B9%E7%9B%AE

When using the command line interface and running the packer only, you can specify the path to the project project via -j or --project.
http://esotericsoftware.com/spine-command-line-interface#Pack
This posting here on the forum provides more info on that:
https://esotericsoftware.com/forum/d/16927-export-multiple-texture-files/3

    Please make it clear: what you tried, what is the expected behavior, and what you got instead.

      Nate Thanks for replying.

      What I have tried:

      我切换到工程目录,然后使用命令行导出,具体如下:
      /Applications/Spine.app/Contents/MacOS/Spine -u "Spine 4.1.17 Enterprise" -i images -o ./pack -n spineboy-ess -p ./pack.json -j . -e ./export.json
      export.json
      {
      "class": "export-binary",
      "extension": ".skel.bytes",
      "nonessential": true,
      "cleanUp": true,
      "packAtlas": {
      "stripWhitespaceX": true,
      "stripWhitespaceY": true,
      "rotation": true,
      "alias": true,
      "ignoreBlankImages": false,
      "alphaThreshold": 3,
      "minWidth": 16,
      "minHeight": 16,
      "maxWidth": 2048,
      "maxHeight": 2048,
      "pot": true,
      "multipleOfFour": false,
      "square": false,
      "outputFormat": "png",
      "jpegQuality": 0.9,
      "premultiplyAlpha": true,
      "bleed": false,
      "scale": [ 0.5 ],
      "scaleSuffix": [ "" ],
      "scaleResampling": [ "bicubic" ],
      "paddingX": 2,
      "paddingY": 2,
      "edgePadding": true,
      "duplicatePadding": false,
      "filterMin": "Linear",
      "filterMag": "Linear",
      "wrapX": "ClampToEdge",
      "wrapY": "ClampToEdge",
      "format": "RGBA8888",
      "atlasExtension": ".atlas.txt",
      "combineSubdirectories": true,
      "flattenPaths": false,
      "useIndexes": false,
      "debug": false,
      "fast": false,
      "limitMemory": true,
      "currentProject": true,
      "packing": "polygons",
      "prettyPrint": false,
      "legacyOutput": false,
      "webp": null,
      "bleedIterations": 2,
      "ignore": false,
      "separator": "_",
      "silent": false
      },
      "packSource": "attachments",
      "packTarget": "perskeleton",
      "warnings": true,
      "output": "/Users/ruandh/Downloads/spineboy/export",
      "input": "/Users/ruandh/Downloads/spineboy/spineboy-ess.spine",
      "open": false
      }

      pack.json
      {
      "stripWhitespaceX": true,
      "stripWhitespaceY": true,
      "rotation": true,
      "alias": true,
      "ignoreBlankImages": false,
      "alphaThreshold": 3,
      "minWidth": 16,
      "minHeight": 16,
      "maxWidth": 2048,
      "maxHeight": 2048,
      "pot": true,
      "multipleOfFour": false,
      "square": false,
      "outputFormat": "png",
      "jpegQuality": 0.9,
      "premultiplyAlpha": true,
      "bleed": false,
      "scale": [ 0.5 ],
      "scaleSuffix": [ "" ],
      "scaleResampling": [ "bicubic" ],
      "paddingX": 2,
      "paddingY": 2,
      "edgePadding": true,
      "duplicatePadding": false,
      "filterMin": "Linear",
      "filterMag": "Linear",
      "wrapX": "ClampToEdge",
      "wrapY": "ClampToEdge",
      "format": "RGBA8888",
      "atlasExtension": ".atlas.txt",
      "combineSubdirectories": true,
      "flattenPaths": false,
      "useIndexes": false,
      "debug": false,
      "fast": false,
      "limitMemory": true,
      "currentProject": true,
      "packing": "polygons",
      "prettyPrint": false,
      "legacyOutput": false,
      "webp": null,
      "bleedIterations": 2,
      "ignore": false,
      "separator": "_",
      "silent": false
      }

      What I expect?

      我希望导出的Altas和打包的Altas里面的Attachment带Mesh在Atlas的bounds是一样的,这样在游戏里面就可以正常显示,如果不是则显示会像上面图片一样

        Harald Thank you very much, I will carefully review the content you mentioned. I indeed need to improve my English.

        Nate 我也尝试使用可视化界面的Pack功能参数如下:

        semgilo /Applications/Spine.app/Contents/MacOS/Spine -u "Spine 4.1.17 Enterprise" -i images -o ./pack -n spineboy-ess -p ./pack.json -j . -e ./export.json

        This looks wrong, -j . specifies the path to a directory, but you should enter a path to the project file, e.g. ./yourproject.spine

          Harald 我之前有尝试过,我现在又试了一次结果也是一样
          /Applications/Spine.app/Contents/MacOS/Spine -u "Spine 4.1.17 Enterprise" -i images -o ./pack -n spineboy-ess -p ./pack.json -j ./spineboy-ess.spine

            semgilo -u "Spine 4.1.17 Enterprise"

            The parameter of the -u option is wrong, it should be only "4.1.17" not "Spine 4.1.17 Enterprise".

            "$SPINE_EXE" -u "4.1.17" -i images -o ./pack -n spineboy-ess -p ./pack.json -j ./spineboy-ess.spine

            @semgilo After correcting the above parameter, unfortunately I could not reproduce any issue with your above pack.json and export.json files. When exporting the binary skeleton without an atlas and separately exporting the atlas using the pack.json file, then placing all separately exported assets in the same directory in Unity, everything was imported correctly. Nothing displayed incorrectly. What exact steps did you perform that led to your problem?

              By the way, you can use three backticks "```" around code for a multi-line block of code, as your above posting looks as if every single line was enclosed with single backticks "`".

              @semgilo Thinking about your screenshot: did you perhaps not copy both the spineboy.atlas.txt and spineboy.png atlas texture over together? Please note that the atlas textures and the atlas.txt file are an inseparable pair.

                Harald
                关键的一步是这个,在透明框上Mesh区域,并不会报错,是表现异常

                用到下面的图片

                Harald
                我可以确定我是放在一起的,我做了很多实验,一开始是在我们的工程,后面就直接在示例工程,我可以还原出问题

                "$SPINE_EXE" -u "4.1.17" -i images -o ./pack -n spineboy-ess -p ./pack.json -j ./spineboy-ess.spine

                不幸地是问题还在,你有尝试在里面添加对应的Attachment,然后是Mesh类型的,Mesh框起来一大块透明区域,这个是问题的关键所在

                Spine's CLI parameters are configuration, then an action. You can have multiple actions:

                [config for action] [action] [config for action] [action]

                Your command line is:

                 -i images -o ./pack -n spineboy-ess -p ./pack.json -j ./spineboy-ess.spine

                The first action is that you pack:

                -i images -o ./pack -n spineboy-ess -p ./pack.json

                Then you specify -j, which is short for --project and gives the packer context so it can pack meshes intelligently. However, there is no action after the configuration:

                -j ./spineboy-ess.spine

                If you want the project context for your packing, it must come before the pack action -p:

                -i images -o ./pack -n spineboy-ess -j ./spineboy-ess.spine -p ./pack.json

                  @Harald Nate 非常感谢,现在可以正常工作了,是这个顺序的问题。