Jump to content

Copy/Stamp/Foreach question


Recommended Posts

Hey guys,

I'm trying to achieve the following effect:

1. Break a model up using the 'shatter' SOP.

2. Move the resulting pieces to a network of particles.

I'm getting quite close but can't seem to figure out how to get it to work. I know how to instance a single piece of geometry onto several particles, and there's even a help file example scene detailing how to do it with a random bank of objects ... but I want to have the shattered object basically just "float" around the scene, as I will have to do this to about a dozen or more objects, and might have to change the size of the pieces, so this would have to be a bit dynamic or adjustable.

Any help is greatly appreciated.

Thanks,

m

Link to comment
Share on other sites

For a simple case where your floating number of points = number of pieces in your shattered obj.

piece0 goes to -> pt 0, piece1 -> pt1.. piece N-1>ptN-1,pieceN>ptN.

Put down a copy sop, enable stamp inputs with a stamp variable called "cnum" = $PT.

Feed the shattered obj to input 1 and template points (likely to be coming out of pop sim) to input2.

Now we stamp each piece group to points using delete sop on shattered obj.

Choose delete nonseletcted with following expression in group field.

`arg(primgroupmask("../shatteredobj","piece*"), stamp("../copy1","cnum",0) )`

adjust the pivot of each group using transform sop $CEX,$CEY$CEZ, before it goes in to the copy sop.

You can further control the orientation using ( upvector , velocity), scale using(pscale) via point sop on template points.

Cheers!!

Edited by vectorblur
Link to comment
Share on other sites

Hey Vector,

Thanks for your help! I tried following your advice, but I'm getting a node error on the copy SOP.

Do you think you coud take a look at the attached file and let me know what I am doing wrong?

Thanks!

m

For a simple case where your floating number of points = number of pieces in your shattered obj.

piece0 goes to -> pt 0, piece1 -> pt1.. piece N-1>ptN-1,pieceN>ptN.

Put down a copy sop, enable stamp inputs with a stamp variable called "cnum" = $PT.

Feed the shattered obj to input 1 and template points (likely to be coming out of pop sim) to input2.

Now we stamp each piece group to points using delete sop on shattered obj.

Choose delete nonseletcted with following expression in group field.

`arg(primgroupmask("../shatteredobj","piece*"), stamp("../copy1","cnum",0) )`

adjust the pivot of each group using transform sop $CEX,$CEY$CEZ, before it goes in to the copy sop.

You can further control the orientation using ( upvector , velocity), scale using(pscale) via point sop on template points.

Cheers!!

copyforeachquestion.hip

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