Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export problems #69

Open
pfirsich opened this issue Feb 26, 2017 · 0 comments
Open

Export problems #69

pfirsich opened this issue Feb 26, 2017 · 0 comments

Comments

@pfirsich
Copy link

While writing the löve importer I noticed some potential issues with the export.

            if #indices == 4 and indices[1] == 0 and indices[2] == 1 and
                                 indices[3] == 2 and indices[4] == 3 then
                indices = {0, 1, 2, 0, 2, 3}
            end

Is the edges field actually part of the DragonBones file format? Even if it is, why not just export (way more interesting and closer to the implementation) vertex indices?

  • (optional) I think it would be nice to export slot attachments of type "image" instead of mesh per default, if the image is only weighed to a single bone. Because now either you have to detect that case yourself and convert subsequently or you have to implement skinning, when in most cases it is not needed. This would also imply that you would have to parent the attachments to the bones they are actually parented to (because at the moment all are parented to the armature itself, which is also kind of weird btw.) and also that you export a file that contains information about the atlas (preferably the format DragonBones also uses). This is a not so minor change, but I thinkt it would provide more similar exports and easier implementation of runtimes.

  • (this is probably my fault) It seems like the bone transformations (in the animation/keyframes) are only partially relative to the bind pose. The position seems to be in world space. This was very weird to debug but, I only got it to work like this:

        bone.worldTransform = bone.bindTransform:compose(androssMath.Transform(bone.positionX, bone.positionY, bone.angle, bone.scaleX, bone.scaleY))
        bone.worldTransform.matrix[5] = bone.bindTransform.matrix[5] + bone.positionX
        bone.worldTransform.matrix[6] = bone.bindTransform.matrix[6] + bone.positionY

Where bone.bindTransform:compose() multiples the bindTransform from the left with the bone transforms. I have to overwrite the positions then, because otherwise the translations are all wrong (rotated and such). I think this is my problem because the files work fine in DragonBones too, I think. It might even be, that it is a fault of the format and you discovered this yourself. But I would love to know what this is about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant