Hi,
I am trying to export a skeleton and it’s animations. But I can’t figure out how to do that. I have no prefered export format, as long as I can import that format in ThreeJS again…
Does anyone have a simple example?
Hi,
I am trying to export a skeleton and it’s animations. But I can’t figure out how to do that. I have no prefered export format, as long as I can import that format in ThreeJS again…
Does anyone have a simple example?
I have set up a basic version of what I tried to do here:
As you can see, I create a simple skeleton, and when the save button is clicked, the exporter kicks in. When you open the console you can see the feedback given. The skeleton is clearly created and looks like expected, but the data to save is empty.
That does not work since you have to create an object of type THREE.SkinnedMesh
. Just a single THREE.Skeleton
can’t be processed by GLTFExporter
(@donmccurdy Please correct me if I’m wrong).
If you are just focused on a skeleton and its animation, a format like BVH
is more appropriate to you. Unfortunately, there is no BVHExporter
for three.js
. Just a BVHLoader
:
That does not work since you have to create an object of type THREE.SkinnedMesh. Just a single THREE.Skeleton can’t be processed by GLTFExporter (@donmccurdy Please correct me if I’m wrong).
Correct; GLTFExporter can’t process it and I’m not sure the glTF format can represent a skeleton detached from any mesh either.
@Fedor_van_Eldijk you could attach a simple dummy mesh to the skeleton, and weight all vertices to the first bone. That should allow you to export through GLTFExporter and import through GLTFLoader, then throw away everything but the skeleton.
I have now added a dummy SkinnedMesh to which I have attached the skeleton as described in the manual.
But it still returns empty data to save…
You also have to apply the instance of SkinnedMesh
to GLTFExporter.parse()
like this:
exporter.parse( mesh, function ( gltf ) {
console.log( 'Data to save', gltf );
}, options );
silly me… now there is data to save. Thanks.