coa_tools icon indicating copy to clipboard operation
coa_tools copied to clipboard

Error in DragonBones export when having multiple Armatures

Open alcalyn opened this issue 5 years ago • 4 comments

Traceback (most recent call last):
  File "~/.config/blender/2.79/scripts/addons/coa_tools/operators/export_dragonbones.py", line 1174, in execute
    self.json_data["armature"][0]["skin"] = get_skin_data(self,self.sprites,self.armature,self.scale)
  File "~/.config/blender/2.79/scripts/addons/coa_tools/operators/export_dragonbones.py", line 422, in get_skin_data
    data2 = get_skin_slot(self,sprite,armature,scale)
  File "~/.config/blender/2.79/scripts/addons/coa_tools/operators/export_dragonbones.py", line 370, in get_skin_slot
    display_data["uvs"] = get_uv_data(bm)
  File "~/.config/blender/2.79/scripts/addons/coa_tools/operators/export_dragonbones.py", line 251, in get_uv_data
    for i,val in enumerate(uv_first):
TypeError: 'NoneType' object is not iterable

I created a personage with an armature with bones and animations, and could successfully export to dragonbones json.

Now, I want to create another view of my personage (front view, side view), so I created a new Sprite Object, with a new armature (Armature.001), with its bones and animations.

When I try to export it, I get this error. The export fails at middle, and I can see a COA_EXPORT_ARMATURE as a sibling of my new armature.

Note that the export works when I selected the first armature, but the second armature is ignored.

My question: Is creating two sprite object/armature the good way to animate a personage with a front view and side view (and later a "back" view), with for each, a different set of image sprites ?

alcalyn avatar Jan 06 '19 18:01 alcalyn

Hey! Not Related to your Issue! But How do you export to DragonBones format? I see no Options available for it.

fishingGrapes avatar Feb 03 '19 08:02 fishingGrapes

I also looked for it, I found it: https://github.com/ndee85/coa_tools/issues/102

Then I edited the readme, and is currently in an open PR: https://github.com/alcalyn/coa_tools/tree/readme-install-blender-addon#blender-addon you can find screenshot about where to find, configure and use DragonBones export feature.

alcalyn avatar Feb 04 '19 08:02 alcalyn

@alcalyn you want to export both armatures in one file? Or do you want to have to separate json files?

ndee85 avatar Mar 16 '19 19:03 ndee85

Dragonbones javascript engine allows to do something like factory.buildArmatureDisplay('Armature'); so I expected to pass anything else instead of "Armature", and name my differents armatures in Blender.

So if I understand well the Js api, It should be in a single Json file.

But I finally created different Blender files, one for each armature, I guess it's the best solution for now.

alcalyn avatar Mar 16 '19 19:03 alcalyn