Skip to content

Disable node processing completely to avoid issues with tool scripts#37

Draft
ryevdokimov wants to merge 1 commit into4d49:masterfrom
Open-Industry-Project:disable-node-processing
Draft

Disable node processing completely to avoid issues with tool scripts#37
ryevdokimov wants to merge 1 commit into4d49:masterfrom
Open-Industry-Project:disable-node-processing

Conversation

@ryevdokimov
Copy link
Contributor

In my project I have some scenes that don't inherit the processing of their parent, so tool scripts end up running despite the fact that this addon disables the processing of the viewport for generating thumbnails. This can cause a lot of weird issues such as the real scene and thumbnail scene trying to reference nodes from each other causing errors at the engine level.

Comment on lines +1073 to +1076
node.set_process_mode(Node.PROCESS_MODE_DISABLED)

for child in node.get_children():
_disable_node_processing(child)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the forced assignment of PROCESS_MODE_INHERIT is better, since if it is already assigned, then nothing will happen(c++ code under the hood of the engine).

Also, the get_children method is quite expensive (at least my old tests showed it).

Suggested change
node.set_process_mode(Node.PROCESS_MODE_DISABLED)
for child in node.get_children():
_disable_node_processing(child)
node.set_process_mode(Node.PROCESS_MODE_INHERIT)
for i: int in node.get_child_count(true):
_disable_node_processing(node.get_child(i))

@ryevdokimov
Copy link
Contributor Author

I'm going to see if I can get this resolved at the engine level, so will put this PR on hold.

godotengine/godot-proposals#12647

and

godotengine/godot#107817

@ryevdokimov ryevdokimov marked this pull request as draft June 21, 2025 20:37
@4d49
Copy link
Owner

4d49 commented Jun 22, 2025

@ryevdokimov also think that in the future we will have to consider switching to the built-in thumbnail generation in the 4.5 version of the engine.

@ryevdokimov
Copy link
Contributor Author

That feature won't be in 4.5 anymore, it was reverted due to issues, but yeah that was partially the reason I decided to open up the PR for the engine since it will apply to either scenario (this add-on, or built-in thumbnail generation).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants