DragonBones / Tools

DragonBones Tools
MIT License
141 stars 75 forks source link

2db -t new fails #7

Closed radu-m closed 6 years ago

radu-m commented 6 years ago

Running the command 2db -t new fails with the message Unknown type: none and I was unable to find any workaround to this. Conversely, db2 -t new on the same path prints Convert complete but there are no changes to the original file or any new files.

akdcl commented 6 years ago

Perhaps the command you need to execute is 2db -t spine.

akdcl commented 6 years ago

Sorry, 2db -t new is a typo.

radu-m commented 6 years ago

Spent some time yesterday digging around and turned out to be a pretty weird problem. I'm porting a game from Flash to Canvas and the animations are exported from as JSON targeting dragonBones @2.x so needed to push them through 2db to upgrade them. Looks like one of the animations is exported in a strange way that caused a failure within globalToLocal method of dragonbones-tools/out/action/toFormat.js when calling armature.sortBones(). The workaround we settled for is to export the assets from Flash as "parentReference" instead of "globalReference" and therefore circumvent that method.

[line 217]

    if (data.isGlobal) {
      globalToLocal(armature);
    }

...fails at armature.sortBones(); [line 228]

Also, another issue we had was [mis]naming of the input .json file, causing an infinite recursion within path.js. We renamed the file to "texture.json" and then db2 -t binary -i ./source/path -o ./out/path ran nicely. Not sure if any of this applies to other setups then my own, but maybe saves someone a headache...