Particle tips HoudiniSimulationCaches

From PopcornFX
Jump to: navigation, search

For PK-Fx Editor version : 1.11.0 and above
Main page: Particle tutorials

Particle layers can now be driven from an offline simulation cache, generated from Houdini for example. This page will explain the export and import process from Houdini.

Simulation

It is important to understand not every simulation can be exported from Houdini, only point based ones. Keeping that in mind, you can benefit from Houdini's powerful offline solvers and import those point simulations to be played back in realtime.

Any point can theorically be exported as long as it matches those requirements:

  • Those points have a P attribute representing their position
  • They are not removed/deleted across the sim
  • They have a unique id attribute to identify them in order to enable interpolation in PopcornFX

You can make sure of that by opening the Geometry Spreadsheet pane in Houdini: Tips Houdini Geometry.jpg

Particle solvers

POP solvers only need to have Reap Particles disabled. You can manually kill particles using the dead attribute in realtime.

Always make sure before exporting that all attributes are consistent across frames by using the geometry spreadsheet.

Some point attributes are often missing on the first frame:

  • dead
  • force

They will be by default ignored at import time.

Tips Houdini POPSolver.jpg

FLIP Fluid solvers

FLIP Solvers need to have:

  • Add ID attribute checked if you want to enable interpolation
  • Kill Outside Volume Limits disabled otherwise points would be removed
  • Reseed Particles disabled otherwise points would be removed/added dynamically

Tips Houdini FLIPSolver Behavior.jpg Tips Houdini FLIPSolver Reseeding.jpg

Other

If you discover cool new use cases, let us know !

Export

Exporting is possible by using the ROP Output Driver SOP with the data to export as input. All frames should be exported in the .json file format and should follow this naming convention: YourFrameNames.$F.json

Tips Houdini ROPSOP.jpg Tips Houdini ROPSOP Properties.jpg

Compression

The DOP I/O SOP node has a compression tab that you can use to remove attributes before feeding all data inside the ROP Output Driver SOP node. This will make exported json files lighter and export time shorter.

Tips Houdini DOPIO Properties.jpg

You can also use the Attribute Delete SOP node to remove point attributes

Import

To import an offline simulation, right click in PopcornFX's content brower and select 'Import Offline Simulation', then select the folder containing all .json frames

Tips Houdini ImportOfflineSimulation.jpg

All point attributes present within the simulation will be displayed inside the import dialog. You can select the ones you want to keep:

Tips Houdini ImportDialog.jpg

Budgets can be defined within the project settings under Assets -> Import Some fields will be hidden / removed by default from the simulation. You can add/remove points inside the project settings.

If no errors were encountered, you can now use this simulation cache, see Particle Spawner for more detail.