Random Select (or Group) Objects Copied To Points [Solved]
3488
3
1
May 11, 2020 7:01 p.m.
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)
tamte
Member
8555 posts
Joined: July 2007
Offline
May 11, 2020 7:30 p.m.
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
May 11, 2020 7:49 p.m.
Thank you Tamte for more than one example! Both perfect solutions
Feb. 15, 2021 6:30 p.m.
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