-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
GDScript "Parse Error: Script export type must be a global class." regression in HungryProton Scatter plugin #93168
Comments
This is intentional, the inspector only supports global classes. Previously in GDScript there was an inconsistency between Also, it's documented:
Alternatively, we could use a native class instead, if the script is not a global class. |
I confirm that the following change fixes the issue for the Scatter plugin: diff --git a/addons/proton_scatter/src/modifiers/base_modifier.gd b/addons/proton_scatter/src/modifiers/base_modifier.gd
index 244d465..3c30edb 100644
--- a/addons/proton_scatter/src/modifiers/base_modifier.gd
+++ b/addons/proton_scatter/src/modifiers/base_modifier.gd
@@ -1,4 +1,5 @@
@tool
+class_name BaseModifier
extends Resource
# Modifiers place transforms. They create, edit or remove transforms in a list,
diff --git a/addons/proton_scatter/src/stack/modifier_stack.gd b/addons/proton_scatter/src/stack/modifier_stack.gd
index 3b46123..65c2afe 100644
--- a/addons/proton_scatter/src/stack/modifier_stack.gd
+++ b/addons/proton_scatter/src/stack/modifier_stack.gd
@@ -9,7 +9,6 @@ signal transforms_ready
const ProtonScatter := preload("../scatter.gd")
const TransformList := preload("../common/transform_list.gd")
-const BaseModifier := preload("../modifiers/base_modifier.gd")
@export var stack: Array[BaseModifier] = [] There main problem I see is that plugins tend to avoid using I suspect we'll find more addons with similar broken compatibility with 4.3 after this change. I'm not sure telling all the plugin authors to use For example @shakesoda already mentioned that the Spatial Gardener plugin seems to have the same issue. |
If there were a way to tell Godot that a class is not meant to be exposed to the end user, I'd be more than happy to use global class names everywhere. I avoid class_names for nodes because I don't want them to show up in the This one is an exported resource so I guess I can make the fix on my end. |
Tested versions
System information
Fedora Linux 40 (KDE Plasma) - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 7600M XT (RADV NAVI33) - AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (16 Threads)
Issue description
When opening a project using the https://github.com/HungryProton/scatter addon (installed from the asset lib), the following errors are printed:
This is a recent regression which doesn't appear in 4.3-beta1.
Steps to reproduce
Minimal reproduction project (MRP)
testscatter.zip
The text was updated successfully, but these errors were encountered: