Invoke graph a Subnetwork with a Parallel for Compile Block
1032 6 1-
- alecaille
- Member
- 40 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
- 467 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
- 40 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
- 467 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
- 40 posts
- Joined: Dec. 2014
- Offline
-
- alecaille
- Member
- 40 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 - yesterday 06:34:49
-
- npetit
- Staff
- 467 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.
-
- Quick Links

