Reputation: 3922
I've an animated model that I've animated with Mixamo and then exported as an FBX into Maya. I've then used the Three.js exporter to output the animation 'baked' as morph targets.
Here's how the model looks when loaded into Maya:
However, when I read the data in, it includes not just the animation, but also the base model in a static pose, and each morphTarget array has the vertices repeated in it. This is what it ends up looking like:
Beyond manually writing some code to de-duplicate the vertices, is there any way to just get the animation out and not the model as well? I'm very new to Maya, so I'm guessing there's an option that I need to untick, or some selection step that I'm missing.
Thanks in advance
Upvotes: 0
Views: 644
Reputation: 3922
Should someone else have this problem, there's a simple answer (at least in this instance) - truncate the vertex and face arrays by half. After checking the vertices for duplicates it turned out they were all in the second half of these arrays, and could just be dumped.
geometry.vertices.length = geometry.vertices.length / 2
geometry.faces.length = geometry.faces.length / 2
geometry.morphTargets.forEach(function(target) {
target.vertices.length = target.vertices.length / 2
})
There's almost certainly a better way of doing it however.
Upvotes: 0