For each Loop and using attributes on the outside.

   409   2   0
User Avatar
Member
2 posts
Joined: May 2024
Offline
Hello there,

I'm quite new to VFX and really took a liking to Houdini,



Question:
As shown in my image, I'm trying to use a "For Each Point" loop to copy some geometry onto points. I've gotten most of it to work and understand what's happening. Now, I want the geometry to scale according to the velocity of the points.

What I don't know is how to transfer the velocity of the points to the scale, which I'd like to multiply using a function like length($VX, $VY, $VZ). My understanding is that I need to extract this value from the loop because it is point-specific. If this doesn't have to be done, I would appreciate any alternative solutions. However, I would still like to know: Is it possible to access attributes after the "For Each Begin" node?


Thanks a lot
Alex

Attachments:
Houdini_Forum_Question.PNG (121.8 KB)

User Avatar
Member
100 posts
Joined: Jan. 2015
Offline
Hello

If all you do is transforming the object you want to copy, you don't need to use a loop at all.
"Just" set the appropriate attribute on the point cloud (pscale,scale,N,up,orient etc).

Here's an example of a fountain type emitter, where the boxes a aligned to the velocity, and scaled by the velocity length.
The random hscript expression can be replaced by "rand(@ptnum)" in vex, that will return a random float based on the particle id for example.
Edited by PaQ WaK - July 25, 2024 19:41:53

Attachments:
Scalebyvelocity.hiplc (287.7 KB)
scale.JPG (32.8 KB)

Gameloft
User Avatar
Member
2 posts
Joined: May 2024
Offline
PaQ WaK
Hello

If all you do is transforming the object you want to copy, you don't need to use a loop at all.
"Just" set the appropriate attribute on the point cloud (pscale,scale,N,up,orient etc).

Here's an example of a fountain type emitter, where the boxes a aligned to the velocity, and scaled by the velocity length.
The random hscript expression can be replaced by "rand(@ptnum)" in vex, that will return a random float based on the particle id for example.
Thanks a lot!
  • Quick Links