Jump to content

Group whole connect piece via partial point/prim selection


GeoGem

Recommended Posts

The simple example: using the bounding region option in the group sop, if the bound was to select a partial amount or even a single point/prim of an "island"/piece geo, is there a way to extend the group to cover the whole of the connectivity.

another example: a wheel that has a rim, hubcap and lugnuts as part of one imported model, would like to tell my group node, or wrangle to select whatever is in the top 10% of the bbox, then extend the partial selection to just the tire piece/name/class.  if the bound were to select the top 30%, it would be both the whole tire and rim, minus the lugnuts and hubcap being 40% from the outer diameter.

The idea is to create a connected pieces group, procedurally, without addressing a name/class that could possibly change if the input were transformed or changed topology.

H18 i feel i could accomplish this easily with the group expand by surface, but unfortunately im unable to use H18 for a while.  
Im fairly good at wrapping my head around vex scripting, no hesitation to trying to coding this if im not missing an easier technique.

Thanks!

Link to comment
Share on other sites

for (int point_num : findattribval(0, "point", "class", i@class))
{
    if (inpointgroup(0, "part",point_num))
    {
        @group_part = 1;
        continue;
    }
}

Class is the connectivity point attribute you have earlier from connectivity SOP and "part is the portion group name you initiate and capture "partial" model

  • Like 1
Link to comment
Share on other sites

hmm i tried your code in a wrangle running thru both prim and points, couldnt get it working.  I use a group node before the wrangle to use its bounding function like i first specified or just select some points?
those two functions seem quite useful though, i did not know of them till now.

I dug thru my instructors old files and found a little trick he did by running a Cd attrib through PRIM to DETAIL attribpromote with a MAXIMUM method then reverse it again DETAIL to PRIM in a for each loop, and it somehow it tells the Cd value to envelope the whole connected piece.  super fascinating, hip file attached.

grpbound_partial_fullconnectivity.hipnc

Edited by GeoGem
Link to comment
Share on other sites

for Attrib Promote you don't need for each loop, it can directly work per piece

- set both classes to Primitive

- check Piece Attribute: class

- set method to Maximum 

 

and as for the @cloud68 method, you just need to alter it to work on prim groups instead and on partial group instead of part in your case

for (int prim_num : findattribval(0, "prim", "class", i@class))
{
    if (inprimgroup(0, "partial",prim_num))
    {
        @group_partial = 1;
        break;
    }
}

 

Link to comment
Share on other sites

got around to playing with this.

the wrangle for loop method works great until theres too many primitives, long cook time.

using the detail promote method, the Piece Attribute checkbox is disabled when Original Class is set to detail.
I tried fiddling with using 'class' in the original name and adjusting some things, but it seems i need to stick to the for each method.
thank you though.

Link to comment
Share on other sites

6 hours ago, GeoGem said:

using the detail promote method, the Piece Attribute checkbox is disabled when Original Class is set to detail.

However, you want to promote from Prim to Prim, so don't use Detail and you can find maximum value of the Prim attrib among all prims per piece with a single attribpromote as described

Link to comment
Share on other sites

ah yes! great, a few extra nodes to use. very important to specify Cd as darker than the desired color first, but preferably black. everything has to be set Prim attribs and it works great, thank you for specifying.  i find myself using this quite a bit to avoid manual selection blasts.

Ive included the hip as an attachment(using Crag) for whoever else comes across this thread, full credit to the help from @anim of course.

fullyConnected_byPartialBbox.hipnc

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...