Invoke graph a Subnetwork with a Parallel for Compile Block

   236   3   1
User Avatar
Member
37 posts
Joined: 12月 2014
オフライン
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 ?
Edited by alecaille - 昨日 08:37:04

Attachments:
for.png (35.8 KB)
invoked.png (663.7 KB)

User Avatar
スタッフ
466 posts
Joined: 2月 2008
オフライン
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;

Attachments:
success.png (345.2 KB)

User Avatar
Member
37 posts
Joined: 12月 2014
オフライン
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 ?
User Avatar
スタッフ
466 posts
Joined: 2月 2008
オフライン
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.

Attachments:
InvokeGraph.hip (140.0 KB)

  • Quick Links