Avoid popup for hou.NodeWarning()

   4401   2   1
User Avatar
Member
16 posts
Joined: June 2014
Offline
Hi all,
I have got a simple Python node in Houdini 12.5 and would like to show a warning on certain occasions.
Now, when I call
raise hou.NodeWarning(“Warning”)
from the Code section, my node gets that yellow and black frame and I can see the warning when I click on the node with the middle mouse button.
This also happens when I call a Script from my Code section, i.e.
hou.node(“.”).hdaModule().warningFromCode()
But here is the problem:
Whenever I try to raise a warning triggered from the Callback Script of a parameter, it does not show the yellow/black frame, but instead opens up a popup window with some ugly warning output.
Is there any way to redirect that so that I get the node frame and not the popup window?

Attached you can find a simple example.

I'd really appreciate any help.

Thanks

Attachments:
warnings_test.hip (54.8 KB)

User Avatar
Member
7 posts
Joined: June 2016
Offline
Hello, may I bump this message up ? I have the same problem in my HDA, and I'm not too familiar with error handling and python and/or houdini
User Avatar
Staff
1255 posts
Joined: July 2005
Offline
The yellow/black warning frame around nodes is tied to cooking. So if you raise a hou.NodeWarning() exception while the node is cooking then that will create the warning on the node.

A parameter callback (i.e. callback script) however executes separately from when the node cooks so any exceptions raised during execution of the callback produces a general Python error and hence the error dialog popping up. There is no way to set the warnings or errors on a node when it is not cooking so my suggestion is if you do not want the popup dialog then gracefully handle any errors without raising exceptions or print out any errors to stdout instead.

Cheers,
Rob
  • Quick Links