1
\$\begingroup\$

I found 2 interesting Spine projects that I would like to import into DragonBones, but their texture atlas is in .atlas format, which cannot be read by DragonBones. I don't know how to convert .atlas files to .json files that DragonBones understands.

How should I proceed?

\$\endgroup\$
1
\$\begingroup\$

So, after hours of hit and trials, here are my OBSERVATIONS when importing spine project in DragonBones.

(1) You cannot import .atlas file and its sprite sheet from the assets option. It takes only .json and .xml is general So, if you have multiple .atlas sprite sheets of spine animation, do it at the time of Creating a new project from spine, otherwise, it won't give option to read .atlas file later.

(2) Even after importing Spine animation, it didn't put images in respective slots for me and in one case, the scale of some images were not correct. However, it shows the correct name of images in the slot but no sprite was actually present even if the assets are correct available in DragonBones library. The author of dragonbones told that DragonBones doesn't support some features of spine.

(3) If multiple .atlas files are in the same folder then it picks the first .atlas file. Ideally, it should pick the one with the same name. So, you have to manually browse the correct file. However, .png, it picks automatically corresponding to the name of .atlas

(4) There is some meta in the starting of animation file of spine(you can easily find it). If that meta is not correct or missing then it won't be read by DragonBones. So, if correct file is not working for you, find if that's missing.

(5) Don't use random texture data file, example, don't generate it by script which converts json to atlas, or vice versa, etc. Because that might not always work. DragonBones reads atlas file and converts into correct .json texture data file which is readable to DragonBones itself. So, you must see that if the texture data finally matches with what is given in the default examples of DragonBones software.

FINALLY, simple steps to import are if your .atlas .json and .png files are correct are:

1) Click on import(not import assets), form the toolbar

2) It opens the popup and asks you to select "Animation" data file which is your spine animation file. When you select that .json animation file, DragonBones automatically selects "Spine Animation Data" in the next window popup.

3) So, now, you just select the corresponding texture .atlas data and .png texture. (In my case it was png. I am not sure if Spine exports other format as well. So, whatever it exported from spine should work, I guess)

I've given a little pause to animation. So, above steps can look vague to you but assured, they are correct observations.

I Hope some of it is helpful as there is probably nothing out there which could seriously help, AFAIK.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

I think it's not possible at the moment.

If you select Spine's JSON export option with Create atlas, it exports the following files:

  • .json files describing skeletons and their animations,
  • .png or .jpg files containing the images used, and
  • .atlas files describing what images belong to which parts of the skeleton.

If DragonBones cannot read .atlas files, it cannot put the images where they should be, and so cannot import the project.

Some options for you:

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Hi, thanks for the links. DragonBones developers really don't care to reply. Interestingly, after long time of error and trials. Just 10 min back, I got the success. If the .json animation file is correct, then it automatically selects "Spine plugin" and also automatically picks the .atlas and corresponding .png file. But if .json animation data is not correct then DragonBones gets confused and doesn't read atlas file. <Read below comment> \$\endgroup\$ – myDoggyWritesCode Dec 17 '16 at 23:08
  • \$\begingroup\$ There are 3 main problems with DragonBones in importing.(1) You cannot import .atlas file and its sprite sheet from the assets option. So, if you have multiple sprite sheets, do it at the time of Creating a new project from spine, otherwise, it won't give option to read .atlas file later. (2) Even after importing Spine animation, it didn't put images in respective slots for me and in one case, the scale of some images were not correct. However, it shows the correct name of images in the slot but no sprite was actually present even if the assets are correct available in DragonBones library \$\endgroup\$ – myDoggyWritesCode Dec 17 '16 at 23:20
  • \$\begingroup\$ (3) If multiple .atlas files are in the same folder then it picks the first .atlas file. Ideally, it should pick the one with the same name. So, you have to manually browse the correct file. However, .png, it picks automatically corresponding to the name of .atlas \$\endgroup\$ – myDoggyWritesCode Dec 17 '16 at 23:20
  • 1
    \$\begingroup\$ @user3241111 it sounds like it would be helpful if you documented these findings in an answer and mark it Accepted. That will help other users with similar problems find your solution and save the trial-and-error you had to go through. \$\endgroup\$ – DMGregory Jan 2 '17 at 17:20
  • \$\begingroup\$ @DMGregory You're correct.I'll do it whenever possible at the earliest. \$\endgroup\$ – myDoggyWritesCode Jan 6 '17 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.