Why is there no "notified" signal, or something similar, on objects?

Godot Version

4.4

Question

I’ve been digging through engine code trying to figure out how to get a plugin to get a notification for NOTIFICATION_EDITOR_PRE_SAVE. I couldn’t find anything. I ended up implementing my own in our version of the engine. This got me thinking though, how come there is no built in way to get notifications sent to another node? If that were the case I could have just subscribed to each scene root and listened for that notification. Is there a reason that this doesn’t exist? It seems like it could be a feature for objects to enable/disable notification signaling.

I’m confused. What is wrong with this?

func _notification(what):
	if what == NOTIFICATION_EDITOR_PRE_SAVE:
		print("Saving")
	pass
3 Likes

EditorPlugin does not receive that notification. It’s easy enough to do a quick engine change and send editor plugins a pre scene saved signal, since it already has scene_saved implemented. However it would be a boon in general to know when a particular OTHER node is notified of something, WITHOUT placing a custom script on that object.