Node class: editor-specific notifications #5598
ReturnMinusOne
started this conversation in
Scripting
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm working on a Godot add-on where multiple instances of a custom class keep references to each other.
These objects are manipulated in the editor.
When one of them is created (by clicking a button in the add-on's interface) or removed (with the Delete key) by the user, any related objects need to update their references.
A few notifications might technically work here:
NOTIFICATION_PARENTED
/UNPARENTED
, as well asNOTIFICATION_ENTER_TREE
/EXIT_TREE
.The problem is that these constants apply to other events as well, like when the scene is opened or closed. And because these events can take place in the editor, the problem can't be solved by checking
Engine.editor_hint
.I would suggest two new constants:
NOTIFICATION_EDITOR_INSTANCED
NOTIFICATION_EDITOR_REMOVED
These notifications should also be emitted when the object is re-instanced or re-removed by an UndoRedo object.
Beta Was this translation helpful? Give feedback.
All reactions