Invoke graph a Subnetwork with a Parallel for Compile Block
1342 9 1-
- alecaille
- Member
- 41 posts
- Joined: Dec. 2014
- Offline
Is it possible to create a graph from this subnetwork, using Attribute From Parameters SOP, then invoke it, using the multithreaded execution ?
I can only get the result of the last iteration when doing a repeated rotation of the input N times, using By Count/ Merge
The Transform is reading the iteration count from its Spare Input 0 ( detail(-1,"iteration",0) )
For the invocation setup, I group the Compile_begin and Compile_end nodes in begin / end, or even just the foreach_begin / foreach_end in a subnetwork that doesn't even include the Compiled Block around the for_each block
The reason I want to indirectly call the subnetwork, is that I wanted to experiment with meta programming on the output of Attribute From Parameters, try and optimize some meta parameters. The output being basically a program in text form, even a proper graph, the end goal would be to add some code in between and modify the code. But I'm not there yet as I can't really call a simple program that contains a loop. Any thoughts ? Should I skip this and go to APEX or something else ?
I can only get the result of the last iteration when doing a repeated rotation of the input N times, using By Count/ Merge
The Transform is reading the iteration count from its Spare Input 0 ( detail(-1,"iteration",0) )
For the invocation setup, I group the Compile_begin and Compile_end nodes in begin / end, or even just the foreach_begin / foreach_end in a subnetwork that doesn't even include the Compiled Block around the for_each block
The reason I want to indirectly call the subnetwork, is that I wanted to experiment with meta programming on the output of Attribute From Parameters, try and optimize some meta parameters. The output being basically a program in text form, even a proper graph, the end goal would be to add some code in between and modify the code. But I'm not there yet as I can't really call a simple program that contains a loop. Any thoughts ? Should I skip this and go to APEX or something else ?
Edited by alecaille - Oct. 14, 2026 08:37:04
-
- npetit
- Staff
- 468 posts
- Joined: Feb. 2008
- Offline
It looks like you're using expressions to drive the transform - expressions aren't fully supported, the expressions are evaluated at the current frame and each point representing the nodes stores its parms current values.
If you look at the geometry spreadsheet with the attribfromparm3 SOP, you'll see each point has a "parms" dictionary attribute - if you inspect the value for the point that represents the transform1 SOP you will see the "r" parm is stored as 3 floats of the parms current values, not the expression you have driving it.
Instead of driving an Xform SOP with an expression, you can use a point wrangle and plug the "foreach_count1" block begin SOP into its second input and rotate the points in VEX:
If you look at the geometry spreadsheet with the attribfromparm3 SOP, you'll see each point has a "parms" dictionary attribute - if you inspect the value for the point that represents the transform1 SOP you will see the "r" parm is stored as 3 floats of the parms current values, not the expression you have driving it.
Instead of driving an Xform SOP with an expression, you can use a point wrangle and plug the "foreach_count1" block begin SOP into its second input and rotate the points in VEX:
int iter = detail(1, "iteration"); float roty = 20.0 * iter; matrix3 rot = maketransform(0, set(0, roty, 0)); @P *= rot;
-
- alecaille
- Member
- 41 posts
- Joined: Dec. 2014
- Offline
npetit
It looks like you're using expressions to drive the transform - expressions aren't fully supported, the expressions are evaluated at the current frame and each point representing the nodes stores its parms current values.
If you look at the geometry spreadsheet with the attribfromparm3 SOP, you'll see each point has a "parms" dictionary attribute - if you inspect the value for the point that represents the transform1 SOP you will see the "r" parm is stored as 3 floats of the parms current values, not the expression you have driving it.
Instead of driving an Xform SOP with an expression, you can use a point wrangle and plug the "foreach_count1" block begin SOP into its second input and rotate the points in VEX:int iter = detail(1, "iteration"); float roty = 20.0 * iter; matrix3 rot = maketransform(0, set(0, roty, 0)); @P *= rot;Image Not Found
Thanks, that makes sense now
Can you show the setup inside subnet1 or invokegraph ? I don't manage to set up the output of Attribute From Parameters so that it can be invoked ? I mean, other than setting up 2 point groups manually for the point at the top of the subnet, and the point at the bottom of the subnet ?
-
- npetit
- Staff
- 468 posts
- Joined: Feb. 2008
- Offline
Here's an example hipfile with the setup working like you want. I've also included another example using the invoke graph with multiple input geos and a couple different ways of making that work.
You may want to use multiple inputs when you want clean geo to operate on, and use different geometry to drive the operators inside your compile block.
I've also added an example tweaking the parms on some of the graph nodes.
You may want to use multiple inputs when you want clean geo to operate on, and use different geometry to drive the operators inside your compile block.
I've also added an example tweaking the parms on some of the graph nodes.
-
- alecaille
- Member
- 41 posts
- Joined: Dec. 2014
- Offline
-
- alecaille
- Member
- 41 posts
- Joined: Dec. 2014
- Offline
Would you mind showing a Clip SOP inside a compiled, multi threaded loop, which Origin or Distance would be driven by the iteration detail from the Metadata of the loop, which itself is transformed into a Compiled Graph with Attribute From Parameters SOP ?
I still don´t really understand what the restrictions are for the operators inside the subnet. Thanks
I still don´t really understand what the restrictions are for the operators inside the subnet. Thanks
Edited by alecaille - Nov. 9, 2026 06:34:49
-
- npetit
- Staff
- 468 posts
- Joined: Feb. 2008
- Offline
In order to change node parms from within the compiled graph (and not externally after the fact) you need to feed the parm values through a detail "parms" dict attribute where the key is the name of the parm and the value is the value you want to use.
To pass the dict attribute to the node and ensure it is used to drive the node parms, you need a spare input parm pointing to the node with the "parms" dict attribute and a parameter override parm "spare_parminputindex" int attrib for the spare input index. Both of these can be created using the Parameter Edit Menu > Add Spare Input and then Parameter Edit Menu > Add Parameter Override.
Here's an updated example with the clip sop having its various parms driven by a detail wrangle in a for loop.
To pass the dict attribute to the node and ensure it is used to drive the node parms, you need a spare input parm pointing to the node with the "parms" dict attribute and a parameter override parm "spare_parminputindex" int attrib for the spare input index. Both of these can be created using the Parameter Edit Menu > Add Spare Input and then Parameter Edit Menu > Add Parameter Override.
Here's an updated example with the clip sop having its various parms driven by a detail wrangle in a for loop.
-
- tamte
- Member
- 9753 posts
- Joined: July 2007
- Offline
npetitalso since you were wondering about restrictions, it's worth to keep in mind that this only works for verbified SOPs, so many low level nodes like Clip SOP are fine, but none of the HDAs
To pass the dict attribute to the node and ensure it is used to drive the node parms, you need a spare input parm pointing to the node with the "parms" dict attribute and a parameter override parm "spare_parminputindex" int attrib for the spare input index. Both of these can be created using the Parameter Edit Menu > Add Spare Input and then Parameter Edit Menu > Add Parameter Override.
Edited by tamte - Nov. 11, 2026 02:14:05
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- alecaille
- Member
- 41 posts
- Joined: Dec. 2014
- Offline
tamtenpetitalso since you were wondering about restrictions, it's worth to keep in mind that this only works for verbified SOPs, so many low level nodes like Clip SOP are fine, but none of the HDAs
To pass the dict attribute to the node and ensure it is used to drive the node parms, you need a spare input parm pointing to the node with the "parms" dict attribute and a parameter override parm "spare_parminputindex" int attrib for the spare input index. Both of these can be created using the Parameter Edit Menu > Add Spare Input and then Parameter Edit Menu > Add Parameter Override.
Yes I figured that some SOPs are not compatible with this;
Is there a way to generate a reverse list, i.e a list of non verbified SOP that I can keep in mind ?
For example, Point Jitter
Or display this information somehow ? I wrote a Python Panel that displays this information, so that I can find alternatives when possible, but it's taking a bit of room in the UI. I understand this is a different notion from compilability.
Edited by alecaille - Nov. 11, 2026 08:36:10
-
- tamte
- Member
- 9753 posts
- Joined: July 2007
- Offline
you can print the verbs
everything else will not be compatible with parameter overrides, but in general any HDA so nodes you can dive in (with tiny lock badge) will not work with this
neither is possible to override spare parameters even if they are added to the verbified SOPs like Clip SOP
in my understanding this essentially overrides the parms dictionary Houdini feeds to the verb during invocation
sorted(hou.sopNodeTypeCategory().nodeVerbs().keys())
everything else will not be compatible with parameter overrides, but in general any HDA so nodes you can dive in (with tiny lock badge) will not work with this
neither is possible to override spare parameters even if they are added to the verbified SOPs like Clip SOP
in my understanding this essentially overrides the parms dictionary Houdini feeds to the verb during invocation
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- Quick Links


