Godot: [Regression since beta 11, bda60bf] Can't add a custom class (class_name) via editor, if it extends another custom class.

Created on 6 Mar 2019  路  13Comments  路  Source: godotengine/godot

Godot version:

3.1.11

OS/device including version:

Windows 10 64bit

Issue description:

Cant add a custom class_name node from the inspector if it extends from another class_name class. It also shows no icon in the editor. Adding a normal node and then adding the script manually works. Error code:
ERROR: instance: Condition ' !ti ' is true. returned: __null At: core/class_db.cpp:512 ERROR: _create: Condition ' !c ' is true. At: editor/scene_tree_dock.cpp:1698

Steps to reproduce:

Try to add "ClassTwo" to the scene via editor

Minimal reproduction project:

Test.zip

bug gdscript

Most helpful comment

Regression from f669ebeeaf75a00b4c66dc92f62bd5030cb11660, CC @reduz.

f669ebeeaf75a00b4c66dc92f62bd5030cb11660 is the first bad commit
commit f669ebeeaf75a00b4c66dc92f62bd5030cb11660
Author: Juan Linietsky <[email protected]>
Date:   Tue Feb 26 18:43:37 2019 -0300

    -Properly handle missing ETC support on export
    -Added ability for resource importers to save metadata
    -Added ability for resource importers to validate depending on project settings

:040000 040000 6b119a5ab359ee8bdc27fd1bbf0cad0e5f7c2554 aa674f59d899d59d5e4c05277dc3b5078e4024fd M      core
:040000 040000 f16a25922520502cd77ed8ebe60a26a4ceb60d57 11586734a6ee4efe9c5a464b914fa3a5ca07d1c3 M      editor
:040000 040000 529253feb6976a0156185448c733a8e5df145f34 74d09318a46a2795dba4f4919f99bdefc0baeaea M      modules
:040000 040000 4f16fe5ff5d2deb0007832a98d37f01a6f1cc8b0 65c7c673685e24765f9e81dbd90c027cd60b6844 M      platform
:040000 040000 ab8d3d3c28578a0f18488c85f2235ff4efb6d767 ec51e3f53a7f3d689cdf9e47af66eeff6fda0d03 M      servers

$ git bisect log
git bisect start
# good: [a32b26dfa26f2a039bf9c84b90d10666bcf785c9] Several fixes to make GLES2 on HTML5 work much better. Changed math class error reporting to be a bit less paranoid.
git bisect good a32b26dfa26f2a039bf9c84b90d10666bcf785c9
# bad: [a5370b1b1bed3744941c90b4a05d4516aabd4c67] -Fix problem of order of import plugins, closes #26340 -Ensure resource previewer does not start until first import is done
git bisect bad a5370b1b1bed3744941c90b4a05d4516aabd4c67
# bad: [464e1142c48da5d24fb9d2462b707b695f9b5adc] Don't crash on previewing an AtlasTexture without a region
git bisect bad 464e1142c48da5d24fb9d2462b707b695f9b5adc
# good: [7f289304af9484ad3aa145adc221d5b12608d539] Fix #26100 by casting to integer.
git bisect good 7f289304af9484ad3aa145adc221d5b12608d539
# bad: [f669ebeeaf75a00b4c66dc92f62bd5030cb11660] -Properly handle missing ETC support on export -Added ability for resource importers to save metadata -Added ability for resource importers to validate depending on project settings
git bisect bad f669ebeeaf75a00b4c66dc92f62bd5030cb11660
# good: [aea5980f012c1094b116a1bcb4c37e63a83e4ecc] Merge pull request #26314 from jahd2602/export-icon-dpi-fix
git bisect good aea5980f012c1094b116a1bcb4c37e63a83e4ecc
# good: [3b0f3016609d4915b430738125b85a16188f1691] Merge pull request #26312 from ericrybick/master
git bisect good 3b0f3016609d4915b430738125b85a16188f1691
# first bad commit: [f669ebeeaf75a00b4c66dc92f62bd5030cb11660] -Properly handle missing ETC support on export -Added ability for resource importers to save metadata -Added ability for resource importers to validate depending on project settings

All 13 comments

same here! Can we not move it to milestone 3.1 ? Since 3.1 introduced the class_name customization might be consistent to make this work, maybe ?

I am not sure it worked before beta11 though, did it, @DavidMannes ?

Same here. Is there a workaround?

If you save a PackedScene with a Node with a script that extends the another custom node ?

Yeah, workaround would be to make a scene with one node or as i said in OP, its possible to add a normal node and then attach the script to it, like you would do in 3.0 and before.

I tried to locate the error and it seems that 01a3dd389cc84b9a059fe8e45f2d51ce1d69eebc is the cause, before that its fine and after that its bugged.
@reduz

I tried to locate the error and it seems that 01a3dd3 is the cause, before that its fine and after that its bugged.

That's clearly not possible, this code is only rendering in GLES2.

The bug isn't there in 3.1.8, but in 3.1.9 it is, so i looked at https://github.com/godotengine/godot/compare/a32b26dfa26f2a039bf9c84b90d10666bcf785c9...a5370b1b1bed3744941c90b4a05d4516aabd4c67 to find the time when the bug appeared, but apparently that doesnt including every change or they arent sorted by date.

I can confirm that used to work in beta8 but not beta9 forward

Thanks, I'll bisect between a32b26d and a5370b1 to see what caused it.

I double checked on my mac, and it actually doesn't work on beta8. But it does on beta7.
Can someone else confirm ?

I double checked on my mac, and it actually doesn't work on beta8. But it does on beta7.

It works fine for me with both beta7 and beta8 on Linux.

Bug is on Windows since beta9, but Linux 64bit beta8, beta9 and beta11 are fine.

Regression from f669ebeeaf75a00b4c66dc92f62bd5030cb11660, CC @reduz.

f669ebeeaf75a00b4c66dc92f62bd5030cb11660 is the first bad commit
commit f669ebeeaf75a00b4c66dc92f62bd5030cb11660
Author: Juan Linietsky <[email protected]>
Date:   Tue Feb 26 18:43:37 2019 -0300

    -Properly handle missing ETC support on export
    -Added ability for resource importers to save metadata
    -Added ability for resource importers to validate depending on project settings

:040000 040000 6b119a5ab359ee8bdc27fd1bbf0cad0e5f7c2554 aa674f59d899d59d5e4c05277dc3b5078e4024fd M      core
:040000 040000 f16a25922520502cd77ed8ebe60a26a4ceb60d57 11586734a6ee4efe9c5a464b914fa3a5ca07d1c3 M      editor
:040000 040000 529253feb6976a0156185448c733a8e5df145f34 74d09318a46a2795dba4f4919f99bdefc0baeaea M      modules
:040000 040000 4f16fe5ff5d2deb0007832a98d37f01a6f1cc8b0 65c7c673685e24765f9e81dbd90c027cd60b6844 M      platform
:040000 040000 ab8d3d3c28578a0f18488c85f2235ff4efb6d767 ec51e3f53a7f3d689cdf9e47af66eeff6fda0d03 M      servers

$ git bisect log
git bisect start
# good: [a32b26dfa26f2a039bf9c84b90d10666bcf785c9] Several fixes to make GLES2 on HTML5 work much better. Changed math class error reporting to be a bit less paranoid.
git bisect good a32b26dfa26f2a039bf9c84b90d10666bcf785c9
# bad: [a5370b1b1bed3744941c90b4a05d4516aabd4c67] -Fix problem of order of import plugins, closes #26340 -Ensure resource previewer does not start until first import is done
git bisect bad a5370b1b1bed3744941c90b4a05d4516aabd4c67
# bad: [464e1142c48da5d24fb9d2462b707b695f9b5adc] Don't crash on previewing an AtlasTexture without a region
git bisect bad 464e1142c48da5d24fb9d2462b707b695f9b5adc
# good: [7f289304af9484ad3aa145adc221d5b12608d539] Fix #26100 by casting to integer.
git bisect good 7f289304af9484ad3aa145adc221d5b12608d539
# bad: [f669ebeeaf75a00b4c66dc92f62bd5030cb11660] -Properly handle missing ETC support on export -Added ability for resource importers to save metadata -Added ability for resource importers to validate depending on project settings
git bisect bad f669ebeeaf75a00b4c66dc92f62bd5030cb11660
# good: [aea5980f012c1094b116a1bcb4c37e63a83e4ecc] Merge pull request #26314 from jahd2602/export-icon-dpi-fix
git bisect good aea5980f012c1094b116a1bcb4c37e63a83e4ecc
# good: [3b0f3016609d4915b430738125b85a16188f1691] Merge pull request #26312 from ericrybick/master
git bisect good 3b0f3016609d4915b430738125b85a16188f1691
# first bad commit: [f669ebeeaf75a00b4c66dc92f62bd5030cb11660] -Properly handle missing ETC support on export -Added ability for resource importers to save metadata -Added ability for resource importers to validate depending on project settings

It turns out that the bug is not caused by f669ebe, but by a later commit (probably bda60bf).
f669ebe just changed the name of the filesystem cache file, and if it has been generated by a commit after bda60bf, the bug appears (it's not re-created when using an older commit).

If you delete the filesystem_cache5 file in %APPDATA%/Godot/projects/<project name>-<hash>/, it should work fine in beta 9 or beta 10, but start failing in beta 11.

Was this page helpful?
0 / 5 - 0 ratings