@@ -34,8 +34,10 @@ It is the best to check all the nodes with open *Geometry Spreadsheet* and *Cons
34
34
* [ VOPs / Using Inline Code] ( #vops--using-inline-code )
35
35
* [ DOPs / Volumes workflow] ( #dops--volumes-workflow )
36
36
* [ DOPs / Gas Field Wrangle] ( #dops--gas-field-wrangle )
37
+ * [ DOPs / Gas Field Wrangle - accessing DOPs and SOPs data] ( #dops--gas-field-wrangle--accessing-dops-and-sops-data )
37
38
* [ DOPs / Geometry workflow] ( #dops--geometry-workflow )
38
39
* [ DOPs / Geometry Wrangle] ( #dops--geometry-wrangle )
40
+ * [ DOPs / Geometry Wrangle - accessing fields] ( #dops--geometry-wrangle--accessing-fields )
39
41
* [ Conditions] ( #conditions )
40
42
* [ Loops] ( #loops )
41
43
* [ Stopping For-Each SOP from VEX] ( #stopping-for-each-sop-from-vex )
@@ -514,6 +516,31 @@ f@pig_in *= .9;
514
516
```
515
517
<br >
516
518
519
+ #### DOPs / Gas Field Wrangle - accessing DOPs and SOPs data
520
+
521
+ ``` C
522
+ // it is also possible to access DOP fields using this syntax
523
+ // we can sample "pig_mask" without setting the field "Inputs"
524
+
525
+ float pig_mask = 0 ;
526
+ // the following lines bellow are identical, the second and third ones are more flexible as they refer to relative path,
527
+ // it will work even if we renamed this DOP network, the first line would not work after that
528
+ // the second argument is either an int representing primitive number, or string representing primitive name
529
+ // the syntax for accessing DOP data is: op:/DOP_path:dop_object/field_name
530
+
531
+ pig_mask = volumesample(" op:/obj/examples/dopnet_vex_vops_volume:volume/pig_mask" , 0 , v@P);
532
+ // pig_mask = volumesample("op:" + opfullpath("../") + ":volume/pig_mask", "pig_mask", v@P);
533
+ // pig_mask = volumesample("op:../" + ":volume/pig_mask", 0, v@P); // op: syntax also accepts relative paths
534
+
535
+ // we can also directly access SOP volumes using this syntax
536
+ // pig_mask = volumesample("op:../../IN_VOLUMES", 1, v@P);
537
+
538
+ f@pig_in *= 1 -pig_mask;
539
+ ```
540
+ ![ Gas Field Wrangle - DOPs and SOPs data] ( ./img/gas_field_wrangle_dop_sop_data.jpg )
541
+
542
+ <br >
543
+
517
544
#### DOPs / Geometry workflow
518
545
Here I will show basic steps of creating a simple custom DOP solver operating on volumes.
519
546
@@ -541,6 +568,24 @@ v@P *= 1.1;
541
568
```
542
569
<br >
543
570
571
+ #### DOPs / Geometry Wrangle - accessing fields
572
+ [ link to explanation] ( #dops--gas-field-wrangle--accessing-dops-and-sops-data )
573
+ ``` C
574
+ // we can also access DOP fields from Geometry Wrangle, it is explained in:
575
+ // /obj/examples/dopnet_vex_vops_volume/gasfieldwrangle_accessing_DOPs_and_SOPs_data
576
+
577
+ // all following lines will produce the same result
578
+ float mask = 0 ;
579
+ mask = volumesample(" op:../" + " :box/pig_mask" , 0 , v@P);
580
+ // mask = volumesample("op:" + opfullpath("../") + ":box/pig_mask", "pig_mask", v@P);
581
+ // mask = volumesample("op:../../IN_VOLUMES", 1, v@P);
582
+
583
+ // visualize what points sampled non-zero density in the volume
584
+ if (mask != 0 ) v@Cd = {1,0,0};
585
+ ```
586
+
587
+ <br>
588
+
544
589
#### Conditions
545
590
```C
546
591
// it there is only one operation after if condition, this operation
0 commit comments