Apurba Haldar Posted July 24, 2019 Share Posted July 24, 2019 Hi, I want to select the outer pieces and delete them, I tried to use the delete node and set the Group to ‘outside’ but this only deletes the outer faces rather than the whole piece. To do this, I tried to create a group of outer pieces selecting manually the primitives (faces). If I do it manually it'll work. for that just need to drop a group node and start selecting primitives from outside. In this way, it'll take forever to select outer pieces of a large scale model. I did not find any other sufficient way to do this! also I found this file from sidefx which works exactly what I want but did not get how it is working! Deleting Outside Pieces.hip Quote Link to comment Share on other sites More sharing options...
kleer001 Posted July 24, 2019 Share Posted July 24, 2019 Ah, yes I could see how that could be difficult to understand. The foreach loop is running on each named piece, that is the pieces that separate when we use a exploded view SOP. Look in the spreadsheet under the primitive attribute "name". All of those with the same name are processed together at once. The loop merges each iteration with the gather method. This means that all the outputs are put together at the end instead of just the last one. Inside that loop is a single switch. That switch asks (with the nprimsgroup function) if there are any primitives in the group called "outside". If there are at least one then that currently processed piece is swapped for the null. That "-1" and the spare Input 0 is really weird to me. I would just use opinputpath(".",0), but I can see how that would be a little less procedural. The compile block just makes the whole thing run faster and for demonstration purposes so we can ignore it here. But it is necessary if we're actually dealing with a lot of geometry, and shattered objects can get really big. 1 Quote Link to comment Share on other sites More sharing options...
Apurba Haldar Posted July 24, 2019 Author Share Posted July 24, 2019 Thank you so much! All my doubts about that code are now cleared! I was trying to delete the outer pieces using pack node and to some extent it worked but some of the pieces on top are NOT getting deleted at all! I don't know if I'm doing right or wrong with the pack node or the delete node. Any suggestion would be really helpful. Quote Link to comment Share on other sites More sharing options...
Apurba Haldar Posted July 25, 2019 Author Share Posted July 25, 2019 (edited) Or is there any better/ intuitive way to do this? Edited July 25, 2019 by Apurba Haldar Quote Link to comment Share on other sites More sharing options...
anim Posted July 25, 2019 Share Posted July 25, 2019 you can create attribute from outside group then promote that to pieces by name then delete primitives with outside attribute 1, which will be full outside pieces DeletingOutsidePieces_alt.hip 1 1 Quote Link to comment Share on other sites More sharing options...
Apurba Haldar Posted July 25, 2019 Author Share Posted July 25, 2019 FINALLY!!! THANK YOU SO MUCH SIR! I was so confused about this! now I know!! Quote Link to comment Share on other sites More sharing options...
bubblepins Posted July 27, 2019 Share Posted July 27, 2019 (edited) In the 3d viewport, there is a "Select Whole Geometry" "Connected Geometry" option after you press the mouse looking icon to enable the menu. Then you can just click the pieces you want to delete without the need of packing. Edited July 29, 2019 by bubblepins 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.