chinedufn / collada-dae-parser

Parse collada .dae 3d animation files into a WebGL friendly JSON format
http://chinedufn.github.io/collada-dae-parser/
MIT License
103 stars 10 forks source link

parsing OpenCollada files with skeleton joints = non deformation bones error #9

Open natwales opened 6 years ago

natwales commented 6 years ago

I am running dae2json in the command line. I'm trying to parse out joint animations from a skinned mesh with a simple skeleton animation exported from Maya, but I am using the OpenCollada plugin.

When I don't check 'bake transformations' in my collada exporter I get a TypeError thrown:

usr/local/lib/node_modules/collada-dae-parser/src/library_visual_scenes/parse-visual-scenes.js:41
    accumulator[joint.$.sid].jointMatrix = joint.matrix[0]._.split(' ').map(Number)
                                                       ^
TypeError: Cannot read property '0' of undefined
    at /usr/local/lib/node_modules/collada-dae-parser/src/library_visual_scenes/parse-visual-scenes.js:41:56
    at Array.forEach (<anonymous>)
    at parseJoints (/usr/local/lib/node_modules/collada-dae-parser/src/library_visual_scenes/parse-visual-scenes.js:36:8)

When I do check 'bake transformations' I get an Error reported that

It looks like you're trying to parse a model that has 4 non deformation bones.

chinedufn commented 6 years ago

Hey puke.

Sorry about this! collada-dae-parser is mainly tested against Blender so my first hunch is that this might be due to an inconsistency between Blender's exporter and Maya or OpenCollada.

That being said, we definitely want it to work for everyone!

Could I ask for one thing so that I can help you take a look?

Can you make the simplest model possible that still has this issue and upload it to a public repo?

Then I can clone it and take a look at what's going on.

Thank you for reporting this!

natwales commented 6 years ago

sure thing: https://github.com/pukeanddie/collada_parse_issue This is just a cube bound to two bones with about 60 frames of animation on one of the joints.

chinedufn commented 6 years ago

Thanks so much this will be super helpful - I'll need a few days to make some time to dive in but in the meantime feel free to poke around the existing tests/code and see if you see anything.

chinedufn commented 6 years ago

Hey Puke,

Just tried taking a look and it looks like the repo is down? Are you all good? Apologies for the delay!