Viewport assign random colors to geometry to easy read

   1079   3   1
User Avatar
Member
8 posts
Joined: 12月 2016
Offline
How can I quickly change the color of my geometry, like assigning a color node in sops with random by name or something, just to get easy and quick readability, do I have to use a sop modify for this?
User Avatar
Member
200 posts
Joined: 11月 2013
Offline
Definitely overkill but it works. Hip file attached.

float r=rand(@elemnum);
vector color = vector(chramp('color', r));

vector colorpath[];
int colorpathindex[];
append(colorpath, color);
append(colorpathindex, 0);

usd_addprimvar(0, @primpath, "displayColor", "color3f[]");
usd_setprimvar(0, @primpath, "displayColor", colorpath);
usd_setprimvarindices(0, @primpath, "displayColor", colorpathindex);

Attachments:
rand_color.hipnc (97.5 KB)

User Avatar
Member
8 posts
Joined: 12月 2016
Offline
I was hoping for a toggle button somewhere in the UI, but thanks man, I can barely use wrangles in sops, learnings wrangles in lops seems a bit different looking at it
User Avatar
Member
396 posts
Joined: 4月 2018
Offline
maxmax003
I was hoping for a toggle button somewhere in the UI, but thanks man, I can barely use wrangles in sops, learnings wrangles in lops seems a bit different looking at it
You can ignore the code and save the wrangle to a shelf. You can then just click the shelf button next time to drop it in, or even assign a hotkey to it.
  • Quick Links