Iacopo Antonelli

ginwakeup

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Create a new group for each loop Jan. 27, 2019, 1:04 p.m.

Hello,
I have a foreach which loops through N primitives.
Inside the foreach the copy node places a box on each primitive points, and I was guessing how could I create a new group each loop so in the end I can have the relation: N boxes : N groups ?

I tried using “copy groups” in the copy node, but without any luck. It will generate a group taking the same point from every primitive, I can't understand it.

Thanks!

Foreach node and variable increment Jan. 25, 2019, 6:08 p.m.

toadstorm
Use the “iteration” detail attribute that's accessible from the ForEach loop metadata. You could multiply this by some scalar (like 1000) and then add it to $PT.

To add the metadata node, just select the ForEach start node and click “Create Meta Import Node”. You can then pull the detail attribute “iteration” from this node and use it in your expressions.

That worked thank you very much.

Foreach node and variable increment Jan. 25, 2019, 4:45 p.m.

Hello,
I am struggling to make a proper randomization. I followed the procedural library tutorial, which ends up having N lines primitives with X points which are used to spawn books.

A foreach loops through the primitives, and using $PT to create random values doesn't work, every point is unique to its own primitive so it will return the same value, ending up with the same randomization every primitive.

ex.


So I thought about creating a detail float attribute (FORVALUE) before the foreach.
Every loop in the foreach I use the attribrandomize to add 1.0 to it each loop, so I can use it in the copy node, in this way I would have a different FORVALUE attribute per primitive.
I access the FORVALUE attribute in the copy node using

rand(detail(“../attribrandomize1”, “FORVALUE”, 0))




But something seems not to be working, I guess why? It seems like it's creating just the same value and not adding to it. I tried to see it in the geometry spreadsheet, even if I use the single pass in foreach_end it doesn't change every loop.

Also, if you have a better way to do this, I thought also about using Y pos, wouldn't be so different from the FORVALUE solution tho.

Thanks