RS - Retiming Parameters

Here you have visual control over your settings and you are able to include some options to refine the retiming process.

 

The "Frame range" Section

This section contains everything you need for adjusting and scaling the final frame range of the retimed simulation.

 

 

Use scene range

This option is activated by default. If checked, RealFlow's "Retime Simulation" will include the entire frame range that is adjusted in the timeline and you will again get exactly the same number of output frames.

First/Last

When “Use scene range” is inactive, the tool uses the “First” and “Last” frames entered here. The retiming process will only be performed within this given range.

Scale velocities and forces

When a simulation is accelerated or decelerated, the velocities, forces and the vorticity of the affected objects or particles will change. An example: let's assume that you want to make a particle-based simulation two times slower (t / 2) than the original, so all velocities, forces and the vorticity must be scaled by two. If you want to accelerate (e.g. t * 2) the simulation then all attributes must be decreased accordingly. It is also possible to do this in the opposite direction - e.g. when a simulation has to run backwards then the properties will be flipped. The scale factors will be automatically determined by “Retime Simulation” and depend directly on the “Time factor” value, but it is important to know the concept to get an idea of what will happen during and after the retiming process.

Interpolate method

Interpolation is used to smooth a curve or a value to make it appear more natural. The first option is “No interpolation” and, of course, it does not add any interpolation at all. “Linear interpolation” takes values from two frames – A and B – and calculates a new value between these points in time. "Linear interpolation (cubic for particles)" uses a linear method for all nodes except particles and grid fluids. For these two types a cubic function will be used instead of a linear method.

The "Time function" Section

This area provides the parameters and functions to scale the retiming process. You can create slow-motion or time-lapse effects or even reverse the sequence.

 


Time factor

This is a simple multiplier which determines the final length of the retimed simulation. A factor of 1 means that the output sequence will have exactly the same length as the input sequence. At first glance, a factor of 1 does not seem to make any sense, but when you choose “Edit function” you will be able to create ease-in and ease-out effects without changing the simulation's duration. A factor of 2 means that the results will be twice as long as the original simulation, and so on. If you want to shorten the simulation's length then you can use multipliers smaller than 1, e.g. 0.5 (half speed) or 0.33 (third speed). By default, the basic unit is seconds.

Edit function

The time factor represents a constant function, but this is not always wanted. There are many cases where it is necessary to accelerate or decelerate specific parts of a simulation; for example to emphasize certain aspects of a movie or commercial. Today, these variable time-lapse and slow motion effects are often used for various applications. With “Edit function” you can open an editor very similar to RealFlow's “Curve Editor” and add your customized retiming function.

The graph window shows two coordinate axis, X and Y. “X” represents the current simulation time, given in seconds or frames. The Y axis, on the other hand, is the time of the original sequence and also given in seconds or frames – this depends on the settings under “Evaluate function as frames instead of seconds”. The current time will then be multiplied with the “Time factor” value to get the appropriate time scaling.

The time factors are based on an expression, a spline or a combination of both. Expressions are the most convenient way to retime a simulation. The expression “2 * t”, for example, represents exactly the “Time factor” setting of 2. Please keep in mind that you are not limited to linear functions. It is also possible to use complex expressions or known functions like sine, cosine or square root and combinations. Expressions even allow you to add conditions – the well-known “if” condition. Another very interesting feature is the usage of random functions. If you want to learn more about expressions, their benefits and how to create them, please have a look at the chapter “CE - Expressions”. The explanations and tips given there are also valid for RealFlow's "Retime Simulation".

The curve's shape also indicates some important characteristics: a steep curve carries bigger time factors, because time will pass faster than in the original simulation. A flat curve creates a slow motion effect. During a completely flat curve section time is frozen. An increasing curve shows that time is running forward; with decreasing curves, time is running backwards.

An example:
Let's assume you have entered a “Time factor” of 2.0 and the expression “t - 0.5”. The current simulation time is X = 1.0 s or frame 30 with NTSC (for HD it would be frame 24, for PAL frame 25). The corresponding Y value will be calculated as:

Y = (X * Time factor) – 0.5

Y = (1.0 * 2.0) – 0.5

Y = 1.5

This result can also be seen as the time “stretching factor” and all you have to do now is to multiply this factor (= Y) with the current frame:

Input frame = 1.5 * 30

Input frame = 45

Evaluate function as frames instead of seconds

As mentioned earlier, "Retime Simulation" works with seconds, but sometimes it is easier or necessary to use frames instead. This checkbox allows you to switch between both time systems. If you work with expressions then you have to be careful, because with seconds, the time variable is “t”, with frames you have to use “f”. The usage of the “f” function can be a problem though, because frames are integers and this leads to unwanted gaps or jumps. If you really want to work with frames, we recommend this expression:

t * FPS

The "Timing Example" Section

The most eye-catching element of this section is the timeline. The timeline consists of grey rectangles and if spacing is wide enough, you can also read the associated frame number. The purpose of this section is to give you an idea of the changes in time and speed the retiming process creates. When the window is opened you can see that the timeline marker (a blue dot) is running at constant speed: both “Output Frame” and “Input Frame” are exactly the same during the entire “preview”. The length of the green arrow indicates the current scale of velocities and forces in the scene – the higher, the longer the arrow will finally be. Simultaneously you can also see how the grey rectangles are stretched or compressed. Each rectangle represents one frame and with higher velocities, the bars become denser.

So, if you were starting the retiming process without any changes, the original and retimed simulations are identical. With a “Time factor” of 0.25, the length of the arrow is just one fourth of its original length, with 3.0 it will be three times longer. This means that the arrow gives you an idea of where the simulation is accelerated or decelerated. The arrowhead can also change its running direction.

The green arrow will only be scaled when “Scale velocities and forces” from the “Frame range” section is active. Without this option, the arrow's length remains constant and RealFlow will only perform the retime process on the number of frames.

 

 

During the retiming, different colours are used to indicate the current state of the entire process:

Orangeframes for some nodes are missing
Redframes for all nodes are missing (“Out of bounds”)
Blueoriginal frame number
Yellowoutput frame number
Greenindicates the current velocity when “Scale velocities and forces” is active

Additionally you can see two buttons: “Rewind” and “Play”. “Rewind” resets the tool's timeline to the first frame and “Play” is used to start the timeline preview.

The “Particles dying at interpolated frames” Section

Since there is no possibility to find out the exact age at which a particle will finally die, "Retime Simulation" uses a simple, but effective method: the tool evaluates the previous and subsequent frames of the current frame.

An example:
The currently evaluated frame is number 126. "Retime Simulation" will have a look at frame 125 to check if a certain particle exists. If it does not exist in frame 127 anymore then it has died and been removed from the scene at some time during frame 126.

Filtered particles can be problematic for the "Retime Simulation" tool. When a particle is just transferred to another emitter, the positions of the dying or born particles are ambiguous and the tool cannot place the interpolated particles correctly. If you can observe jumps in your retimed simulation, we recommend using an "NBinary Loader" to merge the sequences from the filter's source and target emitters before you apply "Retime Simulation".

 

 

The following three options only affect particles which are supposed to die. They are only available when “Interpolation method” is not “No interpolation”.

Kill at the beginning of the frame

In this case, the currently observed (dying) particle will not exist in any of the interpolated frames.

Kill at the middle of the frame

If this option is active, the observed particle will keep its velocity and move with the fluid until halfway through the interpolated frames, and will then be removed.

Kill at the end of the frame

The last method will keep the observed particle's velocity and motion throughout all interpolated frames.

Freeze dying particles

This option cannot be used with the “Kill at the beginning of the frame” option, because there, the particles will immediately be deleted and will not be part of the interpolated frames. If this option is checked, the dying particles will not be deleted but frozen, and they will keep their positions at the time of death for all interpolated frames.

When dying particles are not frozen, but killed at the middle or the end of the frame, then they do not just move at their latest speed. They are affected by the “latest” force and a particle will keep moving because the forces still accelerates it.