GeoGem Posted December 13, 2019 Share Posted December 13, 2019 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! Quote Link to comment Share on other sites More sharing options...
ftaswin Posted December 13, 2019 Share Posted December 13, 2019 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 1 Quote Link to comment Share on other sites More sharing options...
GeoGem Posted December 13, 2019 Author Share Posted December 13, 2019 (edited) 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 December 13, 2019 by GeoGem Quote Link to comment Share on other sites More sharing options...
anim Posted December 13, 2019 Share Posted December 13, 2019 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; } } Quote Link to comment Share on other sites More sharing options...
GeoGem Posted December 19, 2019 Author Share Posted December 19, 2019 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. Quote Link to comment Share on other sites More sharing options...
anim Posted December 19, 2019 Share Posted December 19, 2019 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 Quote Link to comment Share on other sites More sharing options...
GeoGem Posted December 20, 2019 Author Share Posted December 20, 2019 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.