AFC and Gradient Control



Animation Flow Curves (AFCs) are used by FumeFX to animate many parameters over time from one value to another. By default, they are all disabled and need to be manually enabled to create an effect.


Sometimes you don`t need to animate a parameter over the particle age, thus you won`t need to use an AFC associated with it. However, many times it is advantageous to be able to animate the parameter, such as the Phase of the noise so that the volumetric effects move realistically. In such cases, you must right-click over the AFC icon to open the menu and switch it from the [Disable] state to [Enable]. The right-click menu also provides quick access to AFC options such as Copy, Paste, Load, Save and Reset.




When enabled, the AFC icon will become colored as shown in the image below.




When you left-click over an enabled AFC icon, the following Graph Editor will appear:




In the Graph Editor, the bottom left corner indicates the Low value for the chosen parameter, and the top right corner indicates the High value. The curve you define will be used to interpolate between these two values.


You can change the key type by right-clicking on the points as shown below. Be aware that when you click on a point, it turns white to indicate it is active.




When you do you get another pop-up where you can choose the type of curve you want applied to that point.


Smooth - Creates a smooth curve, which has automatic tangent adjustment.

Corner - Parts of the segment that are closer to the point will have linear characteristics.

Bezier - Enables you to adjust the handles, which represent the curve slope at the point location.


There`s also a toolbar in the bottom right corner; its buttons are described below.


Copy - Allows you to copy all keys.

Paste - Lets you paste keys from any other AFC.

Delete - Removes all selected points.

Reset - Resets the layout.


Keyboard Shortcuts when over a curve point:


Shift + left mouse button drag - restricts the movement to X-axis

Ctrl + left mouse button drag - restricts the movement to Y-axis

Right mouse button - Pops up a menu (smooth, corner, delete key)




Gradients are used to change the specific colors over the particle age. Gradients are accessible by clicking the small icon located on the FumeFX User Interface.




Some of the frequently used gradient options are accessible through the menu which is available by right-clicking the Gradient`s icon as shown below.




Keyless mode - In this mode the Gradient will behave as a single color picker where the color is constant throughout the particle life.

Copy - Copy the selected gradient.

Paste - Paste a selected gradient.

Load - Load a previously saved gradient .AGT file.

Save - Saves the selected gradient to an .AGT file.

Reset - Clears all the keys and sets the Gradient`s state to the default.


When you left-click on the small gradient icon within the dialog, a larger dialog box will appear.




The left edge of the gradient is equivalent to the particle`s birth, while the right edge of the gradient is equivalent to the particle`s death. The status line is located above the gradient and shows the ID number of the currently edited key, with its color and position expressed as the particle age.


There are two types of the Gradient: Linear and TCB.


Linear - This gradient type uses the linear interpolation between the color keys.

TCB - Tension, Continuity, Bias, Ease To (eT) and Ease From (eF) parameters provide a lot more flexibility than the Linear gradient type. By using these parameters, you can change the influence of each color key on the color interpolation along the segment.




Gradient Usage


Left-click on gradient - After you release the button, a color key will be added at the selected place.

Double left-click on key - Opens the color picker.

Left-click + drag mouse on gradient - Doing this allows you to select multiple keys simultaneously.

Left-click on key + drag mouse - Moves the color key to the desired place.

Right-click on key - Opens the key menu as shown below. The options within this menu allow you to copy flag colors from one color key to another quickly as well as delete a key.




Right-click on gradient - Opens the gradient menu where you can also reset the entire gradient as well as copy, paste, load and save them.





MAXScript Functions for AFC and Gradient Controls

These functions allows user to access AFC and Gradient properties. To list shader properties, in max script you have to type: showproperties ( $.GetShader())

Here is how you can access Gradient from FumeFX:
GRD= ($.GetShader()).Fire_Color_Gradient
AFC= ($.GetShader()).Fire_Opacity_AFC




int GetMode()

Returns 0- disabled, 1- enabled



mode = 0- disabled, 1- enabled



Removes all the keys



Updates AFC in time (ticks) that is passed as a parameter
AFC.Update time




Returns number of knots in AFC



int GetKnotType index

return type = 0 (KTYPE_AUTO), 1 (KTYPE_CORNER), 2 (KTYPE_BEZIER)
AFC.GetKnotType index


BOOL SetKnotType index type

index = 0... NumKnots()-1

AFC.SetKnotType index type


Point2* GetKnot index

index = 0... NumKnots()-1
AFC.GetKnot index

int AddKnot [x,y] type


return index of the knot that is added.
AFC.AddKnot [x,y] type

BOOL DeleteKnot index

index = 1... NumKnots()-2. First and last knots cannot be deleted

AFC.DeleteKnot index


Point2* GetInVec index

Returns Point2 handle vector
AFC.GetInVec index


BOOL SetInVec index [x,y]

Set handle vector

AFC.SetInVec index [x,y]


BOOL Load filename

AFC.Load "somefilename.afc"


BOOL Save filename

AFC.Save "somefilename.afc"





BOOL Paste()




Gradient MXS

int GetMode()

Returns 0- keyless, 1- linear, 2- TCB



mode = 0- keyless, 1- linear, 2- TCB



Removes all the keys



Updates Gradient in time (ticks) that is passed as a parameter



Returns number of color keys in Gradient



Color* GetKeyColor index

index = 0... NumKeys()-1
GRD.GetKeyColor index

float GetKeyPos index

index = 0... NumKeys()-1
GRD.GetKeyPos index

int AddKey x [r,g,b]

return index of the knot that is added.
GRD.AddKnot x [r,g,b] type

BOOL Deletekey index

index = 1... NumKeys()-2. First and last knots cannot be deleted

A GRD FC.DeleteKnot index


Point3* GetTCB index

Returns [T,C,B]. Works only for TCB graphs
GRD.GetTCB index


BOOL SetTCB index [t,c,b]

Set TCB. Works only for TCB graphs
GRD.SetTCB index [t,c,b]


BOOL Load filename

AFC.Load "somefilename.afc"


BOOL Save filename

AFC.Save "somefilename.afc"





BOOL Paste()