Professional Documents
Culture Documents
Installer
The new plug-in has an installer wizard so that users are no longer required to manually copy files into
the 3D Studio Max directory. The installer auto-detects which 3D Studio Max versions are installed and
where. All versions of 3D Studio Max from version 7.0 are supported for 32bits and from version 9 to
2011 for 64 bits.
Figure 1: The wizard auto-detects 3D Studio Max versions and installation locations.
Toolbar and Menus
The functionality of the plug-in is conveniently shown in a floating/dockable toolbar and a menu.
• Export to SD: Exports the scene using the settings stored inside the scene. If this is the first time
the scene is being exported, or the settings have been lost for any reason, the button will bring
up the settings dialog.
• Import from SD: This can be used to import an SD file into 3D Studio Max. No settings are
needed.
• Export PFlow Emitters: Can be used to export one or more PFlow emitters as a sequence of BIN
files. It uses the last settings stored in the scene if available or brings up an options dialog, just
like the SD exporter.
• Export PFlow Settings: Displays the options dialog for the BIN particle exporter.
• Load RealFlow Mesh: Creates a mesh object inside 3dsMax and loads its geometry from a
sequence of BIN mesh files.
The Import/Export of the SD and Mesh files can also be done using 3dsMax File->Import…/File-
>Export… options.
Users can configure their own toolbar by using the “Customize User Interface” dialog.
A soft body object is linked to the original SD file through two properties: SD file name and SD object
name (see figure 5). Changing the name of the object or the path to the SD file is not recommended but
can be used e.g. when the SD file has been moved to a different directory. Nodes with a broken link (bad
file path or object name) will show up as a simple cube in the viewport.
A soft body object can be used as a normal 3D Studio Max object, which means it can be instanced,
copied or referenced and used in combination with different object or world space modifiers.
rfImportSD file:path_to_file
When using the command to export scenes, the export settings can either be taken from the scene, or
explicitly specified. To use the settings stored inside the scene, execute the following command:
rfExportSD output:path_to_file
To specify the options explicitly, you can add one or more of the following arguments:
• camera:name to select which camera to use. The default is to use the active camera (if any).
• entireScene:YES/NO exports the entire scene or just the selected objects. The default is
to export everything.
• firstFrame:number specifies the first frame to export. The default is first frame from the
active time segment.
• lastFrame:number specifies the last frame to export. The default is the last frame from the
active time segment.
These attributes are dynamically added to the object only when they are set to a non-default value.
Progress reporting
Both the import and export processes report progress in the main 3D Studio Max progress bar, in the
status line. The user can cancel at any time by pressing the ESC key. Please note that aborting an import
before any frames have been read will leave all the imported objects at the origin.
Miscellaneous improvements
• Large file support: the plug-in uses 64-bit offsets for file operations, so there are no restrictions
on the size of the SD files.
• UVW mapping: the plug-in will correctly import and export texture coordinates now.
RealFlow Particles in 3D Studio Max
This section covers the part of the plug-in which handles sequences of particle BIN files.
A Standard flow implies having only 5 operators defined within the PFlow System: RealFlowFileBirth,
RealFlowFileUpdate, RealFlowDeathTest, Shape and Display. Figure 8 shows the Standard Flow when
using RealFlow as an emitter. This flow can be created manually by the user by placing a PF_Source node
in the scene and replacing the default Birth operator with an instance of RealFlowFileBirth. To update
the particle positions, place the RealFlowFileUpdate operator in the event container. The
RealFlowDeathTest operator is needed to get rid of particles marked dead by the RealFlow File Update
operator.
• RealFlow .BIN file sequence: will open a dialog box allowing the user to select a file from a
sequence of files containing simulated particle behavior. After the file has been selected, the
prefix for the emitter is calculated based on the format and padding size specified by the user in
the “File name options” group.
• Format: has 4 predefined file formats that match RealFlow’s File name Options.
• Padding Size: the number of digits used to represent the frame. The frame number will replace
“#” from the selected file name format when the final file name is calculated.
• Emit Start: specifies the initial frame in which the RealFlowFileBirth emitter should start
emitting particles.
• Emit Stop: specifies the frame in which the RealFlowFileBirth operator should stop emitting
particles. Please note that if the particles have speed in the .BIN sequence files, particles will
continue to move after the emitter stops emitting new particles.
• Offset: specifies the first frame of the .BIN file sequence which will be used by the emitter.
• Inherit emitter TM: all particle positions will inherit the emitter’s position and orientation in the
scene. In this way, you can keep particles “under” their own emitter.
Note: A trick to move the particles when we moving the PFlow icon is to apply a “position icon”
operator and turn off . Now we can move the particle when we are moving the PFlow icon.
It’s an optional operator, meaning that if you are routing particles to another container (event) and you
don’t need to keep the particle information (position, speed etc) synchronized with RealFlow files, you
don’t have to use a RealFlow File Update operator in that container. Simply Display or Delete them as in
figure 11 below.
Figure 11: Workflow when routed particles are deleted. Figure 12: Workflow when routed particles are updated.
When routing RealFlow particle information to another PFlow container (event), if you want to keep
particle information synchronized with the RealFlow files, you need to place another RealFlow File
Update operator in that container. (See figure 12)
The RealFlow File Update operator also acts like a garbage collector for every PFlow event container it is
placed in. Its role is to check for dead particles by comparing its current particle IDs with the particle IDs
stored in the current RealFlow .BIN frame file. If it finds any dead particles, it will mark and send them to
a RealFlow Death Test operator in order to be routed to another container event. From there they can
be deleted from PFlow if necessary.
RealFlow Channels: MAXScript PFlow operators can access particle attributes which are computed by
RealFlow like viscosity, density etc.
These attributes are shown in the custom data channels available in PFlow particle containers. The
custom data channels can store less data than RealFlow produces, so users must select which particle
attributes they want to use. Each attribute will use up a certain number of value slots of the available
space, as follows:
The selected channels will be distributed over the 16 available value slots in this order:
The Neighbor count attribute, if selected, is made available through the particleInteger channel.
Please consult the MAXScript documentation for further details on how Particle Flow is integrated with
MAXScript.
The following particle attributes are available through standard PFlow data channels:
Please note that the position you get from the particlePosition channel does not exactly match the
position in the BIN file. You will need to perform some adjustments on this value in order for the
rendered position to match the position from the BIN file, which is what matters. Also, the velocity
channel in PFlow is expressed in meters per time tick, not meters per second as in the BIN file. In order
to compute the original values you can apply the following formulas (MAXScript code):
• Format
• Path
• Prefix
• Padding
• InheritEmitterTM
• EmitStart
• EmitStop
• Offset
• Name#.ext: 0
• Name.ext.#: 1
• Name#.ext: 2
• Name_#.ext: 3
RealFlow File Update operator and MAXScript
The following attributes are exported to MAXScript:
• Channels
• Force: 1
• Vorticity: 2
• Normals: 4
• UVW: 8
• Isolation Time: 16
• Viscosity: 32
• Density: 64
• Pressure: 128
• Mass: 256
• Temperature: 512
Ids for “Channels” parameter can be combined with bitwise OR from MAXScript.
Figure 14: RealFlowFileBirth and RealFlowFileUpdate operator have animatable parameters.
Exporting ParticleFlow systems to .BIN particle files
Particle Flow systems can be exported to .BIN particle files by simply pressing the toolbar button. If
it’s the first attempt to export PFlow emitters from the current scene, the following dialog will open
asking for the appropriate settings.
After the scene is exported, the specified settings will be saved in the current scene file. That means that
if you export again using the toolbar button, the plug-in will automatically perform the export
using the settings already saved in the scene.
If you need to export using other settings, you can open the settings dialog by pressing the toolbar
button or by using the RealFlow->Export PFlow particle Settings menu. After you make the changes, you
can export with the new settings by pressing the Export button.
Performance
The main drawback of the 3D Studio Max PFlow system is that it can’t be used in a non history-
dependent manner. That means every frame depends on the last one. When you move back in time
using the slider, PFlow will automatically evaluate the operators for ALL the frames between frame 1
and the current frame. This is not needed for RealFlow, but it cannot be disabled and therefore
searching backwards using the time slider is slow.
To work around this problem use the settings in the “Quantity Multiplier” section of the interface. These
values control the percentage of the particles which are read from the BIN files. A lower setting will
result in poorer visual quality but better performance because the system has to load and display fewer
particles. There are separate settings for viewport display and rendering.
Old particle importer
The “NL Particles 2” emitter, named now “Particle Loader”, is still available in the UI. We have kept this
alternative method available because its performance is better than the PFlow approach (due to the
reasons explained above).
The ParticleLoader object can be found in the “Geometry” sub-tab of the “Create” tab under “RealFlow”
combo selection.
• Select File Sequence: Will open a File Open dialog for the user to select a .BIN file sequence
• Path: Will show the path to the current loaded .BIN sequence
• Offset: Indicates the frame from which the animation will start
RealFlow Meshes in 3D Studio Max
This section covers the part of the plug-in which handles sequences of RealFlow BIN mesh files.
created using the toolbar button, File->Import menu, RealFlow->”Create Bin Mesh object” menu or
from the 3dsMax “Create” tab.
When creating the MeshLoader from the RealFlow toolbar/menu, a File Open dialog will open asking for
the .BIN mesh file sequence. After the file sequence is selected, a MeshLoader object will be created and
placed at the center of the scene (0, 0, 0).
The default viewport representation for the MeshLoader object is a cube. Whenever there is an error
loading the .BIN file sequence, or there is no sequence loaded, this default representation will be used.
• BIN Mesh sequence: will open a dialog box allowing the user to select a file from a sequence
of .BIN mesh files. After the file has been selected, the prefix for the emitter is calculated based
on the format and padding size specified by the user in the “File name options” group.
• Format: has 4 predefined file formats that match RealFlow’s File name Options.
• Padding Size: the number of digits used to represent the frame. The frame number will replace
“#” from the selected file name format when the final file name is calculated.
• Start: specifies the initial frame in which the MeshLoader object should start loading the mesh
sequence.
• Offset: specifies the first frame of the .BIN file sequence which will be used by the MeshLoader
object.
• Strength: This value is used when Motion Blur is turned ON and acts as a multiplier for the mesh
velocity channel found in the file.
• File Frame Information: Will display per frame information for the mesh, like the number of
fluids found, if they have UVW data and if the velocity channel (speed) is present. Note: The
velocity channel is used for Motion Blur.
The properties of a MeshLoader object can be seen by applying the showProperties MAXScript
command on a MeshLoader object. (E.g. showProperties $MeshLoader01)
The following command can be used to create a MeshLoader object from MAXScript.
The only required parameter is <file>. All the other parameters will use the default values if they are not
specified in the import command.
RealFlow MeltMaterial in 3D Studio Max
This section covers the part of the plug-in which handles the MeltMaterial in 3D Studio Max.
The RealFlow MeltMaterial can be used to combine several materials based on the fluid weights
contained in a RealFlow mesh file. This version of MeltMaterial has support for the default 3dsMax
Scanline Renderer and mental ray® renderer.
The RealFlow MeltMaterial can be created in the same way that all the other 3dsMax materials are
created. Please note that due to a 3dsMax limitation, when rendering with mental ray® renderer, the
MeltMaterial cannot be used on more than one MeshLoader object. If you break this rule, you may
get unexpected results and even crashes.
• Melt Index: This gives the user some control over the appearance of the parts of the mesh
where several fluids meet. A value of 0 will blend the material colors using the fluid weights
exactly as they are stored in the BIN file. Increasing the value towards 1 will exaggerate the
weights, brightening the blend. Negative values will scale down the weights so the result will be
darker. (Figures 23-25)
Figure 23: Rendered with mental ray® using Melt Index parameter set to -1.0.
Figure 24: Rendered with mental ray® using Melt Index parameter set to 0.0.
Figure 25: Rendered with mental ray® using Melt Index parameter set to 1.0.
RealFlow 3D Studio Max plug-in Auto-Update
The plug-in has a built-in update mechanism which can be used to manually or automatically check for
plug-in updates. By default, the plug-in automatically checks for updates on every 3dsMax startup and if
it finds an update, the user will be notified with a dialog box.
1. Open 3dsMax and load “..\scenes\pirateroom.max”. Note: Since this scene was created in
3dsMax 9, this tutorial only applies to 3dsMax versions 9 and above.
press the toolbar button, and if this is the first time we are trying to export this scene, a
dialog will open letting us choose the right settings for the SD file we want to export.
Set deformation to “No”, since we don’t want to export soft bodies or skinned meshes, and
leave all the other settings at their default values. Set the export file path and hit “Export”.
These settings will be saved in the scene, so another export will automatically use the settings
we’ve already specified. If we want to change the settings for a future export, we can open the
Note: If the scene is too big, you can use a different scale for it, like 0.01.
4. Add a gravity daemon to the scene.
5. Select the barrels from the right (barril, barril01, barril02, barril03), and in order to be able to
move them, click on the SD<>Curve button under the “Node params” rollup. Move them to the
left and place them between the pirate and the octopus, so when the octopus tries to grab the
pirate, it will hit them.
Figure 31: Barrels placed between the pirate and the octopus.
6. Keeping the current barrels selected, select the “barril04” object too. On the “Node Params” set
“Dynamics” to “Rigid Body” and on the “Rigid Body” rollup and set “Dyn motion” to “Yes”.
7. Next, we set the pirate and the octopus to act as colliders, but unaffected by gravity. Select all
Bip* objects for the pirate and “Sphere04“,“Sphere06“,“Sphere08“,“Sphere09“,“Sphere10“ for
the octopus. On the “Node params” rollup, set “Dynamics” to “Rigid Body” and set “Dyn
motion” to “No”.
8. The room objects need to be set up as static colliders. Select “Plane02”, “Line07”, “Line07”,
“Object01” and “Object02”, set “Dynamics” to “Rigid Body” and “Dyn motion” to “No”.
9. Simulate from frame 0 and export all objects from the scene. You can verify that by checking the
export setting from the Export->Export Central ... (F12) menu.
10. Now it’s time to import the simulated scene in 3dsMax. There are two import options available:
We can import the “animation.sd” file in a new 3dsMax scene or we can import it over our
existing “pirateroom.max” scene. The second option is more advantageous, since it will only
modify the animation for the objects, keeping the current object modifiers applied. By using the
first option, the plug-in will create all objects at import time as Editable Mesh objects.
The import is simply done by pressing the toolbar button. A “File Open” dialog will open,
letting us choose the path to the “animation.sd” file.
Figure 33: Animated pirateroom.sd file imported back in 3dsMax.
1. Open RealFlow and create a plane and a sphere. Add a gravity daemon.
2. In the “Node params” for the Sphere, set “Dynamics” to Soft Body.
3. Make sure you have all the objects selected in Export->Export Central… (F12) and start
simulating 100 frames.
4. Open 3dsMax and import the animation file by pressing the toolbar button and browsing
for the “animation.sd” file.
1. Start RealFlow and create a Realwave object and a new cube object. Move the cube above the
Realwave object. Add a gravity daemon.
2. Select the cube object and on the “Node rollup” set “Dynamics” to Rigid Body.
5. The Realwave object is black because its normals are pointing the wrong way. Select the object
and go to the Modify tab. Enable the “Invert Normals” checkbox.
Figure 38: Realwave object properties.
1. Open RealFlow and create 4 emitters, a plane, a Kill_volume daemon and a Gravity daemon.
4. Open the Particle Viewer and remove the following default operators from all 4 containers:
Birth, Position Icon, Speed and Rotation.
6. Select the BIN file sequence for each birth operator and set the emission range to start at
frame 0 and end at 100.
8. We don’t need the dead particles, so we route all of them to a single container and
delete them.
Figure 46: All dead particles are routed to a single container and deleted.
9. Close the Particle Viewer. In the viewport you will see that all particles are created
relative to their PFlow Source emitter. To get the same positions as in RealFlow, uncheck
“Inherit emitter TM” on every RealFlowBirth operator. The final image should look like this:
Figure 47: All dead particles are routed to a single container and deleted.
10. You can add various PFlow operators if you wish to alter the particles in any way
(motion, color etc.). For example you can route some particles based on their age and
increase their speed. Don’t forget to add RealFlow update and death operators to all the
containers (except those with only a delete operator in them).
2. Right click on the Mesh object and choose “Insert all fluids”.
5. Next we apply a MeltMaterial on the MeshLoader object. Open the Material Editor (M) and
press the “Standard” button. Choose “RealFlow MeltMaterial” from the list.
7. As we have 4 fluids on the MeshLoader object, we need to create 4 sub materials on our
MeltMaterial.
8. Assign the MeltMaterial to our MeshLoader object by simply dragging the material onto it.
9. Change the renderer to mental ray® renderer and press the Render button.
Figure 54: MeltMaterial applied on a MeshLoader object and renderer with mental ray® renderer.