• International中文
  • 我想把项目从godot3.5升级到godot4.2,但是导入spine文件遇到了问题

我以前的项目是godot3.5的然后我想升级到4.2,其中所有的spine动画二进制文件都不能用了,提示要用新版本spine打开从新导出,然后我就用最新版的spine4.2.37去打开我的旧的spine工程,提示这个报错,
WARNING: Slot forward slash disallowed, renamed [slot: putonggongji/xiaohua3, bone: xiaobaihua3, skeleton: huangyueying_phyattack_2] to: putonggongji-xiaohua3

然后就空白什么也没有,然后导出二进制也无法应用到godot4.22里面,这种情况我该怎么办,我的spine工程有好多,我看好像是打开旧版spine工程提示这个插槽命名反斜杠问题,所以自动给替换了,但是这样我的工程就不能用了,导出也不能用了,或许兼容一下反斜杠命名是否还有救?

    Related Discussions
    ...

    chuguang I'm sorry to hear that you're having trouble. Such automatic renaming is the correct behavior to perform since the latest version of Spine does not allow the use of slashes in slot names, but I am not sure from the information you provided why the project does not work properly after that.
    What I am curious about is that the log in the screenshot you showed us has the following sentence:

    Project updated: <unknown> to 4.2.37

    The <unknown> should show the version the spine project was originally created with, for example 3.8.99 to 4.2.37, so I wonder why the version identification is not working. What version was the Spine project originally created with?
    If you don't mind, please email us the Spine project causing the problem so we can investigate further: contact@esotericsoftware.com
    Please 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.

    OK,我将其中一个项目发送到这个邮件

      chuguang Thank you for sending us the spine project files. I opened the Spine project you sent with Spine 4.2.37, exported it to binary format, and imported it into Godot 4.2.2, and it worked successfully. I sent you an email with a video recording of my test results attached, just in case you want to check it out.

      So I think the problem lies in the way the export is done, or its configuration. Are you exporting the skeleton from the editor or from the CLI? Please show us your tried and tested export settings and texture packer settings.

      我看到了邮件里的视频,但是不对,虽然我看视频里是可以播放spine动画了,但是001的效果也不对,我来录制一个我操作的视频。

        chuguang Thank you for sending us the video! I think there may be a little misunderstanding about the version concept first, so let me explain that first.

        When using Godot and Spine skeletons together, it is important to note that there are three different versions of the word "version":

        1. Version of the Godot editor, such as Godot 3.5, 3.6, 4.0, 4.1, 4.2, 4.3.
        2. Version of the spine-godot runtime, such as 4.1 or 4.2.
        3. Version of the Spine editor, such as 4.1 or 4.2.

        What I mean is that there could be a combination of, for example, a Godot 3.6 build with the spine-godot 4.2 runtime that can display skeletons exported from Spine4.2.
        Then there could be a combination of a Godot 4.0 build that with the spine-godot 4.1 runtime that can display skeletons exported from Spine 4.1.
        In other words, just because the version of Godot is newer does not mean that the version of the spine-godot runtime included in the Godot build is newer.

        To display the skeleton correctly, the versions of the Spine Runtime and Spine Editor must always match. Therefore, it is incorrect to try to import skeleton data exported from Spine 4.1 against Godot 4.2.2, which contains the spine-godot4.2 runtime, as you did in your video.


        Regarding the issue with the animations looking different, it appears that the animation of the slot color change is lost. I am not sure the details of why this occurs, however, it seems that if you save the project once in 4.1 and then open it in 4.2, it will appear correctly, so it may be a good idea to save the Spine project once in 4.1 and then export it from 4.2 in a series of operations via the CLI.

        When launching Spine via the CLI, you can use the -u or --update command to specify the Spine editor version to launch. Then, using the commands described in the Import section of the CLI documentation, you can quickly perform the sequence of opening and saving in the version you specify. For example:
        Spine --update 4.1.xx --input <Path to your Spine project> --output <Path to the upgraded Spine project> --import

        For example, if you specify the path as follows, you can create a new folder named "upgraded" in the folder with the Spine project you specified, and save the Spine project saved in Spine4.1 in it:
        Spine --update 4.1.xx --input spine/vfx/01.spine --output spine/vfx/upgraded/01.spine --import

        You can then use the export command like the following to export the Spine project:
        Spine --update 4.2.xx --input spine/vfx/upgraded/01.spine --output spine/vfx/upgraded --export binary

        We have published scripts that are useful for version upgrades like this one, so please check them out as well:
        Blog: 新的导出 shell 脚本


        By the way, there is actually an error in your texture packer setup. The spine-godot runtime currently does not support atlases exported using pre-multiplied alpha due to technical limitations in Godot. Therefore, the texture packer setting should not be left as the default, and be sure to uncheck the Premultiplied alpha (预乘Alpha).

        If there is anything unclear, please do not hesitate to ask questions.

        非常感谢,解决了!我先用4.1打开项目并保存,然后再用4.2打开项目并导出,就可以正常使用啦,谢谢~