Jump to content
Juraj

Cloth updating constraints groups problem

Recommended Posts

Hello,
I encountered problem when I tried to dynamically change groups for cloth constraints. I've tried SBD Pin Constraint  to attach cloth to animated geometry. As goal object I used geometry with same topology but animated one. When I am not changing pin group it works fine, but I need to change constraints during simulation. But then it goes funky, it seems as it cannot correctly assign constrained point to goal point.

Next thing I tried was to use Cloth Attach Constraint node which works almost fine, but during updating pin group points slide over goal object.

Could you check attached file? I am not sure what I am doing wrong.

Basically what I want to do is to attach points of cloth to animated geometry and then release it. Is there some other way to achieve that?

Thanks,
Juraj

jt_update_groups.hipnc

Share this post


Link to post
Share on other sites

Sliding with Cloth Attach Constraint happens because Cloth object collides with static object. To turn off this collision just turn off "Collide with objects in other solvers" in Collision tab on Cloth Object DOP.

 

Share this post


Link to post
Share on other sites

Hi,
I've tried that but it didn't help. I also disabled collisions in merge node.

 

Share this post


Link to post
Share on other sites

Ok then try to set pin to animation directly with wrangle:

You can also disable that static object (and static solver) completely. Disable cloth attach constraint too and use wrangles. In your first geometry wrangle add:

f@pintoanimation = 0;

Which releases all cloth pieces.

Than add another Geometry Wrangle behind that and set it to affect only "pin" point group and enable animation with:

f@pintoanimation = 1;

So no need for another constraints or static objects, just use attributes for FEM solver directly.

 

For importing animation you can use Import Target Geometry on the Cloth Object and point it to your animated mesh.

 

And if you don't want to set f@pintoanimation in wrangles you can use Target Constraint with Type set to hard and with your "pin" group in Constrained Points and Cloth object in Constrained Object.

Edited by pezetko
syntax highlight, target constraint

Share this post


Link to post
Share on other sites

Hi,
great! I hoped there would be some attribute based solution. Exactly what you suggested.

One Geometry Wrangle did the job.

@group_pin = inpointgroup(1, "pin", @ptnum); // update groups from SOPs

if (@group_pin) f@pintoanimation = 1;
else f@pintoanimation = 0;

I completly missed this pintoanimation attribute feature. Now it works like a charm :)

Attaching fixed file,
diki za pomoc

jt_update_groups_fix.hipnc

Edited by Juraj Tomori
typo in code
  • Like 1

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

×