Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store both original and sanitized node names in FBXLoader #26637

Closed
janulis opened this issue Aug 23, 2023 · 4 comments · Fixed by #26641
Closed

Store both original and sanitized node names in FBXLoader #26637

janulis opened this issue Aug 23, 2023 · 4 comments · Fixed by #26641
Labels

Comments

@janulis
Copy link
Contributor

janulis commented Aug 23, 2023

Description

I've noticed that the FBXLoader does not include the original node names when loading FBX files. The current implementation only provides sanitized node names, which makes it difficult to identify and manipulate specific nodes in the loaded FBX file based on their original names.

Solution

I would like the FBXLoader to store both the original node names and the sanitized node names from the FBX file and make them accessible in the resulting three.js objects. This would allow users to easily identify and manipulate specific nodes in the loaded scene using either the original or sanitized node names, depending on their needs.

Alternatives

One possible alternative is to modify the FBXLoader source code and create a custom version that includes the original node names in addition to the sanitized names. However, this is not an ideal solution because it requires maintaining a separate version of the loader and manually updating it when new versions of three.js are released.

Additional context

Including both the original and sanitized node names in the FBXLoader would provide a more complete representation of the FBX file structure and improve usability for developers working with FBX files in their projects. This feature would give developers more flexibility in choosing how they want to identify and manipulate nodes in the loaded scene.

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 23, 2023

Would you be okay if the loader stores the additional information in the Object3D.userData property?

Other loaders rely on userData fields for similar use cases.

@janulis
Copy link
Contributor Author

janulis commented Aug 23, 2023

Thanks for the quick response!

Would you be okay if the loader stores the additional information in the Object3D.userData property?

Other loaders rely on userData fields for similar use cases.

Yes, sounds good to me.

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 23, 2023

Would you like to file a PR?

@janulis
Copy link
Contributor Author

janulis commented Aug 24, 2023

Would you like to file a PR?

OK, I will do that.

Mugen87 pushed a commit that referenced this issue Aug 24, 2023
…ta (#26641)

#26637

Co-authored-by: Mindaugas Janulis <Mindaugas.Janulis@cleverdist.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants