Jump to content

Cloth updating constraints groups problem


Juraj

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

Link to comment
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
Link to comment
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
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...