Jump to content

switching to glue


logix1390

Recommended Posts

Hello,

I am trying to switch from a Hard constraint to a Glue constraint which I have successfully done.

However I am trying to switch to the glue constraint only for the pieces that are broken.

I know bullet automatically  creates a broken group so I am using this information in a sop solver like this:

if(s@constraint_name=="Hard"){
    if(f@force>400 || f@angle>.1){
    i@group_broken=1;
}}

else{
i@group_broken=0;
}

Then in another primitive wrangle:

if(@Frame>31){

    s@constraint_name="glue";
    s@constraint_type="all";
    f@strength*=-1;
}

 

 

Now this actually works ... however the glue constraint is rebuilding and connecting back to the unbroken group which means it is freezing in mid air ( I am aware i set my strength to -1).

How can I tell it to only rebuild the glue constraint only in the broken group and not connect anything back to the unbroken group.

The goal is to break the wall and maintain a large dent as it breaks.

 

I have been trying to figure out a solution for a few days now..any help would be greatly appreciated.I will attach my scene file for anyone that wants to take a look.

Thank you

switch_to_glue_from_broken.hipnc

Link to comment
Share on other sites

Hi Viktor.

I went through that thread a few times and all the scene files. I am not trying to do anything overly sophisticated or advanced like what they are doing, I just need to know how I can rebuild the glue constraint network only in the broken group without it connected back to my static unbroken group. I was trying to work with the "@next_constraint_name" attribute that bullet recognizes but i havn't had any luck with that either...

would love to get any tips. 

Link to comment
Share on other sites

not sure what you're trying to do with -ve strength: (it's unbreakable)

I would go for strength = 0

EDIT: ah ok, maybe it's to do with you wanting to retain the 'large dents'...my bad.

Edited by Noobini
Link to comment
Share on other sites

Hey Noobini,

I am trying to achieve  bending/ large denting to my wall while staying dented as it falls to the ground...

So the -1 strength is so that the wall deforms by the hard constraint and then stays deformed after a certain condition

in this case , if Frame>31 then switch to Glue with negative value. (Should be a frame  26 actually)

If I set my strength to 0 then the glue will eventually break and not hold my deformation.

It is working fine...The only problem is that I only want the glue constraint to rebuild on the part that is broken (top half of the wall) and not the static part.

Even if I set the wrangle to the broken group , it will not work. 
 

 

Link to comment
Share on other sites

Hi Mike,

if rebuild constraints from broken group they connect the same pieces again and this behavior is currently in your simulation. I clearly don't understand what you want to achieve therefore I made two wrangle in sop solver DOP. Take a look, maybe it is what are you looking for.

switch_to_glue_from_broken_01.hipnc

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