Jump to content
Sign in to follow this  
Neon Junkyard

customizing netbox creation and other UI commands

Recommended Posts

There are a few quality of life things I would like to customize in houdini but I'm not sure if its possible

If you create a network box in houdini it makes it completely snug around your nodes and I am constantly having to immediately resize it and reposition everything, In nuke I have it set up to auto-create backdrops with 200px or so padding automatically, is this possible in Houdini?

This problem is made worse due to houdini will automatically select the network box and all its contents if your mouse goes anywhere over the title bar.  So if you are drag selecting nodes across several network boxes it will select the entire contents of all of them.   Again Nuke handles this way better, it will only select the entire network box if you drag select over the entire thing, or specifically click on the title bar

The second part I dont have much hope for but is there any python solution to create netboxes with padding, and maybe further customization?

 

EDIT - Also looking to set some defaults when creating new scene views

Edited by Neon Junkyard

Share this post


Link to post
Share on other sites

Hey man, 

Have a look at this code on how to resize a network box in Python:

if hou.selectedNodes():
    sel = hou.selectedNodes()[0]
    pos = sel.position()
    
    parent = sel.parent()
    box = parent.createNetworkBox()
    box.setPosition(sel.position())
    box.addNode(sel)
    box.setColor(hou.Color(0.5, 0.2, 0.5))
    bbox = hou.BoundingRect(pos[0] - 4, pos[1] - 1, pos[0] + 5, pos[1] + 1)
    box.setBounds(bbox)

cheers,
Manu

Share this post


Link to post
Share on other sites
On 11/20/2018 at 4:09 PM, asnowcappedromance said:

Hey man, 

Have a look at this code on how to resize a network box in Python:


if hou.selectedNodes():
    sel = hou.selectedNodes()[0]
    pos = sel.position()
    
    parent = sel.parent()
    box = parent.createNetworkBox()
    box.setPosition(sel.position())
    box.addNode(sel)
    box.setColor(hou.Color(0.5, 0.2, 0.5))
    bbox = hou.BoundingRect(pos[0] - 4, pos[1] - 1, pos[0] + 5, pos[1] + 1)
    box.setBounds(bbox)

cheers,
Manu

awesome! This is a great starting point, thanks for that

Share this post


Link to post
Share on other sites

This is a great starting point but I cant figure out how to get the network box to resize to selected nodes, like the default behavior does

currently the bounding box is hard coded, how would I code it to resize to fit all the selected nodes on creation?

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×