How to change spine character's weapon and clothes efficiently in Godot?

Related Discussions
...

I think you can use skins.

  • kodoly đã thích điều này.

Exactly, skins are the preferred way to do this. See the mix-and-match example of the spine-godot runtime and the editor documentation here:
http://en.esotericsoftware.com/spine-skins

    5 ngày sau

    Mario
    By the way,is there any similar API to GetRepackedSkin(spine-unity runtime API) in Godot C#?

    There is currently not for technical reasons.

      Mario Thanks.Maybe I should change a way to change attachment.T_T godot C# blood lacks tutorials.And I find a code set of spine-unity just now.Code sbelow.Can it be transferred to godot C#?

      Mario And is there a link about spine-ue4 API guide?

      • Misaki đã trả lời bài viết này.

        kodoly The API reference common to all runtimes can be found here:
        http://esotericsoftware.com/spine-api-reference
        As you can see in the API reference, the GetRemappedClone() method is not a common method in all runtimes, but is unique to spine-unity. So, unfortunately, it is not available in other runtimes as it is.

        • kodoly đã trả lời bài viết này.

          Misaki Is there a method to replace the attachment of a spine object in godot C#?

          Misaki I have tried such way:Evertime I press Key A,adding a new skin,copying current skin to the new skin,then removing the attachments in this skin and add new attachments.The result is that every 16+ times I press A,godot C# crash.Codes below,I wonder how to rewrite it.

          • T.Fly() đã trả lời bài viết này.

            kodoly Attachment API is not currently exposed to Godot.EsotericSoftware/spine-runtimes2322

            If you want to apply skins, you use addSkin method: http://esotericsoftware.com/spine-api-reference#Skin-addSkin

            You can also check out the Godot examples project to see how skins are handled in Godot currently.

            • kodoly đã trả lời bài viết này.
            • Misaki đã thích điều này.

              T.Fly() What about Unreal Engine?Is attachment API currently exposed to UE4?

              • Misaki đã trả lời bài viết này.

                Misaki The UE API SetAttachment() require all attachments add to the slot and select attachment in attachments through attachment Name,which means all equipment textures combine in one file.Will redundant files make the program Cottonwood and affect computer performance?

                • Misaki đã trả lời bài viết này.

                  kodoly Since your question was about the attachment API, I only answered about how to set attachments, but it seems to me that for what you want to do, you should still use skins as SilverStraw and Mario answered at the beginning.
                  Unfortunately, spine-ue4 does not provide a method to repack texture atlas pages at runtime, but it is possible to set multiple skins at once using SetSkins which is provided by the skeleton component:
                  https://github.com/EsotericSoftware/spine-runtimes/blob/64853b73bcbce53a1851b2b3b05ba8f5ab37e6d8/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonComponent.cpp#L46C7-L46C7
                  To set multiple skins on your skeleton, create a string type array with the names of the skins you want to combine and then pass it to SetSkins.
                  The latest example project contains 09-skins, which is a level that demonstrates how to set multiple skins on a skeleton.

                  By the way, if you want to continue asking questions about spine-ue4, you should start a new thread, since this thread was originally for a question about spine-godot.