Hello everyone,
I have set up a wall of fragmented bricks (polygons), and would like to select a number of fragments based on a bounding volume. Each fragment consists of several primitives. Using the Select tool in the viewport I can interactively select connected primitives, which will select whole fragments.
Q1: Is there any way to simulate this “Select connected primitives” mode in a node network?
I know I can select points by a group SOP using a bounding volume, and then use another group SOP to convert the point selection to a primitive selection, but this way Houdini only selects the individual primitives the points are a part of, but not the connected primitives (the whole fragment).
Q2: Is it possible to convert a selection of points or primitives into the number of connected primitives that they are a part of?
Thanks for any help.
Point to Connected Primitives
13257 9 2- dr.pepper
- Member
- 10 posts
- Joined: July 2006
- Offline
- dr.pepper
- Member
- 10 posts
- Joined: July 2006
- Offline
hmm… I may have just found something, but I don't know if that's a good solution really.
If I convert the point selection to a primitive group, then convert that primitive selection to its points again, to another primitive group, back to points and so on, I can ‘grow’ the selection of points/primitives up until all connected primitives are selected. So it's group SOP after group SOP.
I wonder if there's any other way… ?
If I convert the point selection to a primitive group, then convert that primitive selection to its points again, to another primitive group, back to points and so on, I can ‘grow’ the selection of points/primitives up until all connected primitives are selected. So it's group SOP after group SOP.
I wonder if there's any other way… ?
- wolfwood
- Member
- 4270 posts
- Joined: July 2005
- Offline
- dr.pepper
- Member
- 10 posts
- Joined: July 2006
- Offline
- Simon
- Member
- 2199 posts
- Joined: July 2005
- Online
dr.pepper
hmm… I may have just found something, but I don't know if that's a good solution really.
If I convert the point selection to a primitive group, then convert that primitive selection to its points again, to another primitive group, back to points and so on, I can ‘grow’ the selection of points/primitives up until all connected primitives are selected. So it's group SOP after group SOP.
I wonder if there's any other way… ?
Just for information you can grow a selection by a number of edges using the group sop - edges option. It used to only take a single point number, but now you can give it an entire group.
The trick is finding just the right hammer for every screw
- dr.pepper
- Member
- 10 posts
- Joined: July 2006
- Offline
That's it Simon!!
Here's what I do now:
I have a Copy SOP defining the set of fragmented bricks (bricks of different types copied on a grid).
1) Group SOP: Create group of points by bounding volume
2) Group SOP: Create group of points by edges with Edge Depth set to 100 and Point Group set to the name of the group defined in 1)
3) Group SOP: Convert group of points created in 2) to a primitive group
So there are 3 Group SOPs for each cluster of brick fragments defined by a bounding volume, and it's lightning fast.
Thank you guys for your help!
Here's what I do now:
I have a Copy SOP defining the set of fragmented bricks (bricks of different types copied on a grid).
1) Group SOP: Create group of points by bounding volume
2) Group SOP: Create group of points by edges with Edge Depth set to 100 and Point Group set to the name of the group defined in 1)
3) Group SOP: Convert group of points created in 2) to a primitive group
So there are 3 Group SOPs for each cluster of brick fragments defined by a bounding volume, and it's lightning fast.
Thank you guys for your help!
- stevenong
- Member
- 1632 posts
- Joined: July 2005
- Offline
If you're using the Copy SOP, you can use the Create Output Groups to do what you want. Toggle it on and specify the following in the Copy Groups parameter:
copyGroup$TPT
If you MMB on the Copy SOP, you should see
n Primitive Groups:
n primitives in copyGroup0
n primitives in copyGroup1
n primitives in copyGroup2
… etc
From the Copy SOP's Local variables help tab:
TPT - The actual point number of the currently processed template point, independent of any template groups. See PT above.
Hope the above helps!
Cheers!
steven
copyGroup$TPT
If you MMB on the Copy SOP, you should see
n Primitive Groups:
n primitives in copyGroup0
n primitives in copyGroup1
n primitives in copyGroup2
… etc
From the Copy SOP's Local variables help tab:
TPT - The actual point number of the currently processed template point, independent of any template groups. See PT above.
Hope the above helps!
Cheers!
steven
- dr.pepper
- Member
- 10 posts
- Joined: July 2006
- Offline
Hi Steven,
Thanks for the hint. I'm already using that option, but the bricks I create on the grid consist of several fragments (individual objects) that each have a unique group name already. The problem was to select fragments from several different bricks by using a bounding volume. It works using the 3-group solution described above.
Thanks again anyway.
Cheers!
Thanks for the hint. I'm already using that option, but the bricks I create on the grid consist of several fragments (individual objects) that each have a unique group name already. The problem was to select fragments from several different bricks by using a bounding volume. It works using the 3-group solution described above.
Thanks again anyway.
Cheers!
- Sifis
- Member
- 10 posts
- Joined: Oct. 2010
- Offline
dr.pepper
That's it Simon!!
Here's what I do now:
I have a Copy SOP defining the set of fragmented bricks (bricks of different types copied on a grid).
1) Group SOP: Create group of points by bounding volume
2) Group SOP: Create group of points by edges with Edge Depth set to 100 and Point Group set to the name of the group defined in 1)
3) Group SOP: Convert group of points created in 2) to a primitive group
So there are 3 Group SOPs for each cluster of brick fragments defined by a bounding volume, and it's lightning fast.
Thank you guys for your help!
Hey dr. Pepper, can you please share your HIP file where you use this method? Seems I can't quite get it from the explanation
- Sifis
- Member
- 10 posts
- Joined: Oct. 2010
- Offline
-
- Quick Links