UnderwaterApps / overlap2d

Overlap2D Game development toolkit for UI and Level design
Other
781 stars 224 forks source link

Not importing Spine animations #140

Open Psycic101 opened 9 years ago

Psycic101 commented 9 years ago

My spine animations are not importing into a project. These animations import without hassles in version 0.0.7 but now the import dialogue reports "Unsupported file type" (noticed when I upgraded from 0.0.7 to 0.1.0)

If I rename the spine animation to sheep and overwrite the spine animation in the default o2d example project (using windows explorer) when I next open o2d it correctly replaces the default sheep with my animation. This leads me to believe the issue is with the import method and not my animation

Psycic101 commented 9 years ago

Note: this is also the case when trying to import the example sheep spine animation into a new project

azakhary commented 9 years ago

hmm, I am not sure I am able to reproduce, can you share exact file, that if I import will fail? Also, have you tried with latest build?

Psycic101 commented 9 years ago

I'm getting a test project together to demo the error. I just want to check, are there any specific export settings O2D expects from Spine animations before importing? I'm a programmer, not an animator so I don't create the spine files, I just use what the art team gives me.

zhengnan110 commented 9 years ago

I get the same issue. and I check the source code find that , the editor check spine use contents.contains("\"skeleton\":{\"") , but the spine file like xxx.json ,that content has no that tag string!

azakhary commented 9 years ago

Psucic101: there is no specific settings that I know of. Maybe something related to mesh animations?

zhengnan110 oh weird. I think this can be related to spine version! I think they changed their data structure at some point. Can you write here what spine version are you using? as well as again, if you attach the file, I'll try to reproduce and fix on the spot.

zhengnan110 commented 9 years ago

I download last version o2d ,in path "...\examples\OverlapDemo\assets\orig\spine-animations\sheep\sheep.json",this json content has no tag string like "skeleton"

azakhary commented 9 years ago

I see, I'll check this out.

ghost commented 9 years ago

Our group was having this problem as well (someone in the group might've reported it).

Anyway, it seems that the issue has to do with the Spine export parameters. I switched off the "pretty print" option and the exported file then imports correctly. Hope that helps...

bangive commented 8 years ago

I have this issue too. My images don't have file001, so I change the file name sequence from file002, file003, file004... to file001, file002, file003,... Then i pack images using TexturePacker in libgdx and it works.

bvisonl commented 8 years ago

Any update on this issue? I am having the same problem, @SnowFoxZA 's suggestion did not worked for me.

If this helps anyone, what I am currently doing is modifying the JSON of the scene that I am working on, so for example if I wanted to add the default animation that comes with spine I would save my files (atlas, json, and png) that gets exported from Spine on the path: projectroot\assets\orig\spine-animations\spineboy*.

Then, on the scene.dt I would add this json object to the structure inside the composite object:

"composite": { "sImages": [...], "sImage9patchs": [ ... ], "sComposites": [ ... ], "sParticleEffects": [ ... ], "sSpineAnimations": [ { "uniqueId": 39, "tags": [

    ],
    "x": 126,
    "y": 58,
    "originX": 0,
    "originY": 0,
    "zIndex": 16,
    "layerName": "[INSERTLAYERNAMEHERE]",
    "animationName": "spineboy",
    "currentAnimationName": "walk"
  }
],
"layers": [...]

}, ... rest of the scene data ....

This is basically "manually" adding the animation since the import function doesn't work, hope it helps someone as well.

Dont forget to close O2D before doing this to see the changes.

azakhary commented 8 years ago

The issue was fixed 4 days ago, can you re-download the editor and try again?

azakhary commented 8 years ago

(please try both pretty print and not pretty print) if still does not work, please open your spine.json file and copy paste first lines here so we can see. Basically the ImportUtils.java is doing a text matching check to see if it's spine. i's easy to figure out why it's not thinking it is.