Accessing Detail Attribute from Point Attribute Wrangle

   4352   2   1
User Avatar
Member
12 posts
Joined: Nov. 2018
Offline
Hi!

I'm trying to create procedural clusters of crystals. So far I've created a few crystals geos that I randomely scatter on top of a half sphere, works fine so far. Now I'd like to be able to randomely select one of the scatter point to be the “king” ie the crystal that will be on this point will be scaled way bigger than the others.

To do that I've done the following:
* Added an Attrib Create node set to operate on Primitives which adds a “king” Detail attribute whith value: $NPT * rand($T). This works fine I can see my new attribute in the Geometry Spreadsheet
* Now I've added an Attribute Wrangle where I'd like to create a new attribute for my points and have the point whose index equals “king” to have this new attribute set to 1.

I've tried the Detail() function, but I can't get it to work…
if(@ptnum == detail(0, "king"))
{
    i@king = true;
}



Thanks a lot!
Edited by Lucas_6666 - Nov. 19, 2018 13:31:48
User Avatar
Member
2658 posts
Joined: June 2008
Offline
Try setting the class on your attributecreate to detail instead of primitive.
Using Houdini Indie 20.5
Windows 11 64GB Ryzen 16 core.
nVidia 3060RTX 12BG RAM.
User Avatar
Member
12 posts
Joined: Nov. 2018
Offline
Thanks Enivob! It worked!
  • Quick Links