Loading FBX SkinnedMesh with a worker

I load most static data with workers which is great until I need to load SkinnedMesh from FBX. Using toJSON on the FBX group in the worker and then parse it with ObjectLoader in the main thread fails to rebuild the skeleton and the skin properly.

Is there any way to do this currently?

If not I guess I can write a bunch of logic to fix it or just live with the epic hitch from running it it the main thread.

Related: https://github.com/mrdoob/three.js/pull/11603

Great, looks like I just got to wait for this to become supported :slight_smile:

Why not using binary? I convert all assets in advance into a binary format that is optimized to use without further processing in THREE and holding any other information needed which can be preprocessed.

Got any example or similar which describe how you go about this binary approach?

glTF / GLB is an example of a format where the payload is binary, and designed to be parsed quickly. There are various converters and exporters, depending on your workflow that may be an option.

I use the FBX pipeline for animated autodesk models. Then parse the group for joints and applying custom materials.

Currently I do this in the main thread but I’d rather do it in the worker since that makes the time it takes near irrelevant. From a data perspective its basically only textures that have any significant cost but those are not a problem. If I move the FBXLoader to the worker the the animation data is lost in the conversion to the json format.

Instead of converting to json I could convert to glTF, pass the result to the main thread and use it without needing any time in the main thread to parse it?

If I move the FBXLoader to the worker the the animation data is lost in the conversion to the json format.

I’m a bit surprised by that… I think it should be possible to use the JSON format for animation, too.

Instead of converting to json I could convert to glTF, pass the result to the main thread and use it without needing any time in the main thread to parse it?

This sounds right. GLTFExporter does support animation, although there could easily be some bugs in the skinned mesh serialization.

Hello, can you load the objects on the worker? If so, can you share the script?