Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Current »

The "RealFlowFileUpdate" operator updates position, speed and other information about custom channels for all particles generated by the "RealFlowFileBirth" operator. It is an optional operator, meaning that if you are routing particles to another container (event) and you do not need to keep the particle information (position, speed etc) synchronized with RealFlow files, you do not have to use a RealFlow File Update operator in that container. Simply Display or Delete them as shown below.

 


Workflow when routed particles are deleted.


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 "RealFlowFileUpdate" operator in that container:

 

Workflow when routed particles are updated.


The "RealFlowFileUpdate" 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 "RealFlowDeathTest" 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.

 

RealFlow File Update operator settings.


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: three slots each
  • Isolation Time, Viscosity, Density, Pressure, Mass, Temperature: one slot each

The selected channels will be distributed over the sixteen available value slots in this order:

  • The first twelve values go to the "particleMatrix" channel.
  • The next three values go to the "particleVector" channel.
  • The last value goes to the "particleFloat" 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


The names "ticksPerFrame" and "frameRate" are built-in MAXScript "variables.plugin"

 

"RealFlowFileUpdate" Operator and MAXScript

The following attributes are exported to MAXScript:

  • Channels

The parameter is animatable (see image below).

 

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

The Ids for the “Channels” parameter can be combined with bitwise "OR" from MAXScript.

 

RealFlowFileBirth and RealFlowFileUpdate operator have animatable parameters.
  • No labels