(de)activating nodes via parameter interface

   4574   10   1
User Avatar
Member
237 posts
Joined: June 2006
Offline
Hi,
how could I deactivate nodes via the edit parameter interface?

in detail:
in a nullnode used as a controller for different parameters I want be able to (de)activate specific nodes for debugging purposes. How could I realize that?

Thanks in advance,

cheers
Edited by Follyx - Feb. 15, 2021 05:50:24
User Avatar
Member
209 posts
Joined: March 2018
Offline
You can create a button and then create a callback script which let you write proper Python or HScript code for doing that.
User Avatar
Member
856 posts
Joined: Oct. 2008
Offline
You can also do it in a list view.
--
Jobless
User Avatar
Member
237 posts
Joined: June 2006
Offline
could anyone show me the right direction with HOUscript and/or python?
An example would be great. No experience in this art.
User Avatar
Member
237 posts
Joined: June 2006
Offline
No one who could help me with these scripts?
Edited by Follyx - Feb. 20, 2021 03:37:06
User Avatar
Member
237 posts
Joined: June 2006
Offline
Noone who could help me with these scripts? That would be fastastic
Edited by Follyx - Feb. 20, 2021 03:38:12
User Avatar
Member
856 posts
Joined: Oct. 2008
Offline
It's not great but a start.

Attachments:
togglebypass.hiplc (62.2 KB)

--
Jobless
User Avatar
Member
575 posts
Joined: Nov. 2005
Offline
Hi
the function to bypass a node in python is:
hou.node("/obj/geo/node").bypass(1) to set it inactive and hou.node("/obj/geo/node").bypass(0) to activate it again.
What You would need is basically a list of nodes that You can iterate over to activate/deactivate.

You can create for example shelf scripts in houdini and use this here, but to create a tool, that does not need more work all the time to adjust it, it does need some more effort.
- How do You want to maintain that list ( picking, typing )?
- Where does the list live? ( global, on a node in a network )?
- What happens if You delete or copy a node that is in the list?
- Does the tool manage nodes in one network or do You want to control other networks as well?

When You interest stays in one network, the group window in the network editor is probably Your best option.

After all this You have to ask: Is it worth it If You need a just a quick tool to get it done I guess the node group window is Your friend. If You want to get into Python and the hou thing. Go for it, this is a good exercise. There are a some places where You can place Your tools. You can create a Node that holds the functionality or the shelf.
The advantage of a node is You get a parameter interface, where You could store Your list as a string attribute and it is a perfect place for code and buttons as well.

I hope I could help
User Avatar
Member
8524 posts
Joined: July 2007
Online
If this is for HDA, the common practice is to use Switch or SwitchIf SOP to turn parts of the network On/Off
Then it's as easy as promoting the parameter and turning it into a toggle, you can also use it for non-hda setups as they also make it easy to debug stuff as you can visually see the topology of the network

And also in case of HDA you would not be able to bypass internal nodes using bypass flag once is locked, not even with python
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
237 posts
Joined: June 2006
Offline
Thanks for all the replies. Well I really would use it internaly for debuggin purposes. No cosmetic for the UI etc. Just as simple as possible. I just want to have a check or list box with the nodes I want to (de)activate. Just a simple script or something else would be great.
User Avatar
Member
575 posts
Joined: Nov. 2005
Offline
Maybe something like this, drag'n'drop nodes into the node string parameter field and press on or off
it is a hdanc otl, so it will turn Your session into a non commercial one. But it should not take long to rewrite it as normal hda
Edited by sanostol - Feb. 21, 2021 05:56:53

Attachments:
bypassIt.hdanc (4.4 KB)

  • Quick Links