Detail-level Attribute Wrangler within for-loop doesn't vary per-iteration

   2035   2   0
User Avatar
Member
67 posts
Joined: May 2016
Offline
The expressions I want to perform within a for-loop a bit too complex for HScript, so I wanted to do them in Vex, however if I put a Detail-level Attribute Wrangler within a for-loop, the values don't vary per-iteration.

Here's the nodes:


The Attribute Wrangler contains:

float seed = ch(“../base_seed”);
float min = ch(“../hull_seg_len_min”);
float max = ch(“../hull_seg_len_max”);
int iteration = detail(“../hulls_pos_meta”, “iteration”, 0);
f@extrude_dist = fit01(rand(seed + 1.6 * (float)iteration), min, max);

Which feed the poly-extrude:
User Avatar
Member
67 posts
Joined: May 2016
Offline
Ah, if I add the following to the Attribute Wrangler:

i@iter = iteration;

“iter” shows in the geometry spreadsheet as 0, so the detail() function is not picking-up the per-iteration value from the meta-block?!?
User Avatar
Member
67 posts
Joined: May 2016
Offline
OK fixed. Moved the Attribute Wrangler as a child of the meta-begin-block:



And picked-up the detail-attribute using @syntax:

f@extrude_dist = fit01(rand(seed + 1.6 * (float)@iteration), len_min, len_max);
Edited by trojanfoe - May 18, 2017 14:16:41
  • Quick Links