Actually, I just gave the WASM build a quick try, fixed the compilation error, build the export tempalte, and tada:
Does Spine Work with Godot?
And now it's also compatible with Godot 4.x https://github.com/EsotericSoftware/spine-runtimes/commit/ccc43a386404eadb8544ea6957ab6b558d330cc3
I noticed the spine-godot directory on github is gone. Is there still a way to try spine in godot?
It's in the 4.2-beta branch:
https://github.com/EsotericSoftware/spine-runtimes/tree/4.2-beta/spine-godot
It works almost perfectly. I am eagerly waiting for the "Export Templates".
Can you elaborate on the "almost" part?
- In AnimationPlayer Node I click on "Add Track > Property Track", choose the SpineAnimationTrack, but i can't see the properties "animation_name" or "loop" (like used in example 08-animation-player)
- When I click on "Search Help" (Reference documentation in Script Tab), Godot crashes.
- The External Editor (Visual Studio code with godot-tools extension) cannot connect to the GDScript Language Server.
I build on my Mac with "./setup.sh 3.4".
Cheers! Issues 2 and 3 are likely due to the fact, that the build generated by setup.bat/.sh is a minimal editor buildmwith many modules disabled. I do this so iteratiom times on recompiles while working on the code are minimal. When we publish editor builds, they'll have all the default modules that come with Godot. You can fix this locally if you remove all lines from custom.py and recompile the engine/editor via setup.sh/.bat (build.sh/.bat will not work, as setup.sh/.bat configures the build).
Issue 1 is a documentation problem You don't want to create a track the SpineAnimatiomTrack in the animatiom editor, but the AnimationPlayer child of the track. Sadly, Godot's AnimationPlayer and editor don't allow custom track types, so this is a workaround. As a bonus you see the animation durations and names tho, which is MUCH better then only seeing a little diamond for a key.
Mario ha scrittoCheers! Issues 2 and 3 are likely due to the fact, that the build generated by setup.bat/.sh is a minimal editor buildmwith many modules disabled. I do this so iteratiom times on recompiles while working on the code are minimal. When we publish editor builds, they'll have all the default modules that come with Godot. You can fix this locally if you remove all lines from custom.py and recompile the engine/editor via setup.sh/.bat (build.sh/.bat will not work, as setup.sh/.bat configures the build).
Issue 3 "GDScript Language Server" solved! :yes:
Issue 2 "Search Help" NOT solved. Godot still crashes :no:
Mario ha scrittoIssue 1 is a documentation problem
You don't want to create a track the SpineAnimatiomTrack in the animatiom editor, but the AnimationPlayer child of the track. Sadly, Godot's AnimationPlayer and editor don't allow custom track types, so this is a workaround. As a bonus you see the animation durations and names tho, which is MUCH better then only seeing a little diamond for a key.
Unfortunately, your explanation did not help me. Perhaps I have expressed myself unclearly.
How did you manage the following? animation_name and loop do not appear in the selection. I tried to enter the entries manually, but of course it doesn't work.
Finally, in another AnimationPlayer, I want to put together the individual animations:
Look what objects are keyed in your second screenshot. It's the AnimationPlayers beneath the SpineAnimationTracks, not the SpineAnimationTracks.
Mario ha scrittoLook what objects are keyed in your second screenshot. It's the AnimationPlayers beneath the SpineAnimationTracks, not the SpineAnimationTracks.
Yabadabadoooh. I know what the problem is.
When I add an AnimationPlayer for a SpineAnimationTrack, the display in the Animation Editor remains empty:
I have to close the scene and open it again.
I discovered this by accident this morning. After I opened the project, all the entries I wanted were there.
Is this a Godot problem?
deezaster ha scrittoI have to close the scene and open it again.
Is this a Godot problem?
Not sure, but it is worth noting that Rayxuln's module has a similar problem where certain changes don't appear unless you close and reopen the scene.
Depends on the Godot version. 3.4 has a bunch such issues (unrelated to the module). Imtried to work around some of them. 4.0 is a bit better in that regard, but not quite stable.
@deezaster, I should get to writing docs next week, so I can better illustrate how this is supposed to work.
Issue 1 - I am unable to run exported scene in Web browser with spine-godot runtime on Godot 3.4.4-stable (I used ./setup.sh 3.4.4-stable to create custom godot binary), all the spine related cpp files are not found by godot in browsers console.
Issue -2 Not able to build with current godot master branch
Update : silly mistake, forgot to build export template, html5 working fine with 3.4.4. thnks
The latest commit fixes building with Godot master. Note that we can't always keep up with their master branch, as it's being quite... "dynamic" in API changes. Godot 4 is also far from ready to be for production. We'll ensure compatibility once Godot 4 RC has been released.
All right, so now I have to ask: does the beta Godot module work with Spine 4.1 output? Like, do sequences work with it?
Jupp!
Having a little trouble getting it to compile! I've assembled everything as the directions gave (spine_godot in /modules, spine-cpp in /modules/spine_godot), but I keep getting this error:
Animation.cpp
modules\spine_godot\spine-cpp\src\spine\Animation.cpp(30): fatal error C1083: Cannot open include file: 'spine/Animation.h': No such file or directory
scons: *** [modules\spine_godot\spine-cpp\src\spine\Animation.windows.tools.64.obj] Error 2
scons: building terminated because of errors.
Any idea what's going on? I do have the correct spine_godot (the actual source folder, not the containing folder with the examples) and spine-cpp (again, the one containing the "src" and "include" folders, not the containing folder) in the places specified.
EDIT: If it means anything, I'm running
scons platform=windows
in the source folder as I usually do for a build; I know the instructions say something about "setup.bat" but I don't see that file in the build scripts for spine-godot, only "setup.sh".
EDIT #2: Got it compiling. Had to modify the spine_godot SCSub file (remove the # signs from the file paths) and SpineAnimationTrack.cpp (change "godot/editor/editor_node.h" to "editor/editor_node.h").
I redid the build system last week so CI can be used to provide precompiled Godot editor and template binaries. We no longer support cmd.exe to build. Instead you'll. need Git Bash or Msys to build via the bash scripts in spine-godot/build
. I'll document it this week.
Glad you figured it out, tho it's weird you had to change the editor_node.h
include. What Godot version are you using?
3.4.1, so I'm a little behind. It might have had to do with the fact that my source directory is not "godot/"; it's "godot-3.4.1-spine/".