MAXScript Extensions > MAXScript Extensions for character studio > Crowd MAXScript Extensions > SpaceWarps >

# Vector_Field: SpacewarpObject

Value > MAXWrapper > Node > SpacewarpObject > Forces > Vector_Field

| Character Studio - Quick Navigation

Constructor

    Vector_Field ... VectorField ...

Properties

    <Vector_Field>.Length Float Default: 0.0 -- world units

Specify the length dimension of the vector field lattice. The lattice should be larger than the vector field object.

    <Vector_Field>.Width Float Default: 0.0 -- world units

Specify the width dimension of the vector field lattice. The lattice should be larger than the vector field object.

    <Vector_Field>.Height Float Default: 0.0 -- world units

Specify the height dimension of the vector field lattice. The lattice should be larger than the vector field object.

    <Vector_Field>.LenSegs Integer Default: 1 Alias: Length_Segments

Specify the resolution of the vector field lattice’s length segments. The greater the resolution, the higher the accuracy of the simulation.

    <Vector_Field>.WidSegs Integer Default: 1 Alias: Width_Segments

Specify the resolution of the vector field lattice’s width segments. The greater the resolution, the higher the accuracy of the simulation.

    <Vector_Field>.HgtSegs Integer Default: 1 Alias: Height_Segments

Specify the resolution of the vector field lattice’s height segments. The greater the resolution, the higher the accuracy of the simulation.

    <Vector_Field>.showLattice Boolean Default: True

Set on to display the vector field lattice as a yellow wireframe box. The vectors are generated at lattice intersections inside the vector field range.

    <Vector_Field>.showRange Boolean Default: True

Set on to display the volume about the obstacle object within which vectors are generated as an olive-colored wireframe.

    <Vector_Field>.showVectors Boolean Default: False

Set on to display vectors, which appear as blue lines emanating outward from the lattice intersections within the range volume.

    <Vector_Field>.showSurfSamps Boolean Default: False

Set on to display short green lines emanating from sample points on the surface of the obstacle object.

    <Vector_Field>.vecScale Float Default: 1.0 -- world units

Scales the vectors so they're more visible or less obtrusive. This setting does not affect the strength of the vectors only their visibility.

    <Vector_Field>.iconSize Float Default: 0.0 -- world units

Adjusts the size of the Vector Field space warp icon. The icon is a pair of crossed double-headed arrows. Increase the size for easier viewport selection.

    <Vector_Field>.strength Float Default: 1.0 -- animatable; world units

Sets the degree of effect the vectors have on the movement of an object entering the vector field. Changing Strength does not require that you recalculate the vector field.

    <Vector_Field>.falloff Float Default: 2.0 -- animatable; world units

Determines the rate at which the strength of the vectors falls off with distance from the surface of the object. A value of 0 will make all the vectors the same size. A value greater than 0 will make them get smaller as they get further away. A value less then 0 will make them get larger as they get further away.

    <Vector_Field>.direction Integer Default: 1 -- animatable

Sets whether the force generated by the vectors works parallel or perpendicular to the vector field. Because the vectors are perpendicular to the object surface, and you typically would want delegates to travel parallel to the surface, you would normally use a perpendicular force.

0 - Parallel

1 - Perpendicular

    <Vector_Field>.pull Float Default: 0.0 -- animatable; world units

Adjusts objects' position relative to the field. Available only when Perpendicular is chosen. Range=-1.0 to 1.0. Objects moving perpendicular to a vector field sometimes tend to drift away from it, due to lack of subsampling. The Pull parameter helps to pull objects back. Pull values greater than 0 create a pulling force towards the source of the vector field vector. Values less than 0 pull the force towards the direction in which the vector field's vector is pointing. A value of 0.0 produces a force perfectly perpendicular to the vector field's vector.

    <Vector_Field>.object Node Default: Undefined Alias: Vector_Field_Object

The obstacle object around which the vector field is to be generated. Only primitives and unmodified editable mesh objects can be used as obstacles. The object should be fully enclosed in the Vector Field lattice.

    <Vector_Field>.range Float Default: 1.0 -- world units

Determines the volume within which vectors are generated. The Range is represented in viewports as an olive-colored wireframe that starts out the same size and shape as the obstacle object. Increasing the Range setting moves the wireframe away from the obstacle object in the direction of its surface normals.

Note

In crowd simulations, the Range outline is where the delegates start to "see" the obstacle object, and begin to turn to avoid it. If your crowd members are penetrating the obstacle, or even just coming too close to it before turning, increase the Range setting. Also try increasing the Vector Field lattice resolution and/or the Sample Res setting.

    <Vector_Field>.resolution Integer Default: 1

Acts as a multiplier of the effective sampling rate used on the obstacle object's surface to calculate vector directions in the field. The basic sampling rate is determined by the program from the size of the lattice and the size of each polygon.

    <Vector_Field>.flipFaces Boolean Default: False

Setting to true causes flipped normals to be used during the computation of the vector field. By default, vectors are generated in the same direction as the obstacle object's face normals, so that assuming its face normals point outward, objects move around its exterior in a crowd simulation. However, if you want objects to remain within an object's interior, turn on flipFaces.

    <Vector_Field>.blendStart Float Default: 0.0 -- world units

The distance from the object at which blending the vectors starts.

    <Vector_Field>.blendFalloff Float Default: 2.0 -- world units

The falloff of the blend of the surrounding vectors.

    <Vector_Field>.blendWidSegs Integer Default: 1

The number of adjacent lattice points to blend on the X axis.

    <Vector_Field>.blendLenSegs Integer Default: 1

The number of adjacent lattice points to blend on the Y axis.

    <Vector_Field>.blendHgtSegs Integer Default: 1

The number of adjacent lattice points to blend on the Z axis.

Methods

    vfields.computeVectors <Vector_Field>

Calculates the vector field using the current Vector Field parameters. Always recalculate the vector field after changing any of the non-display related parameters.

    vfields.BlendVectors <Vector_Field>

Blends the vectors for reducing abrupt changes in angles of neighboring vectors.

Associated Methods

    bindSpaceWarp <node> <Vector_Field_node>

Associated Binding Modifier

Vector_Field_Mod

This modifier is automatically created by the bindSpaceWarp() method, and is not otherwise creatable by MAXScript. There are no properties associated with this binding modifier.

#### See Also

- Node Common Properties, Operators, and Methods

- MAXWrapper Common Properties, Operators, and Methods

- Value Common Properties, Operators, and Methods

- MAXScript Extensions in character studio