Jump to content

Disappearing network editor background image - Python


Recommended Posts

Hello,

When I copy and run the following code in a python sop node,

editor = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor)
image = hou.NetworkImage()
image.setPath('$HFS/houdini/pic/Mandril.pic')
image.setRect(hou.BoundingRect(0, 0, 5, 5))
editor.setBackgroundImages([image])

(which can be found here in the sideFX documentation: https://www.sidefx.com/docs/houdini/hom/hou/NetworkImage.html )

it does indeed create the background image in the network editor. However, should you change context and then go back to the sop context where you created the background image (example: /obj/geo/python >>> /out >>> /obj/geo/python), it will have disappeared. This doesn't happen when creating the background image through the network editor's dedicated button, but I need to be able to do it with python, because I'm setting up a shelf tool template that would need to do this. Any idea why the image is disappearing with the python script?

Thanks

 

Attached is a simple scene with the python node set up. Just activate the python node, see the background image pop in place, change context, go back, and see that the background image has disappeared.

background_image.hip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...