Maybe someone of you can help me finding why there are no graphics in my (first) spine animation…
Background:
Created some png graphics
Used DragonbonesPro 5.6 to create a simple animation
Exported like in the docs / forum explained: Spine 2.x, Image-export
Started a new DEFOLD project for testing
Created the atlas and inserted the graphics from the texture-folder (dragonbones export)
Created a spinemodel and spinescene
After all this I just can see the bones (as lines) in the spine-scene. Where are my graphics? It seems the names / urls of the graphics (maybe in the atlas) are not correct - but I cant change them ?!?
It seems that Dragonbones got the great idea to not output width and height information for each slot/attachment/image in the JSON. I got your first JSON working by manually entering width and height for each entry in the skins->default table… So something like this:
@Mathias_Westerdahl pointed out some great advice for Dragonbones users; you should be able to verify your JSON output by running it through the official Spine skeletonViewer application as a first step in debugging.
When I tried your scene it failed to load and wrote in the log the following:
com.badlogic.gdx.utils.SerializationException: Error reading attachment: food, skin: default
at com.esotericsoftware.spine.SkeletonJson.readSkeletonData(SkeletonJson.java:268)
at com.esotericsoftware.spine.SkeletonViewer.loadSkeleton(SkeletonViewer.java:195)
at com.esotericsoftware.spine.SkeletonViewer$UI$2.changed(SkeletonViewer.java:634)
at com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.handle(ChangeListener.java:28)
at com.badlogic.gdx.scenes.scene2d.Actor.notify(Actor.java:182)
at com.badlogic.gdx.scenes.scene2d.Actor.fire(Actor.java:147)
at com.badlogic.gdx.scenes.scene2d.ui.Button.setChecked(Button.java:124)
at com.badlogic.gdx.scenes.scene2d.ui.Button$1.clicked(Button.java:92)
at com.badlogic.gdx.scenes.scene2d.utils.ClickListener.touchUp(ClickListener.java:89)
at com.badlogic.gdx.scenes.scene2d.InputListener.handle(InputListener.java:59)
at com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:351)
at com.badlogic.gdx.InputMultiplexer.touchUp(InputMultiplexer.java:96)
at com.badlogic.gdx.backends.lwjgl.LwjglInput.processEvents(LwjglInput.java:332)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:217)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
Caused by: java.lang.IllegalArgumentException: Named value not found: width
at com.badlogic.gdx.utils.JsonValue.getFloat(JsonValue.java:657)
at com.esotericsoftware.spine.SkeletonJson.readAttachment(SkeletonJson.java:332)
at com.esotericsoftware.spine.SkeletonJson.readSkeletonData(SkeletonJson.java:265)
... 14 more
The interesting line here is: Caused by: java.lang.IllegalArgumentException: Named value not found: width, which might give you a hint what could be wrong!
Actually there is a workaround for this issue. It is not very easy but better than adding width and height values manually. I’m going to prepare a walkthrough for it.
Yeah. I think I followed the instructions correctly.
Attached are the relevant files, if you want to have a look. human_fetus_spine_ske.json is the one exported from DB, the json and atlas are what was produced by using the DB Tools.
Ah! This is totally my fault, sorry. I should explain the xxx_tex.json generation. I’m not sure why this file is not generated in first place.
If you don’t have a xxx_tex.json in your library folder (which is not available in the zip) you can create it by exporting as “DragonBones Binary” first…