Jump to content

Recommended Posts

Hey guys, I'm testing some cloth simulation using PBD but couldn't find a way to constraint some areas of it. 

I don't want to constraint it to another object, just want to make those particles to be "frozen". Can someone give me some ideas about this?

N6eBEZS.jpg

Thank you
/Alvaro

Share this post


Link to post
Share on other sites

The i@stuck attribute seems to work.

Add the attribute and set it to 0 or 1 in SOPs on the points that are sourced into DOPs.

  • Like 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Hey! Great that you solved it, sorry my info didn't cut it, I just did a quick test where my stuck point happened to be at the origin :/

Share this post


Link to post
Share on other sites

Hey @ParticleSkull just for the sake of completeness, you can setup the targetP attribute like this:

 YV23Fes.png

WsUInol.png

 

I tested quickly with your scene and the results are exactly the same from what I could see 

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

@Hamp, no worries, thx anyway ;)

btw, I'm trying to tear this but can't have the "mesh tearing" like the particles. It just stretches the mesh. 
In case you guys know a solution, please have a look at this other topic (don't want to mess with this one)

Cheers,
Alvaro

Share this post


Link to post
Share on other sites

Hello, 
This looks like exactly what I need. Will try in the evening. But is there any way that I could animate the pin positions?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

That's some really awesome info, Michael. Thank's!
Please try to upload the scene file, it would be very helpful :)

-
Alvaro

Edited by ParticleSkull

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

×