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

Square Brackets and periods are getting removed from node names on import #55796

Closed
timshannon opened this issue Dec 10, 2021 · 3 comments
Closed

Comments

@timshannon
Copy link

Godot version

v3.4.1.rc2.mono.official [d5aa00c]

System information

Ubuntu 20.04.3 LTS

Issue description

This may be intentional, but the behavior change broke some things in my project. In an import script I parse out any values within square brackets and add it as a group on import.

mesh-name[group1][group2][group3]

Since v3.4.1.rc1 these square brackets are getting stripped out.

If I start a brand new project on 3.4.1.rc2 the issue doesn't happen. If I use a copy of my project file from my existing project, the square brackets and periods are getting stripped out of node names, so I assume it's related to some project level setting. I have yet to isolate which specific setting is causing the issue though. I'll update this issue if I find it.

Steps to reproduce

Open the attached project, import mesh.gtlf, and look at the scene. You'll see there are no square brackets in the name. Import that same mesh in a new clean project, and the brackets show up fine. You can also look at the gltf file directly and see the values in the mesh name.

image

Minimal reproduction project

test.zip

@Calinou Calinou modified the milestones: 3.5, 4.0 Dec 10, 2021
@akien-mga akien-mga modified the milestones: 4.0, 3.5 Dec 10, 2021
@akien-mga
Copy link
Member

This is a consequence of this bugfix: #54911. The check for MODULE_REGEX_ENABLED was not working due to a missing include, and this is now fixed.

https://github.com/akien-mga/godot/blob/6f4858f184870fe944cdf3cf7fdcb7eb83574d1d/modules/gltf/gltf_document.cpp#L433-L444

In 3.4-stable it would print this warning:

WARNING: GLTF: Legacy scene names are not supported without the RegEx module. Falling back to new names.
     at: _sanitize_scene_name (modules/gltf/gltf_document.cpp:438)

So it would use the new naming scheme instead of the Godot 3.2-compatible one requested by the nodes/use_legacy_names option for the glTF file. You can disable that option and it will use the new names which allow using square brackets.

@akien-mga
Copy link
Member

akien-mga commented Dec 12, 2021

For the record, the bug fixed by #54911 means that the nodes/use_legacy_names option added in 3.3 for compatibility with 3.2 probably never really worked, and thus users were forced to upgrade to the new naming scheme anyway.

#54911 fixes it but thus regresses for most users who have their pre-existing files flagged with nodes/use_legacy_names yet this hasn't been applied properly. So I'd suggest dropping that import option altogether in 3.4.1 and 3.5.

Edit: Ah no I'm wrong, the nodes/use_legacy_names option did work in 3.3.x, but I broke it in 3.4-stable with #50466, which #54911 then fixed for 3.4.1 / 3.5.

Now, I think @timshannon is not the first user to be confused by nodes/use_legacy_names being enabled by default, so I think we should disable it for 3.4.1 (since existing 3.4 users have been force upgraded to non-legacy names by this bug) and 3.5.

@akien-mga
Copy link
Member

Duplicate of #54922

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

No branches or pull requests

3 participants