Context Options Block

   3606   3   3
User Avatar
Member
2 posts
Joined: 2月 2017
オフライン
Hello

Currently, I'm making the transition from katana to solaris and a noob Houdini user at the same time.

In katana, there's a node called "variable enabled group [learn.foundry.com]" which I find very useful for organising nodes and handling certain exceptions.

Maybe I've completely misunderstood it but It looks like Context Options Block does a similar thing; containing certain operations within the block and executes if an option value matches a predefined value.

I've read the documentation multiple times and try to make the node does what I'm hoping it does, but so far no success.

here's my mock-up scene, could anyone point out what I'm doing wrong, please?


Attachments:
Screenshot 2021-04-19 141621.jpg (67.7 KB)
Context_Options_Block.hiplc (268.3 KB)

User Avatar
Member
250 posts
Joined: 10月 2014
オフライン
Context Options Blocks won't really do what the VEG does in Katana. You can roll your own though...

Here is the general idea to get you started:

1. Create a subnet
2. right-click > Parameters and Channels > Create Activation Parameter. This is important and very distinct from the node's bypass flag. De-activating the node using this parm gets you the same result as bypassing, but lets the node reactivate itself (since that parm can take an expression)
3. Expression-drive this activation parm with whatever logic you want (e.g. if hou.contextOption('asset') == "tommy")
4. put whatever you want in the subnet, and those nodes will be included in the cook if the node activates
5. I'd recommend making an HDA out of it

I was also looking for a VEG equivalent in Solaris and didn't find one, but once I found that handy activation parameter it was smooth sailing.
Edited by Tim Crowson - 2021年4月20日 12:53:25
- Tim Crowson
Technical/CG Supervisor
User Avatar
Member
2 posts
Joined: 2月 2017
オフライン
Hi Tim, Thanks for the idea.

I kinda follow what you're saying, but get lost where the code is.
would you mind making the node you're talking about and share the file, please?

Thanks

Jun
User Avatar
Member
250 posts
Joined: 10月 2014
オフライン
Here is a quick mockup. The specific implementation and logic will have to be up to you of course, depending on your needs, but this is general idea. The subnet in this example is inactive unless you go to the Context Options editor and switch to 'Pighead'. When that happens, the subnet activates, causing whatever is inside it to contribute to the cook.

The logic driving the activation can be explicit (i.e. the context option equals some value exactly), or you can use hou.text.patternMatch to specify multiple conditions for activation.
Edited by Tim Crowson - 2021年4月24日 17:10:28

Attachments:
smart_subnet.hipnc (241.1 KB)

- Tim Crowson
Technical/CG Supervisor
  • Quick Links