Godot Version
v4.3.stable.mono.official [77dcf97d8]
Question
Is it possible to stop propagation of the _process (NOTIFICATION_PROCESS) signal?
Looking at the engine code, it does not appear to be possible with modifying the engine.
Signal Propagation:
scene/main/node.cpp: 2445 - 2454
void Node::propagate_notification(int p_notification) {
ERR_THREAD_GUARD
data.blocked++;
notification(p_notification);
for (KeyValue<StringName, Node *> &K : data.children) {
K.value->propagate_notification(p_notification);
}
data.blocked--;
}
Signal Calls _process:
scene/main/node.cpp: 52 - 56
void Node::_notification(int p_notification) {
switch (p_notification) {
case NOTIFICATION_PROCESS: {
GDVIRTUAL_CALL(_process, get_process_delta_time());
} break;
//...
Extra Info
I am looking at this because I am implemeting time scaling. I would like to cancel the default NOTIFICATION_PROCESS signal at a given node, and then send a new signal:
GDVIRTUAL_CALL(_process, time_scale * get_process_delta_time());
I would prefer to be able to do this in a C# script. I understand that the community has decided not to implement per node time scaling directly in the engine. If we had an official way to interrupt built-in signals, it would enable some interesting possibilities.
If I can’t do this in a script, is there a way I can write a C++ addon to do it? I have not touched C++ in 10+ years.
Thank you!