fig 1. By balancing Rotation and Attraction values, particles can flow down a curve while rotating.  fig 2. By mapping the speed, attraction and rotation speed with Ramp nodes, a vortex can easily be molded and shaped.

The curve field uses a NURBS curve to generate dynamic force. Both Rigid Bodies and Particles can be effected by the field. Unlike the Curve Flow clip effect, the Curve Field is a true field, and as such, it exerts its force just like any other field, by adding it to the inputForce[] attribute of the dynamics object.

 

Curve Field Creation

To create a Curve Field through the GUI, select at least one NURBS curve and then the menu item Fields -> Curve . This will create a Curve Field with the settings found in the Fields -> Curve -> Option Box window.

The following behaviors for field creation also apply :

For each NURBS curve in the selection, a Curve Field will be created.

If you have one or more particle objects selected when creating the fields, each particle object will connect to each new Curve Field automatically.

*The order in which you select NURBS curves and particles is NOT important.

 

Special Curve Field Attributes

To control the effect of the Curve Field on your particles, there are up to three controls for each attribute :

1. Basic Float Attribute - ex. "speed"

    Simply enter the desired value into this attribute.  

2. Mapped Attribute - ex. "speedMap"

    You can assign a Ramp node to this attribute to enable you to modify the value of the attribute along the length of the curve.  The values of the ramp are read from bottom to top, equating to start of curve, end of curve. It is recommended that you ensure your curve has a 0 - 1 U parameter range for best results.

    If this attribute is mapped, the resulting value will be multiplied by the Basic Float Attribute (speed), so it is unnecessary and often confusing to use the Color Gain attribute of the ramp as a global multiplier of the ramp value.  You can however use both positive and negative values for the entries in the ramp.

    *If this attribute does not have a ramp connected to it, it will be ignored.

3. PP Attribute - ex. "speedPP"

You can assign a custom float array attribute from your particle object to this attribute. This enables you to have per particle control of the value of the attribute.

Enter the name of the attribute from your particle object that you want to use to control the magnitude. If the attribute does not exist, the field will not evaluate. The field will read the values from the particle object each time it is evaluated and for each particle object connected to the field, so you could have several different particle objects connected to the field and for each one, if the attribute exists, it will be used.

If the attribute exists, it will be multiplied by the Basic Float Attribute and the Mapped Attribute (if it is mapped) to determine an overall value.

*When using a PP Attribute, it is important to remember that if you have a Runtime expression controlling the value of the attribute that the field is reading, if "Expressions After Dynamics" is turned ON for the particles, the values used will always be off by one frame since the field is evaluating before the expression.
 

Curve Field Attributes
 

Magnitude

Magnitude acts as a multiplier of the overall effect of the field.

MagnitudePP
 
MagnitudePP enables you to have per particle control of the Magnitude of the field. 
 
The resulting value is NOT multiplied by the Magnitude attribute.
Attenuation
Sets how much the strength of the field diminishes as the distance between the object and the closest point on the curve increases.
 
The rate of change is exponential with distance; the Attenuation is the exponent. If you set Attenuation to 0, the force remains constant over distance.
 
*Attenuation will only occur if Use Max Distance is enabled.
 
Use Max Distance
 
If you turn on Use Max Distance, connected objects within the area defined by the Max Distance setting are affected by the Curve Field.
 
If you turn off Use Max Distance, connected objects are affected by the curve field no matter how far away.
 
*Turning off Use Max Distance will result in Attenuation and Rotation Attenuation being ignored.
 
Max Distance
 
Sets the maximum distance from the curve field at which the field is exerted. You must turn on Use Max Distance for Max Distance to take effect.
 
Speed, Speed Map, Speed PP
 
Controls the speed at which the particles move along to the curve. You can use positive or negative values to control which direction the particles are moving.
 
Attraction, Attraction Map, Attraction PP
 
The amount of force attracting the particles towards the curve. A positive number will attract the particles towards the curve, a negative number would repel the particles from the curve.
 
Offset, Offset Map, Offset PP
 
Offset works in conjunction with Attraction to keep the particles away from the curve by the specified value. A value of 5 would keep the particles 5 units away from the curve.
 
*If Attraction is set to 0, the particles will not be attracted to the offset position.
 
Rotation, Rotation Map, Rotation PP
 
The number of degrees of rotation that the particles are moving with each frame. A value of 10 would mean that every 36 frames (36 x 10 = 360) the particles would rotate once around the closest point of the curve.
 
The greater the value, the quicker the rotation. If you use values that are greater than 30 degrees, you will notice that your particles will not be rotating smoothly, instead, their rotation will appear faceted. The faceted rotation is due to the fact that the particles are making very sharp turns each frame.
 
*If Rotation Speed is set to 0, the particles will not rotate. Rotation Speed and Rotation work together to determine the rate at which the particles will rotate.
 
Rotation Speed, Rotation Speed Map, Rotation Speed PP
 
While Rotation determines the direction of the force, Rotation Speed determines how much force is pushing the particles in that direction.
 
*Factors such as the magnitude, attenuation and rotation attenuation of the field as well as the mass and conserve value of the particles will factor into the speed at which the particles rotate. 
 
By increasing or decreasing the Rotation Speed of the field, you can better control the rate of rotation of your particles.
 
Rotation Attenuation
 
The faster a particle is rotating around a point, the greater the centrifugal force pushing it outwards is. Rotation Attenuation allows you to apply less Rotation Speed to the particles the further they get from the curve.
 
Use Rotation Attenuation to achieve tight vortices rotating at high speeds.
 
*Rotation Attenuation is only applied if you Use Max Distance is enabled.
 
Input Curve
 
This attribute is only available through MEL or the Connection Editor.  To connect a different curve to the Curve Field, simply connect the desired curve's worldSpace attribute to this attribute.

 

Curve Field Notes

1. Evaluation of the field will not occur if :

the magnitude of the field is 0 and either the magnitudePP attribute has not been set or the specified attribute for the magnitudePP does not exist on the particle object.

2. Deleting the curve that is connected to the field will result in the curve data being baked into the field for the remainder of the Maya session. However, the data will not be stored when the file is saved, resulting in the field not working when the file is reopened.
 

Curve Field Uses

Gaseous or Liquid Flows

Flow your particle systems or rigid bodies along curves to achieve maximum control over your simulation.

Motion Currents

By creating multiple Curve Fields, you can simulate different types of currents of motions.

Vortex

Using Attraction and Rotation, you have a large amount of control over the shape and motion of your vortex'.


Curve P & S (Problem and Solutions)

P.  My particles don't follow the bends of my curve and increasing the attraction just makes them stick to the curve.
S.  Decrease the conserve attribute of your particles.

P.  My particles are bunching up at the end of the curve rather than continuing to move outwards.
S.  If you have attraction set on the field, once the particles reach the end of the curve, they are all going to be attracted to the end point.  There are several ways to solve this problem.  The simplest would be to map the Attraction Map attribute with a ramp and make the ramp white right up to the top and then make the tip of ramp black.  This way the particles can continue to use the speed and rotation values that you have set, but there will be no attraction at the end of the curve.