Skip to content

Conversation

yuripourre
Copy link
Contributor

@yuripourre yuripourre commented Aug 13, 2025

Title

Fix loading bones from assimp. I couldn't test it yet, but shouldn't be a bad idea to merge it. I will probably test it tomorrow.

Summary

Fix 3 places in the code to make sure bones are loading and handled properly

Changes Made

Modify logic to determine if meshes have bones

  • Instead of checking if all the meshes have bones, we check if any mesh has bones

Add a way to retrieve a bone from a container by name

  • Updates the getNodeFromContainerByName method to allow retrieving a bone by name

Update the assimp worker to limit bone weights

  • Change the call to load a model using assimp to pass the flags to limit bone weights

Benefits

Closes #506

@yuripourre
Copy link
Contributor Author

@julien-moreau do you have any fbx file that can be used to test this?

Copy link
Contributor

@julien-moreau julien-moreau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omg if you can handle this it'll be really awesome and it'll prepare the future :)

You can take any animated mesh from Mixamo (https://www.mixamo.com/#/) and you'll see that bones are badly imported using Assimp (we have to figure out if it comes from Assimp or if it comes from our implementation reading the Assimp output data). I remember that I got a support of bones and I changed A LOT the code to make the mixamo models to work but I failed.

Take the basic mannequin from Mixamo (aka Y Bot) as it has no texture. I noticed that when textures are embeded in FBX, the Assimp loader takes SO MUCH time to load the model.

@julien-moreau
Copy link
Contributor

This one
image

@yuripourre
Copy link
Contributor Author

@julien-moreau do you think you can share the fbx file :D ?

@julien-moreau
Copy link
Contributor

@yuripourre
Copy link
Contributor Author

@julien-moreau thank you so much! I will try to try later today.

@yuripourre
Copy link
Contributor Author

I couldn't test yet, my PC gets stuck loading the fbx, I will try during the week.

Copy link
Contributor

@julien-moreau julien-moreau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works on my side, like I mean I load the 3d model (even if bones are bugged ahah)
Do you logs to share?

@yuripourre
Copy link
Contributor Author

It works on my side, like I mean I load the 3d model (even if bones are bugged ahah) Do you logs to share?

Yeah, I could load after cleaning the project but had this same problem with crazy animations. I am going to turn into draft and take another look in the future.

@yuripourre yuripourre marked this pull request as draft August 22, 2025 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support of bones when loading .fbx

2 participants