Jump to content
ChrisJudkins

Comparing volume bounds over time

Recommended Posts

Hey everyone, I'm sure this problem has a super simple solution but I'm a bit stumped.

 

I have a cached smoke simulation, and I need get the bounds of the volume at every frame so that I can create a new volume with bounds big enough to fit every cached frame. However, this obviously needs to happen before each frame is evaluated in Houdini (otherwise the new volume's bounds will just match those of the current cache frame).

 

Is there any way I can get Houdini to fetch the bounds of the sequence before cooking the rest of the network, or alternatively create a volume that matches the current frame's bounds (as long as it is larger than previous frames)?

Share this post


Link to post
Share on other sites

Best way to do this is to use Chops, since that cooks it's incoming values for the entire frame range on the first frame. Ideally you want to send as little information as possible over to Chops, so in this example I'm creating two points at minimum and maximum positions of the incoming geometry's bounding box each frame. Once in chops I'm using the Expression Chop with icmin()/icmax() to find the min/max values of the min/max points over the entire frame range. This then gets piped back out into sops, moving the points to these minmin maxmax positions. After that a Box Sop or Volume Sop can be plugged into these guys. This is the kind of thing you build once, make into and HDA and just use forever. Gets you around using a Solver/invoking Dops and having cook and cache the last frame, and it's super fast since you're only really working with 2 points. 

 

You'll notice that nothing is plugged into the first input of the Attribute Vop where the points are created, this is just one of many ways to get these points. The Attrib Vop is in Detail mode so it doesn't need input geometry to iterate over, in this case you don't want to carry through the geo that you are bounding so you plug it into Input 2 and leave Input 1 alone. 

 

Fun?

max_bbox.hipnc

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×