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\$

3 Answers 3

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.

\$\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:

\$\endgroup\$
5
  • \$\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\$ Commented Dec 17, 2016 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\$ Commented Dec 17, 2016 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\$ Commented Dec 17, 2016 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
    Commented Jan 2, 2017 at 17:20
  • \$\begingroup\$ @DMGregory You're correct.I'll do it whenever possible at the earliest. \$\endgroup\$ Commented Jan 6, 2017 at 20:14
0
\$\begingroup\$

DragonBones offical tools for converting to and from popular formats

Installation: npm install dragonbones-tools --global

Convert Spine json format files to DragonBones json format files in current path.

$ 2db -t spine

After running above command, you will get three files of Dragon Bones, e.g.:

  • xxx_ske.json (the skeleton file)
  • xxx_tex.png (the texture image)
  • xxx_tex.json (the atlas file).
\$\endgroup\$
1
  • \$\begingroup\$ This is currently a link-only answer. Can you edit your question to elaborate on how you would use this link to solve OP's problem? \$\endgroup\$
    – DMGregory
    Commented Aug 26, 2020 at 11:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .