Random Select (or Group) Objects Copied To Points [Solved]

   3488   3   1
User Avatar
Member
78 posts
Joined: June 2019
Offline
I'm trying to randomly select a certain percentage of objects copied to points.

I somewhat have a solution, but it's not a percentage selection and I'm sure there is a more simple way to achieve this.

  • I firstly randomise point numbers using a Sort.
  • Then copy a bunch of boxes to each point.
  • Next Group By Range to get some kind of random primitive selection (I'm not 100% understanding this node)
  • Then Group Expand to flood fill to all connected geometry.

Surely I can write something in VEX with a percentage slider to do what I'm after?

File attached with my current solution.
Edited by GlennimusPrime - May 11, 2020 21:54:28

Attachments:
Random_Select_Copied_Objects.hipnc (239.5 KB)

User Avatar
Member
8555 posts
Joined: July 2007
Offline
you can check Pack and instance on your copy SOP and then deal just with point per object, then simple Group Expression should do:
rand(@ptnum, chi("seed"))<chf("perc")
or if you already have unpacked geo without any attribs you can generate class attrib using Connectivity SOP and use that
rand(i@class, chi("seed"))<chf("perc")

Attachments:
Random_Select_Copied_Objects_fix.hipnc (422.4 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
78 posts
Joined: June 2019
Offline
Thank you Tamte for more than one example! Both perfect solutions
User Avatar
Member
19 posts
Joined: Nov. 2019
Offline
Hi guys, I think I might be having a similar issue that I have never been able to solve in houdini.
I have a bunch of leaves under the primitive group 'leaf' each made of 13 polys.
How do I randomly select whole leaves in this group and add them to a new group....and can it be done without using VEX?

Thanks
  • Quick Links