Loading Particles Using The PRT Loader¶
Available in Krakatoa v1.0.0 and higher
Overview¶
- As explained in the topics Particle Saving Workflow and Particle Partitioning Workflow, Krakatoa can produce particle file sequences from any particle sources found in the scene.
- Other applications like RealFlow can also produce particle file sequences in different formats.
- A PRT Loader object has been implemented to load and render particles that have been saved to disk by Krakatoa or 3rd party applications.
- The PRT Loader also provides some advanced features beyond the mere loading of particles from disk, including
- the ability to combine particle sequences together
- the ability to change the timing of the particle animation
- the ability to deform particles using standard 3ds Max or custom deformation modifiers, World Space Modifiers and Space Warps
- the ability to host Krakatoa Channels Modifiers on the modifier stack to read/write and modify particle data
- the ability to transform particles in world space including Position, Rotation and Scale animations
- the ability to cull particles using arbitrary geometry volumes
- the ability to acquire normal vectors from the surface of the culling volumes
- This topic discusses the typical workflows for loading particles from file sequences.
- The advanced features like deformations, retiming, culling etc. are discussed in separate topics - follow the links above.
Loading a Particle File Sequence¶
- After creating a PRT Loader, you can use the “Add Files…” button to pick an existing particle file sequence from disk.
- It does not matter which frame of a file sequence will be selected when adding to the PRT Loader since the frame number will be replaced internally as you scrub the time line or render multiple frames.
- It does matter though in two cases:
- When the “Load Single Frame Only” checkbox is checked, the EXACT file name listed in the PRT Loader will be loaded without any frame number modifications, thus if you intend to load a single frame from a sequence, you should pick the one you want to load.
- When adding a second sequence to the list (see further on this page), if you pick the SAME frame, the sequence will not be loaded, but if you picked a different frame number from the same sequence, it will be loaded - this is to allow you to load multiple frames from the same sequence and combine them into a single cloud while “Load Single Frame Only” is checked.
- The PRT Loader can be customized via the Krakatoa Preferences > User Interface and Interaction Preferences rollout to open the File Dialog automatically when created using the SHIFT-click on the PRT icon or Menu item.
- This can be very useful because a new PRT Loader without a particle file sequence cannot be used for anything.
- The preference can be set to open the dialog at a default path or at the path currently specified in the Save Particles rollout.
- If there is no valid save path specified, the default path will be used instead.
- If there is no default path specified in the Preferences rollout, the dialog will open at the current directory.
- Double-clicking a sequence entry on the list will open a Windows Explorer at the location of the sequence.
Loading Multiple Particle File Sequences¶
- You can use the “Add Files…” button multiple times to add multiple particle file sequences to the same PRT Loader object.
- If a single previously loaded file sequence is highlighted on the list, the open file dialog will open at the same location.
- If there are multiple sequences highlighted on the list, they will be ignored and the default directory rules described in the previous section will be followed.
- Each sequence shown in the PRT Loader’s list has two prefix flags - v and r - which stand for the Viewport and Render checkboxes located underneath the list.
- Normally, every sequence will be loaded to be shown in the viewport and during rendering.
- By selecting one or more sequences and checking/unchecking the Viewport and/or Render checkboxes, you can control which sequences will appear in the viewport and which ones will appear in the final rendering.
- For example, you could load two sequences - one low-count proxy and one high-count final version and check the proxy to show only in the viewport and the larger one only in the renderer, thus allowing for faster scrubbing but full-quality rendering.
- Or you could load multiple files for rendering, but disable all but one in the viewport to speed up the interaction while still rendering all.
- Or you could load multiple versions of the particle sequences and turn only one of them on in the viewport and renderer while disabling all others.
- Note that there is a global checkbox that disables the loading in the viewport and another one that disables the rendering completely for the cases where the PRT Loader has to remain unhidden but should not display or render any particles.
Loading Partitions¶
- Loading multiple particle file sequences that are part of the same partitions set is somewhat automated.
- You have to select only one representative frame from any of the partitions.
- The PRT Loader will check the file name and if it matches the pattern _partMMofNN, it will assume that there are NN partitions on disk (even if this is not true because not all of them have been generated yet) and will prompt about loading multiple sequences or just the one that was selected.
- If answered with No, only the selected sequence will be added to the list.
- If answered with Yes, the Select Partitions Dialog will open and let you select one or more sequences to add.
- The PRT Loader will skip sequences that have already been added.
- Sequences that have not been saved yet but might be saved in the future can also be loaded using the Select Partitions Dialog - this way, a scene can be prepared for rendering while the actual PRT files are being generated locally or on the network.
- The Main Controls rollout provides an option to ignore missing frames when rendering which can be useful to ignore error caused by such empty sequences.
Controlling the Particle Count¶
- The PRT Loader provides separate controls for the loading of particles for final rendering and for viewport display.
- The Viewport controls can be partially linked to the Rendering controls so changing the Rendering settings would affect the Viewport settings.
Rendering Controls¶
- The Rendering controls include the Loading Mode, the Percentage of particles to load and the Loading Limit.
- The Loading Mode defines the order in which particles are being loaded”
- Load Every Nth Particle will skip particles according to the Percentage value or load all if the Percent is set to 100.0 - skipping particles still requires all particles to be unzipped and loaded to render the ones that are needed, so it is relatively slow.
- Load Firth N Particles is the factory default mode and reads from the beginning of the file until it reaches either the given percentage of the particle count in the file, or the Limit (if enabled).
- Load Every Nth by ID also skips particles, but uses the ID channel (if present) to always skip the same particles even if the particle count is changing between frames, thus producing a more stable particle cloud over time.
- If the Every Nth by ID mode is selected but no ID channel is found, the particle index (order) will be used, resulting in the same loading as in Load Every Nth Particle mode.
- If a particle file on the list is in the .CSV file format which does not report the total particle count, the PRT Loader will implicitly load using Every Nth Particle mode even if set to a different mode.
- The Percent value defaults to 100.0 and controls what percentage of the particles in all file sequences found in the PRT Loader will be loaded for rendering.
- The value is animatable, so you can increase or decrease the number of particles over time.
- If the checkbox in front of the “Limit (x1000)” button is checked, up to the specified number of particles times 1000 will be loaded.
- If the particle files contain less particles, the limit will have no effect.
- The default value of 1000.0 allows one million particles to be rendered.
Viewport Controls¶
- The Viewport controls also provide a loading mode, percentage and limit values, but they work slightly differently.
- The Loading Mode defaults to “Load Using Render Mode”, which links the Viewport loading to the Render loading - if Rendering uses Every Nth, the Viewport will follow.
- The Viewport Loading Mode can also be set to the other three modes available in the Rendering controls and behaves the same.
- The “% of Render” value defaults to 1.0 and is always in relation to the Rendering Percent.
- In the default case where Rendering is set to 100%, the Viewport will show 1% of all particles.
- If the Rendering is set to 10% and Viewport is set to 1%, only 0.1% of all particles will be loaded and so on.
- This value is not animatable, but will respect the animation of the Rendering Percent value and follow it relatively.
- The “Limit(x1000)” option functions the same way as the Rendering counterpart, but defaults to 100,000 particles.
