Hi,
I am able to export a single skinned mesh with animation from Maya to both the .babylon and .glb file formats without issue.
However, if I remove the mesh leaving only the skeleton, and try to export again the resulting file does not contain a skeleton at all and the importers error during the import process.
The same thing occurs if I don’t delete the mesh, and select just the skeleton, attempting to export only selected.
Is there a way to export only the skeleton from Maya that I am missing?
Thanks
pinging @Guillaume_Pelletier
Hello guys,
Skeleton are tightly coupled to the mesh into the exporter. Exporting skeletons ONLY, just needs to become a new feature. Theorically this might be possible but the underlying code is not fully designed for.
Thanks for the quick response.
Can you think of any workaround? Is there any way to remove a mesh, materials, etc… from a .babylon file after it is exported?
Haha, this is another story, if you remove all the meshes and keep the skeleton
“meshes”:[ ],
“skeletons”:[ {…},{…}]
you might get the expected result
be aware of remove any references to the meshes such morphManager if some.
I tried with one of my .babylon file and it’s work.
draco (2).zip (290.1 KB)
hello @Guillaume_Pelletier , can you teach me how to embed that code, i want to export only skeleton with animation like the guys on theard. thanks
Was this feature ever added? Was a workaround ever discovered? I am trying to do the same thing and I think this is a common need for any character customization system.
Cc @PatrickRyan
@Snowden, if you are trying to export animations only with the skeleton hierarchy you can check the Export Animations Only
option in the Maya exporter:
This can be used in conjunction with Export Only Selected
if desired, but no meshes will be exported in this file. Is this option not working for you?
I’m actually using Blender to export. I have a .blend file with a skeleton and animations, but when I export to .glb and import into Babylon the skeletons are empty.
const skeletonOnly = await BABYLON.SceneLoader.ImportMeshAsync("", baseUrl, humanoidSkeletonUrl, scene);
console.log("SKELETON ONLY SKELETON: ", skeletonOnly.skeletons) // shows as empty
Interestingly the bones do show up as children of meshes[0], but are not recognized as a skeleton. Also interesting, the animations can be played on those nodes.
As long as I export with a single mesh in the hierarchy the skeletons array is populated. My current solution is to export the skeleton with a single plane mesh and hide that mesh so I can just use the skeleton.
Here is a playground I made for another question I posted about modular characters, but you can see what I mean here:
@Snowden, this is due the fact that the hierarchy from the animation only skeleton does not really have any relevance to the animation. There’s no reason to define it as a skeleton if there is no mesh to drive with it. However, you still get the benefit of the transform names as the targets of each animation curve. This means you will go through each curve in your animation and find the name of the corresponding bone in your defined skeleton and replace the target of the curve with your skinned bone. This is another thread in which I talk about retargeting animation only files with a code example for doing so on a biped rig.
Our animation systems are undergoing some improvements right now and simplifying retargeting is in the cards, but I have no eta when we will have it all in and ready for consumption.
Thank you for the explanation.
For my project I’m using the empty skeleton as a base to attach different parts of a character to create a system where characters can switch out different armor or clothing pieces. I thought it made sense to export that skeleton with the animations that go with it.
Parts of a character are stored in separate files which contain a mesh and a skeleton which is identical to the empty skeleton. In the code I assign my part scene mesh’s skeletons to be the empty skeleton which seems to be working well. I can assemble a character out of different parts this way. That is why I’d like to have an empty skeleton.
@Snowden, part of the reason it works like this is that the glTF file format is supposed to be a transmission file or a last mile format. There is no concept of skeleton as a discreet element in the format because the file is stripped of any unessential data to make it as small as possible. We can store the transform of the bone, but we throw out the length, for example. And if there is skinning information there, the file understands that a node is part of a skeleton. In that way, inferences are made to understand certain properties of the elements in the file so we don’t have to waste data with storing definitions directly. This is why when we get a glTF with animations only we don’t know that it contains a skeleton and there is no world in which we should assume what in the file is a skeleton if we see a file with animation curves and nodes as we have no idea what might be a skeleton without skinning information or a discreet definition.
The easiest way to handle this would be for your base skeleton to have one mesh attached that is common to all of your characters. Maybe there is a common trunk mesh or a common foot mesh. At minimum a single quad like you describe will be enough, but it would be better for this to be a mesh that is supposed to be seen as it will be another draw call for your scene. Otherwise, you will need to clean up and dispose of that quad after your character is assembled to reduce draw calls.
Thanks, that does make sense. I’m currently just deleting the quad so it works just fine. Good to know the reason behind it though.