We have packaged several demo applications with the source code to show some potential uses. These are all available in the src/demos directory and include:

Artistic control is very important for film making. Expressions though essentially a mathematical concept can readily be used to create artist directed procedural content.

One key we found was creating an interface around the expression language that automatically exposed parameters on defined variables.

We have included in src/demos a simple Qt image editor (.mov) to illustrate this functionality.


In the example, you can see a color ramp, slider, and spline ramp that are all automatically generated from just typing the expression below the widgets.

Also, libraries of expressions can be created by expert users and shared with other users. Take a look at our expression library (.mov) in action.


Another demonstration of the expression editor can be seen in this video (YouTube) at time 3:18.

Usage Examples

Noise Driving Color Interpolation

SeExpr can be used in many evaluation contexts, and in each context it may have different bound variables, different customizable functions. As an example, a programmer could allow a user to generate an image by evaluating an expression at each point of the image and binding a u and v variable for the u,v parameter of the image. Then the user could write examples like the following:

Noise Example 1

    0.000, [1.000, 1.000, 0.498], 4,  
    0.590, [0.333, 0.000, 0.000], 4,  
    0.665, [1.000, 1.000, 0.000], 4);


Noise Example 2

    0.000, [0.141, 0.059, 0.051], 4, 
    0.185, [0.302, 0.176, 0.122], 4, 
    0.301, [0.651, 0.447, 0.165], 4,  
    0.462, [0.976, 0.976, 0.976], 4);

Ray Tracing Sphere

This is an example of something you probably should not do with expressions. At the same time it is sometimes nice to prototype functions and techniques in expressions because of the interactivity.

$Cs=[1.000, 0.000, 1.000]; # Sphere Color
$L1=norm([-1.3,-.3,0]); # Light Direction 1
$L2=norm([.8,-1,-1]); # Light Direction 2
$sp=[0.000, 0.000, -3.000]; # Sphere center
$d=norm([$u-.5,$v-.5,-1]); # ray direction
$o=[0.000, 0.000, 0.000]; # ray origin
$r=1.000; # sphere radius
# quadratic coefficients
# discriminant
if($disc>0){ # two hit case
  # minimum ray parameter
  if($t>=0){ # if we are in front of camera
      $Pintersect=$o+$d*$t;  # point of intersection
      $N=norm($Pintersect-$sp); # intersection normal
      # lighting
# return color