Giter Site home page Giter Site logo

Comments (3)

dalexeev avatar dalexeev commented on September 24, 2024 5

This is intentional, the inspector only supports global classes. Previously in GDScript there was an inconsistency between SCRIPT and CLASS datatypes.

Also, it's documented:

Note: Custom resources and nodes must be registered as global classes using class_name.

Alternatively, we could use a native class instead, if the script is not a global class.

from godot.

akien-mga avatar akien-mga commented on September 24, 2024 2

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 class_name to avoid polluting the game's namespace with plugin-internal classes. I suppose this is why @HungryProton used preloads for these instead of class_name.

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 class_name instead will be a satisfactory option for all.

For example @shakesoda already mentioned that the Spatial Gardener plugin seems to have the same issue.

from godot.

HungryProton avatar HungryProton commented on September 24, 2024

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 Create new node window unless the plugin is actually enabled (otherwise these nodes don't work properly).

This one is an exported resource so I guess I can make the fix on my end.

from godot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.