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

glTF import process strips most non-alphanumeric characters when generating Nodes #45544

Closed
abaire opened this issue Jan 28, 2021 · 3 comments · Fixed by #45545
Closed

glTF import process strips most non-alphanumeric characters when generating Nodes #45544

abaire opened this issue Jan 28, 2021 · 3 comments · Fixed by #45545

Comments

@abaire
Copy link
Contributor

abaire commented Jan 28, 2021

Godot version:
3.2.3 (but still exists in master as of today)

OS/device including version:
Verified with Windows/x64, macOS/x64

Issue description:
Importing a glTF file with node names containing characters other than a-zA-Z0-9_ - results in Nodes with those characters removed.

It is expected that any characters that are valid in a Godot Node name should also be valid here. The error message within the editor in 3.2.3 indicates that only . : @ / " are disallowed, though in looking at the importer code in 3.2.3 it looks like $ could be problematic as it is used as a suffix delimiter and by inspection # was found to prevent import hints from being processed as well.

This is particularly useful for EditorScenePostImport processing (my specific usecase is adding key=value pairs as hints to facilitate BoneAttachment generation)

Steps to reproduce:
Create a glb or gltf file with a node whose name contains interesting characters (e.g., Test!%^&*), import into Godot and note
that the imported node in the scene omits those characters.

This project contains a glb file with a default cube named Cube!%^&*()=[]WithInterestingCharacters which is renamed CubeWithInterestingCharacters by Godot.

MinimalReproProject.zip

Not clear if this would be obviated by godotengine/godot-proposals#1823
This is also similar to #43482 which covers the impact bone name sanitization has on users.

@Shatur
Copy link
Contributor

Shatur commented Feb 20, 2021

This caused by the following function:

static String _fixstr(const String &p_what, const String &p_str) {

Godot preprocesses nodes as some editors add extra characters when exporting. But probably it would be nice to keep names as is.

@Calinou
Copy link
Member

Calinou commented Feb 20, 2021

@Shatur95 This should be addressed by #45545.

@akien-mga akien-mga added this to the 4.0 milestone Mar 12, 2021
@akien-mga
Copy link
Member

Fixed by #45545 (not sure why it didn't get closed on merge).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants