How to compute velocities when reading 'pdg_input'

   2226   2   1
User Avatar
Member
37 posts
Joined: March 2014
Offline
Hey guys,

I'm came across a limitation (I think) when I'm trying to compute velocities with the trail sop, while I read my input files via the ‘@pdg_input’ variable.
I guess it makes sense, that while cooking a pdg network and using the trail sop, pdg doesn't necessarily know, what the frame before or after is (except when cooking simulations with the ‘all frames in one batch’ option).
So my question is, how (or if at all) I can utilize the trail sop when working with @pdg_input?

Please find attached a simple setup that illustrates the “problem”.

Cheers,
Michael

Attachments:
trail_sop_inPDG.zip (194.1 KB)

User Avatar
Staff
585 posts
Joined: May 2014
Offline
You can use a Partition By Range node after your Cache Box TOP node, with the “Left Offset” set to 1. That will create a partition for each upstream frame that also includes the previous frame (or more, if you increase the offset value). Then generate your next set of work items off those partitions, which will have the current and previous cached geometry file lists as outputs.

You can access them in your SOP network using `@pdg_input.0`, `@pdg_input.1`, or using the `pdginput(index, tag, localize)` function:
See https://www.sidefx.com/docs/houdini/expressions/pdginput.html. [www.sidefx.com]

For example, you can set the File SOP to something like the following, so that it will load @pdg_input.0 on the previous frame and @pdg_input.1 on the current frame: `pdginput($F-@pdg_frame+1, “”, 0)`
User Avatar
Member
37 posts
Joined: March 2014
Offline
Thanks tpetrick!

I will try this first thing Monday morning :-)
  • Quick Links