How to change spine character's weapon and clothes efficiently in Godot?
Godot-Spine Question
I think you can use skins.
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
There is currently not for technical reasons.
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 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 You can use the SetAttachment()
method in UE4. Please refer to the "Setting Attachments" section of the spine-ue4 runtime documentation: http://esotericsoftware.com/spine-ue4#Setting-Attachments
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.