我刚开始使用spine-unity,这个问题困扰了我大概三周了。
我将spine文件导出为json,产生了.png/,json/.atlas.txt,这三个文件。
把他们拖入unity之后(已经检查并安装了正确的spine-unity插件),会产生如下6个文件

当我把Skeleton Data Asset文件拖进scene窗口,选择skeletonAnimation后

并没有如我在教程视频中看到的那样出现我的动画文件,而是只有一个灰色的圆点

同时在console窗口有如下报错
Problematic material setup at Spine GameObject (door):
Warning: Premultiply-alpha atlas textures not supported in Linear color space!You can use a straight alpha texture with 'PMA Vertex Color' by choosing blend mode 'PMA Vertex, Straight Texture'.

If you have a PMA Texture, please
a) re-export atlas as straight alpha texture with 'premultiply alpha' unchecked
(if you have already done this, please set the 'Straight Alpha Texture' Material parameter to 'true') or
b) switch to Gamma color space via
Project Settings - Player - Other Settings - Color Space.
在inspector窗口有如下报错

但是即便我按照错误提示在spine导出时不勾选预乘Alpha,或者更换色彩空间至伽马色彩空间,也都无法解决这个问题

这个问题真的非常困扰我,我搜索了很多答案都无法解决,想问一下有没有什么办法

Related Discussions
...

@NikoNiko Sorry to hear you're having troubles. There seem to be a few issues occurring at the same time.

1) If you just see a bone (grey circle) without any attachment rendered, this has nothing to do with PMA vs. Straight Alpha workflow. If PMA vs Straight Alpha settings are incorrect, you just receive black or light outlines around attachments, you still could see most of your skeleton correctly. Since you see nothing at all: do you see the skeleton displayed correctly in the SkeletonDataAsset Preview? Perhaps your default skin has no attachments, then you need to switch Skin to your respective skin that has the attachment enabled. Or you have an animation enabled which has all attachments hidden (that is unlikely however).

Could you please share your problematic exported skeleton assets? You can either attach them to a forum posting or send them to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context.

2) Regarding PMA vs. Straight Alpha: You can find the in-depth documentation here, with all settings shown:
https://zh.esotericsoftware.com/spine-unity#%E9%AB%98%E7%BA%A7---Premultiplied-%E5%92%8C-Straight-Alpha-%E5%AF%BC%E5%85%A5
If you are using Linear color space in your project, you have to use Straight Alpha workflow, you can't use PMA workflow. Unless you have a reason to use Linear color space in your Unity project, it will likely be better for you to switch your project to use Gamma color space. This will make blending more intuitive.

If you need to use Linear color space, you need to adjust all steps in export and import to Straight Alpha, as described in the documentation. When settings are wrong, spine-unity will show error messages that your settings are incorrect.

  • NikoNiko がこの投稿に返信しました。

    Harald
    Hello, I have sent the skeleton assets to the corresponding email, please check. If there are any files that need to be provided, please let me know.

    @NikoNiko Thanks for sending the reproduction assets. Unfortunately I could not reproduce any real issue with your projects. If you mean that your origin is far off from the attachments (and the mesh center), the positions of your attachments are at e.g. X = 1263.0, Y= -1290.5, while your attachments are of approximately size 128x128. You can also see that in your provided Spine projects when zooming out, the origin (and also the root bone which you showed in a screenshot earlier) is far off.

    • NikoNiko がこの投稿に返信しました。

      Harald
      I’m very sorry, I may have missed some PNG files. I just started using Spine, and I realized when I saw your reply that the .spine file does not contain image files. I have repackaged the corresponding image files and sent them to the same email address as before.

      • Misaki がこの投稿に返信しました。
        • 編集済み

        NikoNiko Sorry for the delay in response! I checked the Spine project you sent us and it appears to display correctly:

        (This is the result of testing with the project's color space set to linear and the skeleton's texture and material also set to the correct settings for a straight alpha texture.)

        I still think the confusion is due to the fact that Harald pointed out that the skeleton image is quite far from the root bone. If you check this skeleton in the Scene window, it looks like this:

        The position of the root bone in the Spine editor will be the X:0/Y:0/Z:0 position when the skeleton is instantiated as a SkeletonGameObject in Unity. If you want to change the position of the door image, you can adjust the position of the root bone on Spine. As you may know, but just to be sure: you can change the position of the parent bone without changing the position of the child bones or slots by using the compensation buttons: Spine用户指南 - 工具 #补偿

        • NikoNiko がこの投稿に返信しました。

          Misaki
          Hello, I’ve adjusted the position of the images to bring them closer to the origin, and now they display correctly in Unity. Thank you very much for your and Harald’s answers.
          Additionally, I have a suggestion. When looking for the compensation buttons, the image in the user guide didn’t directly help me locate the feature. If possible, could you capture a larger area in the image? This would make it easier for viewers to locate the button

          • Misaki がこの投稿に返信しました。
          • Harald が「いいね」しました。

            NikoNiko I am glad to hear that your skeletons are now displayed correctly!

            Additionally, I have a suggestion. When looking for the compensation buttons, the image in the user guide didn’t directly help me locate the feature. If possible, could you capture a larger area in the image? This would make it easier for viewers to locate the button

            Indeed, it might be a little hard to tell where we are showing in that image. Let me add this: there is an image of the entire tool at the top of this page, then the explanation follows below, so the image is cropped to show the part of the buttons. However, it is far between that top image and the compensation section, so it might be better to show a wider area around those buttons, as you say. We will consider replacing the image.