RBD Initial State /w Packed Primitives

   28156   23   2
User Avatar
Member
23 posts
Joined: Aug. 2013
Offline
Hey everyone,

Back in previous Houdini versions I used variable $OBJID quite often on my RBD Fractured Object, particularly in the Initial State or Physical tabs to set some randomness in mass or initial velocity using rand() expression and $OBJID variable to achieve per-object effect.

What would be a good way doing this today, since RBD Packed is one object?

Thanks.
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Since all the attributes lie on the points now, you can use a Multiple Solver with the RBD Solver wired in to it along with a POP Wrangle SOP to randomize the geometry attributes.

I find this a lot more accessible and flexible. You can easily see the values on the points in the Details View on the second frame.

See the attached file.

Attachments:
rbd_packed_prims_with_popwrangle_rand_mass_vel.hip (670.9 KB)

There's at least one school like the old school!
User Avatar
Staff
748 posts
Joined: Oct. 2012
Offline
Jeff's answer is probably the best approach, but note that you can also create attributes in SOPs and the RBD Packed Object will inherit those values. The parameter values on the RBD Packed Object DOP (such as ‘density’) become the default values for the point attributes, but any existing values won't be overwritten. I've attached an example that sets the ‘active’ point attribute to zero in the SOP network to disable some of the packed primitives.

Attachments:
packed_prim_attributes.hipnc (419.4 KB)

User Avatar
Member
23 posts
Joined: Aug. 2013
Offline
Thanks a lot Jeff and cwhite!

It really is more flexible.
User Avatar
Member
50 posts
Joined: July 2013
Offline
Packed geometry are really so faster than normal RBD, but they dont have “use deforming geometry” option Is it possible to pull a SOP level animation somehow in the DOPS? I'm really inlove with all the point attributes and their pop interaction, but for some advanced stuff u need to have animated/deforming geo… :roll:
User Avatar
Member
6 posts
Joined: March 2006
Offline
xukca
Packed geometry are really so faster than normal RBD, but they dont have “use deforming geometry” option Is it possible to pull a SOP level animation somehow in the DOPS?
One way to accomplish this is to use a point() function in a POP Wrangle DOP VEXpression (see Jeff's post for an example hip with POP Wrangle and Multiple Solver DOPs):
if (!@active) @P = point(“oppath/to/deforming/sop”, “P”, @ptnum);
There are probably more elegant and robust solutions – if you find one, please share on the forum!

-Chris
User Avatar
Member
110 posts
Joined:
Offline
chrish
xukca
Packed geometry are really so faster than normal RBD, but they dont have “use deforming geometry” option Is it possible to pull a SOP level animation somehow in the DOPS?
One way to accomplish this is to use a point() function in a POP Wrangle DOP VEXpression (see Jeff's post for an example hip with POP Wrangle and Multiple Solver DOPs):
if (!@active) @P = point(“oppath/to/deforming/sop”, “P”, @ptnum);
There are probably more elegant and robust solutions – if you find one, please share on the forum!

-Chris

Hey Chris, bumping this up a bit, This seems to be working, but now I would to be able to do the same for the orient attribute.

I'm doing some sims where I want the non-active RBD pieces to continue with an animation, I was able to get the P value for position working, but orient so far isn't working.

I am able to generate an orient attribute on the pieces inside of sops, I test it using a Transform Pieces object and that works.

So far I can't seem to get it working with a POP or Geometry Wrangle nodes.

Thanks!
-Rick
User Avatar
Member
110 posts
Joined:
Offline
After diving into the Transform Pieces node, now I'm thinking it might not be so simple
User Avatar
Member
50 posts
Joined: July 2013
Offline
Ratmann
chrish
xukca
Packed geometry are really so faster than normal RBD, but they dont have “use deforming geometry” option Is it possible to pull a SOP level animation somehow in the DOPS?
One way to accomplish this is to use a point() function in a POP Wrangle DOP VEXpression (see Jeff's post for an example hip with POP Wrangle and Multiple Solver DOPs):
if (!@active) @P = point(“oppath/to/deforming/sop”, “P”, @ptnum);
There are probably more elegant and robust solutions – if you find one, please share on the forum!

-Chris

Hey Chris, bumping this up a bit, This seems to be working, but now I would to be able to do the same for the orient attribute.

I'm doing some sims where I want the non-active RBD pieces to continue with an animation, I was able to get the P value for position working, but orient so far isn't working.

I am able to generate an orient attribute on the pieces inside of sops, I test it using a Transform Pieces object and that works.

So far I can't seem to get it working with a POP or Geometry Wrangle nodes.

Thanks!
-Rick

@Chris, thank you for this nice piece of code, its amazing!

@Ratmann, I was also able to get quaternion orient attribute (very simple with qLib sops IMO), but if I just get them into dops, they does not seem to be sufficient. I have done some other tests and it seems that packed prims in DOPs need not only P and orient attributes, but also pivot, trans, v and w . I dont know how to generete these attributes from SOPs (I have been able to copy paste dynamically some objects in DOPs tho, thats why I'm sure that it works, if you have right values for all these attributes). Any further comments/help on this issue is greatly appreciated. :idea:
User Avatar
Member
6 posts
Joined: March 2006
Offline
Hi, Here is an example file, originally from SESI support, that shows how to update the translation, orientation, angular velocity, and pivot, using an Attrib Wrangle inside of a SOP Solver in DOPs.

It does exactly what you are trying to do in keeping the non-active pieces animating from SOPs.

-Chris

xukca
Ratmann
Hey Chris, bumping this up a bit, This seems to be working, but now I would to be able to do the same for the orient attribute.

I'm doing some sims where I want the non-active RBD pieces to continue with an animation, I was able to get the P value for position working, but orient so far isn't working.

I am able to generate an orient attribute on the pieces inside of sops, I test it using a Transform Pieces object and that works.

So far I can't seem to get it working with a POP or Geometry Wrangle nodes.

Thanks!
-Rick

@Ratmann, I was also able to get quaternion orient attribute (very simple with qLib sops IMO), but if I just get them into dops, they does not seem to be sufficient. I have done some other tests and it seems that packed prims in DOPs need not only P and orient attributes, but also pivot, trans, v and w . I dont know how to generete these attributes from SOPs (I have been able to copy paste dynamically some objects in DOPs tho, thats why I'm sure that it works, if you have right values for all these attributes). Any further comments/help on this issue is greatly appreciated. :idea:

Attachments:
rbd_packed_deforming.hip (285.4 KB)

User Avatar
Member
15 posts
Joined: April 2013
Offline
Hey Chris, thanks for posting that file.
Has there been any further information provided on this topic?

Im facing a similar problem of spawning rbd geometry from an existing rbd object using packed primitives and Im struggling to manage the various attributes in order to get the new pieces positioned, oriented and setup with the correct attributes.
Although the example posted covers some of this, beyond copying whats there, I dont feel confident in fully understanding the thinking behind the workflow.

I guess Id really like to hear from sidefx on how and why the attributes on packed objects are designed, and how best to work between a sop solver for managing geometry creation and positioning, alongside the bullet solver.
User Avatar
Member
512 posts
Joined: July 2009
Offline
I just ran into this issue myself where I want to have a packed primitive object in DOPs to be non-active, but follow the animation - turns out you only have to crack open the RBD Packed Object and set the time parameter on the “sopgeo1” node to update on every time step (Set Always).

Cheers,

Manu
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
User Avatar
Staff
748 posts
Joined: Oct. 2012
Offline
In H14, support for animated / deforming packed primitives is built-in, via the Initial Object Type menu. (this just sets the initial values for the ‘animated’ and ‘deforming’ point attributes).
User Avatar
Member
793 posts
Joined: April 2020
Offline
Hello all,

sort of related to this. How do you properly set the angular velocity, in combination with “compute center of mass” ?

In the attached file, I'd just like the boxes to spin around their center, instead of going crazy. Any thoughts? ( it is working on the point object).

Thanks,
koen

Attachments:
packed.hip (267.6 KB)

User Avatar
Staff
748 posts
Joined: Oct. 2012
Offline
Currently, the initial pivot needs to be set to a sensible value (e.g. P) - that's what happens behind the scenes in the RBD Point Object. There's an active RFE to improve this behaviour, though, and make it simpler to correctly set up initial angular velocities.
User Avatar
Member
304 posts
Joined: May 2006
Offline
well, I tried adding the P values to the pivot attribute from SOPs and I still couldn´t get it to work. When I add a “w” attribute from SOPs it still moves every piece around as if the pivot was elsewhere.

Any hints?
I´m having to do this with a randomized POP Spin, which works but it´s inconvenient for what I´m trying to do.

EDIT: Ok! This is very interesting! If I make it a deforming body it works as expected WITHOUT having to add the pivot. It just behaves they way it should. Of course making it deforming slows the sim considerably, but here comes the most interesting part!

If I animate the deforming attribute so that it´s 1 ONLY during Frames 1 and 2 and then it goes back to 0, it also works as expected BUT without the performance hit of having deforming active all the time. Curious, ain´t it?
Javier Meroño
FX TD.
User Avatar
Member
304 posts
Joined: May 2006
Offline
I´m adding an example hip file so that anyone can check how this indeed works.

I´m on 14.0.243, by the way.

Attachments:
PackedAngularRandomTest.hiplc (225.6 KB)

Javier Meroño
FX TD.
User Avatar
Member
30 posts
Joined: May 2012
Offline
cwhite
Currently, the initial pivot needs to be set to a sensible value (e.g. P) - that's what happens behind the scenes in the RBD Point Object. There's an active RFE to improve this behaviour, though, and make it simpler to correctly set up initial angular velocities.

Hopefully this will fix the behaviour when adding pieces whithot recomputing center of mass too, as this is a real problem right now :cry:
User Avatar
Member
30 posts
Joined: May 2012
Offline
Netvudu
I´m adding an example hip file so that anyone can check how this indeed works.

I´m on 14.0.243, by the way.

I tested it on 14.0.221 and it seems that it works just fine. As Cameron said you have to set manually the initial pivot to match/be closer to initial P. The problem in your scene is that your SOP object has object level transformation so you must consider this when computing the pivot before simulation. Either that or even easier - just don't use object transformations.

Netvudu
If I animate the deforming attribute so that it´s 1 ONLY during Frames 1 and 2 and then it goes back to 0, it also works as expected BUT without the performance hit of having deforming active all the time. Curious, ain´t it?
It will just compute the pivot for you, the same as if you add angular velocity after the first frame.

Cheers!
User Avatar
Member
304 posts
Joined: May 2006
Offline
ah, you´re right.
It was object transformations that were driving me off.
Forcing deformation for just a couple of frames I was forcing Houdini to recalculate the pivot position.

So, it´s only necessary to add the pivot attribute with P values as well as the angular velocity.

Thanks pavel.
Javier Meroño
FX TD.
  • Quick Links