For each connected piece question

   2365   2   0
User Avatar
Member
53 posts
Joined: March 2018
Offline
I have a Polygon tube and I set the connectivity to rows. I want to rotate each row differently in Y, so I put it in a for each connected piece web, and create a transform, with fit01(rand(@class),0,360) in Y. @class was made with the connectivity node that came with the for each loop and gives each piece its own number. However it rotates every piece the same amount. Is there something basic I am not understanding? Thank you for your time.
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
hey use this expression
fit01(rand(prim(0, 0, “class”, 0)),0,360)

instead of @class that would work in a primitive wrangle, you need to use the prim() expression to retrieve to attribute “class”.
User Avatar
Member
53 posts
Joined: March 2018
Offline
Andr
hey use this expression
fit01(rand(prim(0, 0, “class”, 0)),0,360)

instead of @class that would work in a primitive wrangle, you need to use the prim() expression to retrieve to attribute “class”.


Thanks! That worked.
  • Quick Links