Glueing Rigid Bodies to static Bodies

   9616   7   4
User Avatar
Member
9 posts
Joined: Jan. 2009
Offline
Is it possible to do this?

At the moment, I have a column that a wing is crashing through, the problem is that the as soon as the wing hits the column it bows in the middle, what I'd like to do is to glue the base and the top of the column to some static objects.

I noticed in the RB glue object there is a generic glue tab alongside the internal glue, which asks for an object, how should objects be referenced in this tab? I have tried and failed miserably!

I know I could do this by separating the the top and base and have them as separate objects and key their activity, but I was trying to do this procedurally - I want to demo about 10 -15 columns.

Any help will be greatly appreciated

Chris
User Avatar
Member
120 posts
Joined: July 2009
Offline
To my knowledge the glue SOP is only for gluing an object together after another SOP has been applied, such as one that shatters it or something along that line.. I don't think you can glue an object to another object as this would be a completely different thing than that.. but I could be completely wrong about this
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
You can glue two objects together. If you open up the details view, you will see the glue reference being built.

Unfortunately glue only works between two active objects. By using the RBD Keyframe Active to make one of the objects passive then glue an active object to this won't work.

What you can do is modify the glue strength between certain objects in your wing and increase the value.

To be frank, I don't like the word “glue”. It's a misnomer. What we are dealing with is a hierarchical RBD system and not glue although glue is what I mostly use this for.

As long as the RBD DOP objects remain active, you can glue any active RBD object to any other object including itself at any time. It's just a couple pieces of data you need to deal with.

Open up a details view and inspect any of the DOP objects that are part of the RBD Glue Object. The Position data folder is the most interesting. In there you will find the two subdata fields: glueobject and gluethreshold. Note that glueobject by default is actually referencing a container RBD object the same name as the original object. Also note that this referenced container object has no geometry associated with it which means that it doesn't register any impacts. It is simply a placeholder object to bind the RBD glue pieces to. You won't find two sets of glue data for internal and external. It's all the same. Each RBD object can only be glued to another object, including itself! That last bit makes things easy for us to modify and keyframe the RBD hierarchies as the sim plays forward.

You can easily create hierarchies of RBD objects. This can be keyframed as well.

With the Viewport set to DOPs selection mode, select the two or more pieces in the wing that you want to increase the glue strength on. Tab type add a Modify Data DOP to the selected DOP objects.
Change Data Name to Position.
Change the Value 0 to glueobject.
Change the Value 0 Type to String.
Change the Value 0 String to one of the selected objects in the Group field. You are remapping the glue group to one of it's own in the bundle. No worries as the neighboring glue objects still bound to the original wrapper RBD object will ensure that everything will be glued together.

Now pres the the + in the Number of Modifiers to add a second entry.
Change Value 1 Name to gluethreshold
Change Value 1 Float to -1 for infinite glue or to a very large number.

Now play forward and see that the pieces you selected remain glued with a much stronger threshold.
As well inspect the details view (spreadsheet) to see that you are actually changing the glue strength.

You can animate any of the parameters in the Modify Data DOP.
You can have a single Modify Data DOP for each RBD object if you want and manage things that way.
You can use DOP groups by selecting your DOP objects in the DOP view mode and then use Modify Data DOPs for each group and key them off and on.

You can have hierarchies of RBD objects. Say a building containers with floor containers glued to it, then components inside the floors glued to themselves.

Glue hierarchies can make things go more efficiently as you are effectively only evaluating the glue objects before the glue finally gives way.

Using the DOP object selector in the viewport makes all this go very quick and easy. Not too many know that you can actually select DOP objects in the viewport and tab type add DOPs to that selection. I use that all the time when adding Group DOPs.

Attachments:
internal_glue_animated.hip (280.3 KB)

There's at least one school like the old school!
User Avatar
Member
9 posts
Joined: Jan. 2009
Offline
Hey Jeff,

Thanks for taking the time out to answer in such detail, I have had a gander through your file and it makes perfect sense, seems pretty straight forward and expandable too.

I'm sure you can probably answer my next question too, I am trying to build up a procedural system to activate rigid bodies based on collision, I have been looking through the on the spot houdini book, and it says to use the..

dopnumrecords(“/obj/dopnet1”, “objectname”, “Impacts”,
“Impacts”)

in conjunction with a modify data dop set to boolean. I want to then utilise this value to key the activation in the key RBD dop through an expression. I tried feeding the above statement into the activation of the modify dop, then created a new data thingy, with a name then set to boolean, and a value of 0 to start with.

then in the key RBD dop, I have the following expression in the active box…

if (ch(“../modifydata1/valvalue0”) > 0, 1,0)

but it doesn't seem to work!!

Any help would be appreciated

Chris
User Avatar
Member
1631 posts
Joined: July 2005
Offline
I think it's best to post an example hip file of what you did so we can take a look at what's going on.

Cheers!
steven
User Avatar
Member
9 posts
Joined: Jan. 2009
Offline
No worries,

I'll get something up in a while.

Chris
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Passive RBD objects do not record impact data themselves. RBD objects that collide against the passive RBD object do record impact data along with the DOP id number.

You need two RBD Keyframe Active DOPs. First valid on the simulation start frame for the passive objects. Second with an expression in it that changes the rbd object to an active state.

If the passive RBD object's id ($OBJID) matches that from a collision RBD object, then you can switch the RBD object to an active object.
The expression loops through all the DOP objects (create a list of all affector objects of me $OBJID) then check to see that they are active RBD objects or just see if they have recorded any impact data. If true, loop through the impacts looking for a matching id to $OBJID. If true make active.
There's at least one school like the old school!
User Avatar
Member
9 posts
Joined: Jan. 2009
Offline
I've attached a simple test scene, basically the sphere is active, the cube is inactive via the RBD Keyframe DOP, I've added a modify data DOP to the end of the tree that ‘should’ be collecting whether an impact has occurred. I have then referenced the modified value in the RBD Key.

the key RBD is doing what it's supposed to do - I can manually modify the modify data value and the body becomes active.

Cheers Guys,

Chris

Attachments:
RBDActivation01.hipnc (116.7 KB)

  • Quick Links