Professional Documents
Culture Documents
RealFlow Connectivity
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.
The functions of the buttons, from left to right: 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. Export SD Settings: Allows the user to adjust the SD export settings. 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.
SD file support
This section will discuss the usage of the SD component of the plug-in and the ways in which it has been improved for this version.
MAXScript support
The SD functionality is also included in MAXScript. The command to import SD files is: 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: deformation:YES/NO turns on per-frame geometry export on the exported objects. The default is Autodetect. 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.
Export deformation: this can be used as an object-level override for the deformation mode which is specified in the export options.
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.
The settings for the RealFlowFileBirth operator are: 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 RealFlows 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. Prefix: replaces the name part in the name format specification. 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 emitters 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.
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: Force, Vorticity, Normals, UVW: 3 slots each Isolation Time, Viscosity, Density, Pressure, Mass, Temperature: 1 slot each
The selected channels will be distributed over the 16 available value slots in this order: The first 12 values go to the particleMatrix channel. The next 3 values go to the particleVector channel.
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: Position data can be read through the particlePosition channel. Velocity is available as particleSpeed. The RealFlow particle ID is in particleID.
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):
realVelocity = particleSpeed * ticksPerFrame * frameRate renderPosition = particlePosition + particleSpeed * ticksPerFrame / 2.0
Also all above mentioned parameters are animatable. (Figure 14) MAXScript Ids for the Format parameter are: Name#.ext: 0 Name.ext.#: 1 Name#.ext: 2 Name_#.ext: 3
The parameter is animatable. (Figure 14) MAXScript Ids for the Channels parameter are: Force: 1 Vorticity: 2 Normals: 4 UVW: 8 Isolation Time: 16 Viscosity: 32 Density: 64 Pressure: 128 Mass: 256 Temperature: 512 Neighbors number: 1024
Ids for Channels parameter can be combined with bitwise OR from MAXScript.
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 cant be used in a non historydependent 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.
The settings for the ParticleLoader object are: Icon Size: Icon size in viewport Emitter Hidden: Show/Hide the particle emitter in the viewport Display Every: Will display every X particles in the viewport Render Every: Will render every X particles in the viewport 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 Prefix: Will show the name of the loaded .BIN file Lock last frame: Locks the last frame of loaded sequence Invert sequence: The .BIN sequence is read in an inverse order Offset: Indicates the frame from which the animation will start
The settings for the MeshLoader object are: 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 RealFlows 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. Prefix: replaces the name part in the name format specification. 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.
Setting the exposure of the render too high (longer than one frame) to lengthen the blur can still cause the plug-in to evaluate two different BIN files, resulting in visual artifacts. It is better to control the blur length using the motion blur strength setting than by increasing the exposure time.
The only required parameter is <file>. All the other parameters will use the default values if they are not specified in the import command.
The settings for the RealFlow MeltMaterial are: 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.
2. There are 500 animated frames in this file and we want to export them all to an SD file. We 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 dont 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 weve already specified. If we want to change the settings for a future export, we can open the SD File Export Settings by pressing the toolbar button.
3. Open RealFlow and create a new project named Pirateroom.flw and then load the exported pirateroom.sd.
Note: If the scene is too big, you can use a different scale for it, like 0.01.
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 its 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.
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 for the animation.sd file. 5. You should end up with 100 animation frames in 3dsMax.
2. Select the cube object and on the Node rollup set Dynamics to Rigid Body. 3. Simulate 100 frames.
4. Start 3dsMax and import the realwave01.sd by pressing the will be black when seen from above:
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.
4. Open the Particle Viewer and remove the following default operators from all 4 containers: Birth, Position Icon, Speed and Rotation. 5. Place a RealFlowBirth operator in all 4 containers.
6. Select the BIN file sequence for each birth operator and set the emission range to start at frame 0 and end at 100.
7. Add a RealFlowFileUpdate and a RealFlowDeathTest operator to all 4 containers. Please note that we need the RealFlowDeathTest operator, because we have simulated the scene using the Kill_Volume daemon in RealFlow.
8. We dont 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. Dont 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. 3. Simulate 100 frames.
4. To bring the simulated mesh into 3dsMax, create a MeshLoader object by pressing the toolbar button. A dialog will open letting you chose the simulated mesh file sequence.
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. 6. By looking at the MeshLoader object properties, we see that it contains 4 fluids.
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.