rayxuln / spine-runtime-for-godot

This project is a module for godot that allows it to load/play Spine skeleton animation.
MIT License
93 stars 22 forks source link

Problem with JSON parser working globally. #56

Open ebmarsak opened 2 years ago

ebmarsak commented 2 years ago

Spine runtime's JSON parser is trying to import the JSON's generated by Dialogic such as Characters. Is there a way to prevent spine-runtime from thinking every JSON file in the project is a spine skeleton data JSON?

rayxuln commented 2 years ago

It should be able to change the import option of a JSON file in the Import panel.

ebmarsak commented 2 years ago

Played around a bit but changing import options for Dialogic related files didn't help. Dialogic just creates JSON files, and spine-runtime tries to import them as spine related JSON files.

example

These ".import" files shouldn't exist at all when using dialogic. I believe they are created or caused by spine-runtime.

example .import file

I think a good way to handle this issue is to change the code of spine-runtime to make it look for a specific location in the project to find and import spine atlas and JSON files. For example, it should only do the import operation inside "spine-assets" folder. Or maybe a way to exclude folders, I don't know. I tried to change some code in Json and EditorPlugin files in the repo but to be honest it's way over my head.

image

rayxuln commented 2 years ago

I think there may be a option of not importing the JSON file in the Import Panel. Have you tried that?

lluancarlo commented 10 months ago

.json files will not been imported in Godot newest versions. They have a note in Spine-Godot docs explaining this:

Note: You should prefer binary skeleton exports over JSON exports, as they are smaller in size and faster to load. If you must use JSON, make sure the file extension is .spine-json instead of .json. If you have an existing project that still uses .json export files, you can use this Python script to convert it to the new .spine-json extension.

Check it out HERE