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

Extensions of custom classes invalid upon deletion of .godot folder #72226

Closed
FireCatMagic opened this issue Jan 28, 2023 · 2 comments · Fixed by #72444
Closed

Extensions of custom classes invalid upon deletion of .godot folder #72226

FireCatMagic opened this issue Jan 28, 2023 · 2 comments · Fixed by #72444

Comments

@FireCatMagic
Copy link

Godot version

v4.0.beta16.official

System information

Windows 7 64-bit

Issue description

What should happen:
Extensions of custom classes should work with no hassle when a project is imported
What actually happens:
Extensions of custom classes are invalid and must manually be redefined by changing the name and then undoing the change

Why this is an issue:
Sharing a project over git does not include the .godot folder. Something in the folder is what causes these custom class extensions to be registered for your local copy. So without it, these don't apply in the cloned project

Steps to reproduce

  1. First, create a new class. In my example I have created a class called MyClass.
    image
  2. Then, extend this class.
    image
  3. (Optional) Extend that class again to demonstrate the error
    image

I've put these 3 nodes in a scene, they all work
image
Classes show up in the node creation menu
image

  1. Exit the project and delete the .godot folder
    image
  2. Relaunch the project
    Upon relaunching, it'll display this error:
    image

The extension of the custom class is also gone from the node creation scene. It's now invalid.
image

  1. Change the name of the class then remove the name
    image
    I added an "H" to the end
    image
    It's returned!
    image
    Upon removing the H, the class returns to how it was before.
    It's not that big of a hassle for a single script to go and rename the classes over again and then undo it, but for big projects this can get incredibly irritating.
    For example, I recently sent my friend a copy of a project over git. It relies on a lot of custom classes, so when he opened it, he was surprised to find them invalid and had to go and manually alter the names of around 10 classes so he could alter the project.

Minimal reproduction project

CustomClassIssue.zip

@akien-mga
Copy link
Member

Duplicate of #72154

@reduz
Copy link
Member

reduz commented Jan 31, 2023

Not a duplicate, this was caused by #71634. I will write a fix shortly.

@reduz reduz reopened this Jan 31, 2023
@akien-mga akien-mga added this to the 4.0 milestone Jan 31, 2023
@github-project-automation github-project-automation bot moved this from To Assess to Done in 4.x Priority Issues Jan 31, 2023
Streq pushed a commit to Streq/godot that referenced this issue Feb 9, 2023
* Broke with godotengine#72226
* Restored previous version of the code, made it even more error tolerant.
* Added a warning to **not** change the code.

Fixes godotengine#72226.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants