random in Foreach

   8379   6   3
User Avatar
Member
13 posts
Joined: 2月 2014
Offline
Hi,

How to delete faces in Foreach randomly for each group?
User Avatar
Member
453 posts
Joined: 2月 2013
Offline
You could just sort the faces randomly and delete a range. If you need to delete a specific amount of faces for each group, you could run a for each loop on each group and do the range delete there.
User Avatar
Member
13 posts
Joined: 2月 2014
Offline
DASD
You could just sort the faces randomly and delete a range. If you need to delete a specific amount of faces for each group, you could run a for each loop on each group and do the range delete there.
Thanks for reply

I am trying to do something like this

I have 3 grids. Each grid is in it's own group so I have 3 groups of primitives



I want to delete primitives randomly in foreach and when I do that with rand($PR) they, of course, deleted similarly so I get this



so how do I delete them randomly for each group?
User Avatar
Member
453 posts
Joined: 2月 2013
Offline
Need to change your seed value based on the copy number. You will need to stamp for that.
User Avatar
Member
13 posts
Joined: 2月 2014
Offline
DASD
Need to change your seed value based on the copy number. You will need to stamp for that.
I don't know how to stamp in foreach. Can you please write expression?
User Avatar
Member
453 posts
Joined: 2月 2013
Offline
https://vimeo.com/142534639 [vimeo.com] - watch this.

In the old foreach SOP the expression was soemthign like: stamp(“..”,“FORVALUE”,0).

In the new foreach you will need a wired metadata node and you get the iteration number with detail(“../metanode”,“iteration”,0)
User Avatar
Member
13 posts
Joined: 2月 2014
Offline
DASD
https://vimeo.com/142534639 [vimeo.com] - watch this.

In the old foreach SOP the expression was soemthign like: stamp(“..”,“FORVALUE”,0).

In the new foreach you will need a wired metadata node and you get the iteration number with detail(“../metanode”,“iteration”,0)
That helped

Thanks a lot
  • Quick Links