Run on elements of Array wrangle issue

   1046   3   0
User Avatar
Member
67 posts
Joined: June 2022
Offline
Hello, I want to control pscale (or "widths" in usd naming)on the lop level. I've written wrangle to do so. I am not sure if my understanding of syntax is correct. When I use code as in picture one, everything works fine but those arrays are not comfortable because I want to use Ids as seed for randomization. Then I've tried run on elements checkbox, but I can't make it work, any suggestions about syntax?
Edited by sniegockiszymon - Dec. 3, 2022 13:59:14

Attachments:
works.png (33.0 KB)
doesnt_work.png (36.5 KB)

User Avatar
Member
7796 posts
Joined: Sept. 2011
Online
for the second one, the functions usd_attrib and usd_setattrib are still going to be array-based. To set a single value, use a bind instead.

e.g.
@widths *= 0.1;
User Avatar
Member
67 posts
Joined: June 2022
Offline
jsmack
for the second one, the functions usd_attrib and usd_setattrib are still going to be array-based. To set a single value, use a bind instead.

e.g.
@widths *= 0.1;
Yeah, but I've already randomized pscale thats why I am multiplying and I dont want to use single value. There was pscale set in sops before exporting to usd, but wrong scale and during lookdev I want to change, it as well as randomize a little bit more (bigger difference between samllest and largest).
User Avatar
Member
7796 posts
Joined: Sept. 2011
Online
Thats what it does when in run over elements of an array. @widths binds a single value from the array for each element of the array and executes the code on each.
  • Quick Links