You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
When making a new scene and giving it a script, I prefer to use class_name so that other scripts can get access to the class by its name. As time goes by, the project started being larger and larger, with nodes headed with class_name shown more and more in the node dock when I want to create a new node, which is annoying because I have to surf through tons of nodes and select one I want. However, the actual situation is that some nodes are unnecessary to get displayed in the dock, but they keep class_name as the head assignement so that every node can have access to the script via its name following class_name, which is convenient.
So, how to make both situation together standing?
class_name keeps still in the script
the class extending from Node assigned with the keyword won't be shown in the node dock
Describe the feature / enhancement and how it helps to overcome the problem or limitation
So we can implement a new annotation @hide_global that modifies the keyword class_name, so that the node will have no displaying in the dock window.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
When you have written a script extending from Node with class_name, just put the annotation @hide_global ahead of it.
extendsNode
@hide_global
class_nameTestClass
...
After the assignment, you will see the node not shown in the dock anymore
If this enhancement will not be used often, can it be worked around with a few lines of script?
I don't think it will get less used; instead, I believe most people want this feature implemented
This implement is not coverable with some lines of code; instead, before we have this, we need to extend a node via its file path, and when we need to get access to the class, we need a const or var to preload() or load() its path and use the identifier as its name of access, which is very complex to operate.
Is there a reason why this should be core and not an add-on in the asset library?
First, most of the people want this feature implemented, so that they can not only get rid of disgusting nodes displaying in the dock, but also keep class_name work, make the script/class extendable and improve the convenience of operation of access to other classes
The text was updated successfully, but these errors were encountered:
Lazy-Rabbit-2001
changed the title
Annotation to hide node with class_name displaying in the node dock
Annotation to Hide Node with class_name Displaying in the Node Dock
Jul 22, 2023
#1047 proposes the same solution but with a different name (@no_editor annotation). Let's close this so as not to fragment the discussion even more. Thanks for your contribution nonetheless.
Describe the project you are working on
A random 2D project, with
class_name
highly used.Describe the problem or limitation you are having in your project
When making a new scene and giving it a script, I prefer to use class_name so that other scripts can get access to the class by its name. As time goes by, the project started being larger and larger, with nodes headed with
class_name
shown more and more in the node dock when I want to create a new node, which is annoying because I have to surf through tons of nodes and select one I want. However, the actual situation is that some nodes are unnecessary to get displayed in the dock, but they keepclass_name
as the head assignement so that every node can have access to the script via its name followingclass_name
, which is convenient.So, how to make both situation together standing?
class_name
keeps still in the scriptDescribe the feature / enhancement and how it helps to overcome the problem or limitation
So we can implement a new annotation
@hide_global
that modifies the keywordclass_name
, so that the node will have no displaying in the dock window.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
When you have written a script extending from Node with
class_name
, just put the annotation@hide_global
ahead of it.After the assignment, you will see the node not shown in the dock anymore
If this enhancement will not be used often, can it be worked around with a few lines of script?
const
orvar
topreload()
orload()
its path and use the identifier as its name of access, which is very complex to operate.Is there a reason why this should be core and not an add-on in the asset library?
First, most of the people want this feature implemented, so that they can not only get rid of disgusting nodes displaying in the dock, but also keep
class_name
work, make the script/class extendable and improve the convenience of operation of access to other classesThe text was updated successfully, but these errors were encountered: