RBD Initial State /w Packed Primitives
28403 23 2- Constantine Petrov
- 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.
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.
- old_school
- 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.
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.
There's at least one school like the old school!
- cwhite
- Staff
- 750 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.
- Constantine Petrov
- Member
- 23 posts
- Joined: Aug. 2013
- Offline
- xukca
- 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:
- chrish
- Member
- 6 posts
- Joined: March 2006
- Offline
xukcaOne 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):
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?
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
- Ratmann
- Member
- 110 posts
- Joined:
- Offline
chrishxukcaOne 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):
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?
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
- Ratmann
- Member
- 110 posts
- Joined:
- Offline
- xukca
- Member
- 50 posts
- Joined: July 2013
- Offline
RatmannchrishxukcaOne 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):
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?
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:
- chrish
- 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
It does exactly what you are trying to do in keeping the non-active pieces animating from SOPs.
-Chris
xukcaRatmann
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:
- Dominic Carus
- 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.
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.
- asnowcappedromance
- Member
- 512 posts
- Joined: July 2009
- Offline
- cwhite
- Staff
- 750 posts
- Joined: Oct. 2012
- Offline
- koen
- Member
- 793 posts
- Joined: April 2020
- Offline
- cwhite
- Staff
- 750 posts
- Joined: Oct. 2012
- Offline
- Netvudu
- 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?
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.
FX TD.
- Netvudu
- Member
- 304 posts
- Joined: May 2006
- Offline
- pavelPeh
- 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:
- pavelPeh
- 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.
NetvuduIt will just compute the pivot for you, the same as if you add angular velocity after the first frame.
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?
Cheers!
- Netvudu
- 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.
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.
FX TD.
-
- Quick Links