Jump to content

Seamingly Simple task. Please Help


Nubnubs

Recommended Posts

Hey all,

So I'm doing a rigidbody sim and I have about 175 objects all of which have there own pin constraint. Here comes the tricky bit which I'm having problems solving.

I need to release all of the pin constraints at a certain point but really don't want to hand animate the activation on 175 pin constraints.

Is there a way that I can use, say a sphere, that I can animate moving over the objects and that sets the pin constraint activation attribute to 0?

I'm hoping this is a simple task and it's killing me. Know how I would do it in Maya but houdini is a different story.

Thanks

Nubs

Link to comment
Share on other sites

So I'm doing a rigidbody sim and I have about 175 objects all of which have there own pin constraint. Here comes the tricky bit which I'm having problems solving.

I need to release all of the pin constraints at a certain point but really don't want to hand animate the activation on 175 pin constraints.

Is there a way that I can use, say a sphere, that I can animate moving over the objects and that sets the pin constraint activation attribute to 0?

Are you using ApplyRelationship to create all the pin constraints? You should be able to put an expression in the Activation field of the pin constraint that references an animated channel or another object in the RBD Sim. See attached for an example of one way to do it. In this case, the "breaker" object is really only part of the simulation for visualization; you could do the same thing referencing an animated channel at the OBJ level or whatever.

multipin_disable.hip

Link to comment
Share on other sites

Are you using ApplyRelationship to create all the pin constraints? You should be able to put an expression in the Activation field of the pin constraint that references an animated channel or another object in the RBD Sim. See attached for an example of one way to do it. In this case, the "breaker" object is really only part of the simulation for visualization; you could do the same thing referencing an animated channel at the OBJ level or whatever.

Hey, thanks for the reply.

A bit more info, I had to create the geometry in maya because the scene called for a very specific layout of objects. I then brought the objects into houdini via fbx and made all the objects rbd's. then I applied pin constraints to all of the objects, didn't know about the apply relationship node, I therefore have a pin constraint for every object. Don't know if this changes anything? The look that you have got in your file is exactly what I am looking for! Will it make a difference if I use many pin constraints or just the apply relationship node?

EDIT: ok, so I understand how it all works now after diving through your file. One thing I'm not sure of is how I can use the apply relationship to create the pin constraints to all the objects, ie. get the objects location and place the pin just below it.

nubs

Edited by Nubnubs
Link to comment
Share on other sites

Cool, I got it, Lots and lots of copying and pasting later it's working. The problem i ran into with trying to use the apply relationship thing was that the transforms on the objects from maya where 0 after bringing them in from Maya. so I used the 175 pin constraints all with a script on the activation.

Thanks for your help johner!

Link to comment
Share on other sites

Cool, I got it, Lots and lots of copying and pasting later it's working. The problem i ran into with trying to use the apply relationship thing was that the transforms on the objects from maya where 0 after bringing them in from Maya. so I used the 175 pin constraints all with a script on the activation.

Thanks for your help johner!

You're welcome. Just so you know, I wouldn't necessarily consider this a "simple" task. Deactivating the constraint, yes, but creating 175 of them in the first place, not so much. ApplyRelationship is, in my book, the most complicated-yet-powerful node in Houdini, which is saying something. It's tough to wrap your brain around, but worth it once you do, because it's incredibly flexible.

You can create your constraints using ApplyRelationship set up the way it is in the example I gave you, but you have to take into account the order in which DOPs does things. When pulling in geometry with 0 transforms like yours, the first thing the RBD solver does it figure out its center-of-mass and make that the pivot. That pivot is the value you want to use in your constraint position exp​ression, but there's a bit of a chicken-and-egg thing going on, since the solver has to run to calculate the pivot, but you want to apply your constraint to the object before the solver runs, if that makes sense.

There's a few ways around this, but I'm attaching an example where I'm basically just doing things frame-by-frame at the start. The objects are all created by an RBD Fractured Object, which for this example just means that they will have a non-zero pivot, and I think that's how your objects should look. "Solve on Creation Frame" is turned on, meaning they will be solved at frame 1 and the pivot calculated. The ApplyRelationship is only activated at frame 2 and above, and the Pin constraint can then use an exp​ression based on the pivot to place the constraint directly above the center-of-mass. Gravity is turned on at frame 2 as well, and then at frame 3 an "initial" velocity is given to the objects. Step through the first few frames to see these things in order.

Edit: and crank up the "Number of points" to 175 in the scatter1 node in the "scattered_spheres" Geo object if you want to judge the performance of 175 constraints created this way.

You can do these steps as frames -1, 0, 1 if you need them to start at frame 1, changing the "Start Frame" on the simulation node itself as needed.

So, like I said, not simple, but definitely doable.

Good luck

multipin_pivots.hip

Edited by johner
Link to comment
Share on other sites

Man, that is so cool. I'm getting all excited about houdini now. Got it on Friday last week for doing this shot that I was asking for help with. I think that my Maya days have come to an end.

I pulled your file apart and then put it back together, thanks again for your help!

Doing effects in Houdini is just more fun than doing them in Maya, Maya just seems to want to fight you every step of the way, especially when you're using alot of geometry and your scene gets heavy, that's when Maya turns around and gives you the finger. Houdini just says "Please sir, can I have some more".

Nubs

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