我用spine导出的文件(atals、png、json),重新导入到一个空spine工程中,在这个工程中使用纹理打包器,对一个文件夹下的纹理进行打包,发现打包后的图集多边形策略没有生效(我查看的我的纹理打包设置,也勾选了当前项目)。
但我尝试在重新导入的工程中使用导出时,多边形策略是生效的。
所以,我是否可以认为单独的纹理打包器不会对多边形生效,只有导出工程才生效
关于纹理打包器,多变形的问题
使用多边形打包策略时,需要在Spine项目中进行正确的打包。根据提供的上下文信息,单独使用纹理打包器可能无法实现多边形打包策略的效果,只有在导出项目时才能生效。这是因为多边形打包需要了解项目文件的上下文信息。
我明白多边形策略需要结合项目上下文。只是官方文档说的看起来好像单独使用纹理打包器是支持多边形的.
- 使用spine编辑器:纹理打包器 - 纹理打包器设置界面 - 勾选了当前项目。这个勾选看起来就像是使用当前项目的上下文,那就应该是可以支持多边形的。
- 官方命令行说明:
纹理图集打包:
-i, --input 要打包的图片文件夹的路径。
-o, --output 写入纹理图集和PNG文件的路径。
-j, --project 确定网格使用哪些图片的项目路径。
-n, --name 纹理图集名称,图集和PNG文件的前缀。
-p, --pack 纹理图集名称或打包设置JSON文件的路径。
我也指定了-j 项目***.spine , 导出结果多边形也不生效
所以,我是否可以理解,虽然相关设置项或命令行都关联的项目,但单独的纹理打包器就是不支持多边形
caochangli Based on my testing with Spineboy in Spine 4.3-beta, packing via the CLI correctly referenced the mesh polygons. However, the results were different when packing the texture in the editor versus packing it via the CLI. I suspect this discrepancy is causing the polygons to appear unreferenced. For reference, my test results are as follows:
Packing via the Spine Editor GUI:
Packing via CLI:
The difference may be difficult to see, but in both the upper and lower results, you can see that the other images are positioned right on the edges of the gun and board. This is the result of referencing polygons. If the parameter -j
for specifying the project is omitted, the following results will be obtained:
Without seeing the actual files, we can only speculate why you cannot obtain the desired pack result. Please send the files to us via email so we can check what the problem is. Please send them to us via email so we can check what the problem is: contact@esotericsoftware.com.
Include the URL of this forum thread in the email so we know the context. Then, we can take a look at what's wrong.
caochangli Thank you for providing your Spine project files!
I tried three methods using Spine 4.0.56: packing during data export, packing with the texture packer launched separately, and packing via CLI. All three methods produced the same result, and it appeared that the polygons were being referenced for packing.
Therefore, we need to see the results of your packing. Could you send us the images?
caochangli Sorry for the delay in responding! The additional email you sent indicated the cause.
When you separately used the texture packer, you specified the path to the subfolder. This caused a mismatch between the paths of each mesh attachment owned by the skeleton and the image paths, making it impossible to pack the polygons referenced by each mesh attachment.
For example, suppose you specified a subfolder named 1
to pack textures. In this case, the path of the image ren43.png
in the 1
folder will become ren43.png
. However, the path of the image located in the project will be 1/ren43.png
. This discrepancy causes the polygons to be unreferenced.
I'm not sure if you need to pack the textures for each subfolder. If so, please change the image path first. Then, pack them.