|
| 1 | +# Splashsurf Studio |
| 2 | +Splashsurf Studio is a Blender add-on for on-the-fly surface reconstruction of fluid simulation data. It leverages the `pySplashsurf` Python library, which is based on the [`splashsurf`](https://splashsurf.physics-simulation.org/) tool and library. |
| 3 | + |
| 4 | +The add-on interface can be found in the 3D Viewport toolbar (accessible via the `N` key) while in Object Mode. |
| 5 | + |
| 6 | +Splashsurf Studio interprets the vertex positions of any Blender object as particle coordinates to perform surface reconstruction using `pySplashsurf`. |
| 7 | +A common workflow involves loading particle data from SPH (Smoothed Particle Hydrodynamics) simulations using the [Sequence Loader add-on](https://extensions.blender.org/add-ons/sequence-loader/). |
| 8 | +As the Sequence Loader updates the input file on each frame change, Splashsurf Studio automatically refreshes the surface reconstruction to reflect the new data. |
| 9 | + |
| 10 | +### Note on Geometry Nodes |
| 11 | + |
| 12 | +Currently, the add-on cannot use geometry generated by Geometry Nodes as input for surface reconstruction due to Blender's execution order. |
| 13 | +Only base geometry or geometry loaded via tools like the Sequence Loader add-on is supported. |
| 14 | +However, the reconstructed surface itself can be used as an input for Geometry Nodes. |
| 15 | +If you are interested in contributing to improve the flexibility of the add-on, please contact us via our [GitHub repository](https://github.com/InteractiveComputerGraphics/splashsurf). |
| 16 | + |
| 17 | +If you want to use both, Geometry Nodes *and* Splashsurf, on the same input geometry (e.g. to render particles and surfaces in the same scene) it is recommended to create a separate object with a placeholder mesh (e.g. a cube) for Geometry Nodes. |
| 18 | +Inside the Geometry Nodes of this new object you can refer to the common input geometry object and ignore the placeholder geometry. |
| 19 | + |
| 20 | +## Basic Workflow |
| 21 | +Assuming you have already imported your particle data (e.g., using the [Sequence Loader add-on](https://extensions.blender.org/add-ons/sequence-loader/)), you can set up the surface reconstruction as follows: |
| 22 | + |
| 23 | +1. Select your particle data in the Outliner. |
| 24 | +  |
| 25 | +1. Click the "+" button in the "Select Input" panel to use the currently selected object's vertices for reconstruction. |
| 26 | +  |
| 27 | +2. Edit the reconstruction parameters in the "Viewport Settings" and "Render Settings" panels. |
| 28 | + Viewport settings are used when reconstructions are updated in the 3D Viewport, while render settings are applied to update reconstructions during rendering. |
| 29 | + Typically, you would use a low-resolution reconstruction in the viewport for better performance and high-resolution settings for renders. |
| 30 | +1. Activate automatic reconstruction in the 'Select Input' panel to start the process. |
| 31 | +  |
| 32 | + |
| 33 | +The add-on will now reconstruct a surface from the input vertices and automatically update it on frame changes (e.g., when the input data changes via the [Sequence Loader add-on](https://extensions.blender.org/add-ons/sequence-loader/)). |
| 34 | + |
| 35 | +## Caching |
| 36 | +You can cache reconstructions for specific frames using the 'Cached Frames' panel. |
| 37 | +For frames added to the cache list, the surface reconstruction is performed once and then loaded from the cache when you switch to that frame. |
| 38 | +This allows you to quickly switch between specific frames to check camera and light settings, for example, without waiting for a new reconstruction. |
| 39 | +Changing reconstruction settings does not affect cached frames unless you manually regenerate them. |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +The "Cache Settings" property determines whether the viewport or render settings are used for the cache. |
| 44 | + |
| 45 | +Add frames to the cache by clicking the "+" button. |
| 46 | +This opens a window where you can input a string of frames to be cached: |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +This string adds frames 4, 10, 11, 12, 13, 14, 15, and 23 to the cache list. |
| 51 | +To remove frames, select them and click the "-" button, or use the "Clear Cache" operator to remove all frames. |
| 52 | + |
| 53 | +Reconstructions for newly added frames are generated the next time the frame is changed. |
| 54 | +All cached reconstructions can be updated manually using the "Regenerate Cache" button. |
| 55 | + |
| 56 | +## Other Operators |
| 57 | +- **Parse CLI String**: Extracts parameters from a `splashsurf` CLI command (e.g., `splashsurf reconstruct input_{}.vtk -r=0.025 ...`). |
| 58 | +- **Get CLI String**: Performs the reverse operation, creating a CLI option string from the selected parameters and printing it to the Blender console. |
| 59 | +- **Test Render Params**: Runs the surface reconstruction using the render settings without modifying the mesh. It outputs the reconstruction time, vertex and triangle counts, and approximate memory usage. |
| 60 | + |
| 61 | +## Notes |
| 62 | + - When using the [Sequence Loader add-on](https://extensions.blender.org/add-ons/sequence-loader/), Splashsurf Studio requires the particle data object's global visibility to be enabled. However, it can be hidden in the viewport (by clicking the eye icon in the Outliner) without issues. |
| 63 | + - By default, a `COPY_TRANSFORMS` constraint is added to the surface reconstruction, matching its transform to the particle data. This prevents the surface from being moved independently. If this is not desired, simply remove the constraint. |
| 64 | + - If an error occurs during surface reconstruction, it will be displayed in a dedicated error panel: |
| 65 | +  |
| 66 | + - The add-on automatically enables `Render > Lock Interface` to prevent crashes during rendering. |
| 67 | + |
| 68 | +## Acknowledgements |
| 69 | + |
| 70 | +This add-on contains notable contributions from the following people: |
| 71 | + - [Felix Kern](https://github.com/Fek04) ([@Fek04](https://github.com/Fek04)) contributed the initial implementation of the Blender add-on and the `pySplashsurf` bindings |
| 72 | + - [Fabian Löschner](https://www.floeschner.de/) ([@w1th0utnam3](https://github.com/w1th0utnam3)) is the main author of `splashsurf` itself and current maintainer of the extension and Python bindings |
| 73 | + |
0 commit comments