Many built-in nodes show warnings when there is a bad input value. For example, the Mesh Circle
node warns when the passed in number of vertices is too low.
We want node groups to be able to create their own warnings. This document proposes a new Warning
output node. If the Show
input is true, the Message
appears on the calling group node. This would allow the node group author to implement custom checks for invalid inputs.
While this node itself is fairly simple, the tricky part is to decide when its Show
input should be evaluated. We don’t always want to evaluated it in all nested Warning
nodes, because that would also cause evaluation of parts in the node tree that is currently unused.
For example, in this case the Generate Mesh
node would always be evaluated for both seeds regardless of the Switch
.
This document proposes that the Warning
node is only evaluated if any group output is actually required. This loosely matches the behavior of built-in nodes as well. This would solve the issue shown above, because in one of the groups the geometry output is not required.
Future Improvements
The described behavior can still result in more evaluation than desired though. Therefor, it may become necessary to use a more fine-grained heuristic in the future. For example, the warning node might only be evaluated if one group output of a subset of all group outputs is used. The mapping from warning node to the set of group outputs could be manual or somewhat automatic based on what group inputs they depend on.
Warnings might require different severity levels (info/warning/error) but we need some good definitions for when to use what first.
By default, warnings propagate all the way up to the modifier, but it might be useful to be able to quiet warnings on a per node or group node basis to avoid spamming the caller with potentially useless warning messages.