Solaris & Emitting Rigid Bodies

   972   4   3
User Avatar
Member
11 posts
Joined: March 2022
Online
Hi,

I am relatively new to Solaris so this might be a simple fix for someone with more experience.

I have been trying to get my head around how to get a cleaner setup inside Solaris after having done a RBD simulation which focuses on emitting rigid bodies. My problem is when I import my completed sim, which runs fine inside Solaris, the structure of my scene graphs becomes really hard to work with if I would like to apply materials to the rigid bodies which have been emitted.



My first guess was to use the instancer node in LOPs but I can't see how to work with it together with a completed RBD sim.
I'm curious how someone more experienced would go about setting this up.

Many thanks in advance!

Image Not Found
Edited by ESPx - Sept. 11, 2023 14:42:06

Attachments:
emit_RBD_solaris.hiplc (768.1 KB)
bad_scene_graph_from_rbd_emit.png (129.9 KB)

User Avatar
Staff
360 posts
Joined: Feb. 2008
Offline
I've updated your hipfile and added annotations where needed.
One issue that is unnecessarily making the stage more complex than it needs to be is that you are RBD Packing the packed geo (after the RBD Configure) but not RBD Unpacking it after the copy to points, so you end up with packed packed geo.

With point instances, if you want to vary the material per instance you'll want to do it using primvars.

Native instances will allow you to assign a different material per instance, however your stage could end up with thousands of instance prims which will impact the performance of the USD stage.

Attachments:
emit_RBD_solaris.hiplc (802.0 KB)

User Avatar
Member
11 posts
Joined: March 2022
Online
Hi npetit,

Thank you so much for the great examples & annotations and direction to go in. It was very helpful and much appreciated!
Thank you again,

Cheers!
User Avatar
Staff
360 posts
Joined: Feb. 2008
Offline
I forgot to mention, with emitted RBDs, your stage will likely be changing dynamically, which is a big no-no.
For example, with native instances, you'll have new instance prims popping up on the stage as they are emitted, and likewise, with point instances, new prototypes will appear once they have been emitted.
USD doesn't like this.
With point instances, you'll want to "emit" one of each prototype right from the start, and set them to be invisible (usdvisibility string point attrib set to "invisible").

With native instances it's a bit trickier - you'll want to animate their visibility. You can do this by adding a SOP solver between 2 timeshift SOPs inverting the frame range, accumulating all the emitted geo and setting the visibility accordingly.

That way you have a constant USD prim count and the stage won't be changing dynamically under your feet.

Here's an updated hip file doing the proper thing.

Attachments:
emit_RBD_solaris.hiplc (830.1 KB)

User Avatar
Member
11 posts
Joined: March 2022
Online
Amazing! Thank you. Answers to questions I didn't know I had.
  • Quick Links