EsotericSoftware / spine-runtimes

2D skeletal animation runtimes for Spine.
http://esotericsoftware.com/
Other
4.42k stars 2.92k forks source link

[godot] Fix Skeleton/Texture loader for runtime loading #2630

Closed TokageItLab closed 1 month ago

TokageItLab commented 2 months ago

The API load_from_xxx() must be valid for files outside res:// in the Godot.

Known issues:

  1. If there is an image in res://, a load error occurs while the .import is not created, because ResourceLoader is used. If you generate images from Godot and Spine loads them, it is recommended to output them in the user:// folder.
  2. There is a problem that Resource.duplicate() does not work for SpineSkeletonFileResource and SpineAtlasResource because Spine's data resources have incomplete serialization integration with Godot's Resource. This PR allows us to serialize the internal data of those SpineResources to our own Resource, and when we want to load Spine, we can temporarily output those serialized data as a file in the user:// folder, and load Spine from there to make it work, although it's bit hacky.
badlogic commented 2 months ago

This is great. The serialization issue is unfortunate, but I don't see a cleaner way around.

I'm sorry for the red tape, but could you digitall sign our contributor license agreement? I need this so we can publish your PR under our Spine Runtimes license. Signing it digitally and sending it to contact@esotericsoftware.com is enough!

This also fixes #2477

TokageItLab commented 2 months ago

I've contacted the esotericsoftware by e-mail previously, and got the format and sent the text. Or do I need a separate electronic seal?

badlogic commented 1 month ago

Thanks!