Jump to content
rgblues

Destruction...how to color a connected mesh with solid red if only some points have some red on it?

Recommended Posts

Hi!
I'm doing a brick house destruction as my first real adventure in Houdini...without a tutorial ;)

So my problem goes like this:

I painted in red the active bricks of a wall that I want to keep active for the sim. But eventually some faces stay black. Is there a way to check every points of each bricks and if some red is found on a brick, make the whole brick red so I can safely delete the black primitives without having holes in some of the bricks?
I can wrangle something if there is already some red on the primitives, but I cant find out what to do if for example only one point has red and the rest is black...

That would make my life easier since painting all faces with some red will be very time consuming and I have a bunch of walls to smash.

Any kind of help would be very appreciated!

PS. I've attached a simple example to make my problem obvious.

 

bricks_with_holes.hipnc

holes.JPG

Share this post


Link to post
Share on other sites

2 attribpromote sops is probably laziest way to do this:

attribpromote, point to primitives, Cd, in maximum mode

append a second attribpromote, prim to points, Cd, maximum mode again (tho it doesn't really matter)

expand_cd_to_prim.gif

expand_color_to_prim.hip

Share this post


Link to post
Share on other sites
1 hour ago, mestela said:

2 attribpromote sops is probably laziest way to do this:

attribpromote, point to primitives, Cd, in maximum mode

append a second attribpromote, prim to points, Cd, maximum mode again (tho it doesn't really matter)

expand_cd_to_prim.gif

expand_color_to_prim.hip

Thanks for answering Matt! Btw, your site as been en invaluable ressource to get into Houdini!!

The technic of adding attribute promotes works well for a simple box.

Although if someone can check my scene, I get some strange behavior with the delete sop...
Black bricks get deleted correctly but delete non selected with the same settings partially delete the red ones! Is this a bug or am I just newb-ing something wrong ?

thanks for the help!

 

check_the_delete_sop.hipnc

Edited by rgblues

Share this post


Link to post
Share on other sites

You'll need to lock the first node so houdini bakes that geometry into that sop. Otherwise when we open it, it looks for 'L_A_Bricks.OBJ' on our machines, which we don't have. :)

 

 

Share this post


Link to post
Share on other sites

Still Need help, I'm banging my head on the original problem...or a solution that will scale up well with the complexity of the geometry.

The technic proposed by mestela works well on cube or faces type stuff. But with complex geo it falls short. I did my best to come up with a solution but unfortunately my Houdini skills wont help me much :/

So let me explain again :

I painted some red on a densely fractured object. I want to make sure that those pieces that have at least one red point on it, get totally painted with red. I want to simulate these using bullet. The idea behind it is that I can safely separate active pieces (in red) vs non active pieces without creating holes using a delete sop with @Cd.r == 1

Any piece of advice will be greatly appreciated!
Thanks

color_transfer_bricks_to_mortar1.JPG

Share this post


Link to post
Share on other sites

Goodness! indeed hehe, thanks for pointing it out! For some reason the File merge SOP had the Merge range second box set to 2 creating a double...glad you saw it.

Well, the good news is that I found a solution to transfer the color from the bricks pattern to the fracture pieces. All I needed to do was packing the geometry of the mortar first and than transfer the color of the bricks to the points of the packed mortar fractured pieces. Since each point represent a piece of mortar, I can easily split the red from the black points then unpack. And voilà! Problem solved :)


 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×