godot
godot copied to clipboard
Improve Visual Shader
As requested by @Mickeon in #93791, I went ahead and separated some code improvements away from some comments improvements.
Some of these don't look like error cases, but early returns to optimize the code. These should not use the error macros, as they log to console whenever they happen. Ome such example seems to be checking if the class is the same in replace_node. Or can_connect_nodes checking for the same node.
Also if a condition is not clearly readable, ideally use the _MSG variant to explain the condition so that users aren't confused about why it errors.
Make sense. Some of these conditions aren't actually failures you mean. Thank you for the clarification. I consider my Visual Shader PRs as a playground for now until they become valuable.