Jump to content

Random primitive attribute


Recommended Posts

Hi odforce!

I got really stuck with this so I would need some help from you guys!

I have 3 different imported geometrys from Maya that I would like to stamp randomly along a grid. So far so good.

Now I would like to delete randomly a group of faces(I already created a group node before the copy-sop) from each of the stamps.

My approach was a group node and an attribute create node to create an atrribute(0 or 1, for not delete or delete).

After the copy node I put down an attribute wrangle node to give the attribute I created a random value(0 or 1). Next was a delete node set to the group with an expression which looked like

@attribute1 == 0

Everything seems fine but there is just one Problem...

The attribute wrangle node puts the exact same random number in all the attributes for all stamps. So its either delete those faces or not.

It seems pretty straightforward but I can't figure out how to give each group of The stamp a random attribute.... I would really appreciate some help :)

Kind regards

Pirmin

  • Like 1
Link to comment
Share on other sites

You could stamp the seed attribute on the wrangle, that'll give you a different result per copy. Not in front of Houdini right now, but something like this for the vex code:

@myrand = rand(@ptnum, ch('seed'));

Click the plug icon to make the channel, then this hscript expression in the channel to link it to your stamped attribute:

stamp("../copy1", "myseed",0)

And ensure you're exporting 'myseed' as a stamped attribute on your copy node.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...