Jump to content

Granular Sheet - Pin Constraint


ParticleSkull

Recommended Posts

Thank's guys! 

EDIT: I've attached the file, just in case 

@Hamp, thx man! i've tried it but all the points are going to the scene orgin, check it out:

wtoRgNr.gif

here's how i've done the setup, it look's fine, just like you said:

txa99cV.jpg


Hey @vtrvtr, thx! I couldn't get any good results from it yet but i'm still diggin' it. Might have ask you something in a while ;)

/Alvaro

granular sheet pin.hiplc

Edited by ParticleSkull
Link to comment
Share on other sites

Hey, solved it!

doing some research on the targetP attribute I found this saying:

" Set the mass of grain particles to zero (mass == 0).

They will stop responding to external forces and the PBD update, giving you complete control over their motion.

If you are driving their positions from external animation, remember to set their velocities correctly. "

Here's the steps to achieve it:
1 - On the Grain Sourc (SOP level), you have to switch on "compute mass" (it looks like you must turn off "ignore mass" on all the forces you're using);

2 - Group the particles you want to be pinned;
3 - Create an attribute for the group of particles setting mass to 0 (anyone know it doesn't work with the Attribute Wrangle and just with the Attribute Create?);

Scene fixed it attached

dY6hrkb.jpg
 

granular sheet pin - fixed.rar

  • Like 2
Link to comment
Share on other sites

  • 10 months later...

If you just want to freeze some particles you can use the ‘stopped’ integer attribute. If you want to animate the pinned particles you will need to update targetP in pops (as has been mentioned above).

I’ve been doing a lot of ‘cloth tearing’ recently with grains and it requires a bit more of a setup but it’s doable.

Essentially you need to:

- prefracture the mesh

- store a class attribute on the points (that will get picked up by the grain source)

- for your constraints, in a primitive wrangle, check the two primitive points (using primpoint function) and compare their class values, if they are the same the constraint exists ‘within’ a fractured piece so we set its strength attribute really high (1x10^8 for example), if the class value is different you know the constraint connects two different fractured pieces so we want to make it tearable, so set the strength much lower (maybe 0.5)

- enable break constraints on the grain solver and tweak the break threshold until you get some nice tearing.

Post sim:

- use a point deform node to drive the mesh by the points, but we want each fractured piece to be driven only by its corresponding grains points otherwise the mesh will stretch. You could try doing this in a for loop but that is very slow so I think the following is better:

- time shift the mesh to frame 1, offset the point position by the class value (@P += i@class) and feed this into the first input of a point deform

- time shift your grain sim to frame 1 and offset it by class too (it should line up in space with the mesh), and feed that into the rest input of the point deform

- feed the animated grain sim points into the template points input of the point deform

- if done correctly the mesh should tear cleanly with the points.

To get a nicer tear there it’s actually a bit more work to be done, I’ll try and upload an example hip file if I have time.

Maybe someone knows of another method?

Edited by michaelb-01
  • Like 2
  • Thanks 1
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...