Jump to content

Is there a way to set the display flag of new OPs as soon as they are


magneto

Recommended Posts

I find it most of the times when I create new OPs inside the Network View, I have to turn their Display flag manually.

Is there a way to have this behavior automatically so whenever I add a new OP to an existing tree, it automatically turns it on?

Thanks.

Link to comment
Share on other sites

not sure about that -

but i was once in an environment where they set up hotkeys for new

artists - so if the artist hit F12 - the SOP called 'OUT' was set

to display and the SOP called 'RENDER' -(nulls) was set to render.

done with the opset command in HScript

ie opset -d on /obj/geo1/null*

this could be looped over the whole scene or in a certain context.

not sure how the hotkey was linked to the HScript - but im sure its possible.

*EDIT*

ok - i made a new shelf tool with the opset script in there,

made sure the script was set to Hscript instead of pthon - and assigned a hot key to it

in the shelf tool options.

Edited by daniel.phillis
Link to comment
Share on other sites

At home I personally use an OnInputChanged python event handler that when run, detects if the new connection is with a node who has its display/render flags set. If the node does, it sets the flags on the newly connected node.

The code I run is just a call to my nodeutils.py module's changeFlagsOnWiring(): http://houdinitoolbox.com/houdini.php?asset=38

As for changing flags based on names, that's easy enough to do with an OnNameChanged event handler where you just look up the new name into some predetermined table.

Edited by graham
  • Like 2
Link to comment
Share on other sites

You can put the file on the site somewhere like $HOME/houdiniX.Y/scripts/python/, as well as create the file $HOME/houdiniX.Y/scripts/OnInputChanged.py and put the following in that file:

import nodeutils
node = kwargs["node"]
nodeutils.changeFlagsOnWiring(node)

  • Like 2
Link to comment
Share on other sites

  • 9 years later...

Hello 

Thank you Graham!

I got the toolbox on the GitHub link, and I'm using python 2.7 version.

I just wanted to install it through packages and I used "houdini-toolbox.json" provided inside and set the path to the installation directory.

It was like :

{
    "path" : "E:/App/Houdini/1.    plugins/Houdini-Toolbox-python2.7/houdini",
    "env": [
        {
            "HOUDINI_TOOLBOX_DIR": "E:/App/Houdini/1.    plugins/Houdini-Toolbox-python2.7"
        },
        {
            "PYTHONPATH":"E:/App/Houdini/1.    plugins/Houdini-Toolbox-python2.7/python"
        }
    ]
}

 

but nothing shows in Houdini (18.5).

especially I was searching for "nodeutils.py" to change display flag on wiring as you suggested but couldn't find this script in the installation folder.

would you please help to figure this out?

thank you again

 

 

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...