Jump to content

Deleting Pieces of Geometry Vex


evanrudefx

Recommended Posts

Hey!!!

I am trying to add smoke to a shattered statue simulation. The falling pieces will emit smoke. I want the geometry to be deleted until the pieces reaches a certain velocity (if (@v.y < ch('threshold'));) , so that the emitter geo wont appear until the geometry is actually moving. That will keep smoke from emitting while the statue isn't falling apart. Finally,  I need the geometry to be deleted when it is about to hit the ground, so I guess delete by Y position. I am trying to do this in an attribute wrangle. All the pieces have their own name attribute, piece1, piece2, etc. Here is my logic so far, I just don't know how to right it in vex: 

if (@v.y < ch('thresholdvelocity')) or (@p.y < ch('thresholdposition') then delete that whole piece.

Any help would be appreciated. I am new to vex and I am trying to learn these things on my own, but sometimes I need help : )

Thanks

edit: I can't add my original scene, but I made a sample scene.

delete_geo.hipnc

Link to comment
Share on other sites

Hi Van, I attached a file below that I tweaked a little bit, not sure if this is what you mean, but basically removepoint() / removeprim() is convenient for deleting geo in a wrangle node, you can search in the vex functions or type in this and hit F1 in the textport in wrangle node to view the documentation :D

I bypassed the unpack for now, so they are packed geo and can be manipulated at point level, but if you need them to be unpacked geo, you can add "v" at the transfer attribute input textfield in the unpack node to get the velocity from the packed sim geo. Hope this helps.

delete_geo_vl.hipnc

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

this is how I was originally doing it, but I found out the problem was with my velocity channel so it was deleting some faces rather than individual chunks. I'll keep this thread updated.

 

 

edit: I thought this method didn't work because it was deleted faces rather than individual chunks. That was because my velocity channel was "messed" up.

Edited by ejr32123
Link to comment
Share on other sites

Here is what I am doing now: 

if (@P.y < ch('pthreshold')
    || abs(@v.y) < ch('vthreshold'))
    removepoint(0,@ptnum);

having v.y < "whatever"  doesn't work in my case because the pieces have negative velocity. So I get the abs of the @v.y. This seems to be working!!!

dat_code_tho.PNG

Edited by ejr32123
Link to comment
Share on other sites

Hi, I looked into your sample file, hopefully the attached hip file is something close to what you were after.

Basically, you would need to use length(@v) to get the speed, and not use @v.y
You could also remap that to a value or color (for visualization), then use that to control the smoke emission strength.

Houdini 16.0.731 Apprentice - delete_geo_v2.zip

 

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