Flow : GeometryClass

Flow - superclass: GeometryClass; super-superclass:node - 9:0 - classID: #(164197351, 608853532)

Value > MAXWrapper > Node > GeometryClass > Flow

 

   

Geometry Objects - Quick Navigation

Exposes the Path Flow object to MAXScript. It is part of the Populate toolset.

Available in 3ds Max 2014 and higher.

   

Constructors:

Flow... PathFlow...

   

Properties:

<Flow>.showLanes     BooleanClass    default: true   --  boolean

Get/set the display of Lanes in the Flow.

   

<Flow>.width     Float    default: 275.591   --  float

Get/set the width of the Flow in system units.

   

<Flow>.laneWidth     Float    default: 51.1811   --  float

Get/set the width of the Lanes in system units.

   

People group of controls

<Flow>.density     Float    default: 0.25   --  float

Get/set the value of the Density slider.

Slider values are between 0.0 and 1.0.

Values higher than 1.0 can be specified using MAXScript.

Default is 0.25.

   

<Flow>.gender     Float    default: 0.5   --  float

Get/set the value of the Gender slider.

Default is 0.5, which means 50% Male and 50% Female.

Possible value are between 0.0 (All Male) and 1.0 (All Female).

   

<Flow>.direction     Name    default: #HugLeft   --  enum
<Flow>.directionIndex     Integer    default: 2   --  integer

Get/set the value of the Direction slider as Enum Name or Integer value.

The .direction property is exposed by the PathFlow Interface - see further on this page.

Possible values are:

.directionIndex .direction Enum name UI Slider Value
1 #forward Direction: Forward
2 (default) #hugLeft Direction: Hug Left
3 #weaveLeft Direction: Weave Left
4 #weaveRight Direction: Weave Right
5 #hugRight Direction: Hug Right
6 #backward Direction: Backward

   

<Flow>.positionSample     Integer    default: 1   --  integer

Get/set the Positions Samples value. Default is 1.

   

<Flow>.genderSample     Integer    default: 1   --  integer

Get/set the Gender Samples value. Default is 1.

   

Flow interfaces:

Interface: PathFlow

Properties:

.direction : enum : Read|Write 
    direction enums: {#Forward|#HugLeft|#WeaveLeft|#WeaveRight|#HugRight|#Backward}

Get/set the value of the Direction slider as Enum Name.

   

Methods:

<integer><Flow>.NumPoints()

Returns the number of points in the Flow.

   

<point3 by value><Flow>.GetPoint <integer>index

Returns the position of the indexed Flow point.

The index is 1-based.

   

<void><Flow>.AddPoint <point3>point

Adds a new point with the given position to the end of the Flow .

   

<boolean><Flow>.InsertPoint <integer>index <point3>point

Inserts a new point at the indexed position within the Flow specified by the first argument and with position given by the second argument.

The index is 1-based.

Returns True on success, False on failure.

   

<boolean><Flow>.SetPoint <integer>index <point3>point

Sets the position of the indexed point specified by the first argument to the coordinates specified by the second argument.

The index is 1-based.

Returns True on success, False on failure.

   

<boolean><Flow>.DeletePoint <integer>index

Deletes the indexed point from the Flow.

The index is 1-based.

Returns True on success, False on failure.

   

<boolean><Flow>.CreateRamp <integer>index

Creates a ramp at the specified indexed point.

The index is 1-based.

Returns True on success, False on failure.

   

<boolean><Flow>.DeleteRamp <integer>index

Deletes the ramp at the specified indexed point.

The index is 1-based.

Returns True on success, False on failure.

   

<float><Flow>.GetCreasePercent <integer>index

Returns the crease value at the indexed ramp point.

The index is 1-based.

The "percent" value is actually expressed as a Float in the range from 0.0 to 1.0.

A value of 0.0 denotes no ramp.

   

<boolean><Flow>.SetCreasePercent <integer>index <float>percent

Sets the crease value at the indexed point to the specified floating point value.

The index is 1-based.

The "percent" value is actually expressed as a Float in the range from 0.0 to 1.0.

Returns True on success if the indexed point was part of a ramp

Returns False on failure, for example if attempting to set a ramp point to a crease of 0.0, or a non-ramp point to a crease greater than 0.0.

   

EXAMPLES:
theFlow = Flow() --Create a Flow object
--> $Flow:Flow001 @ [0.000000,0.000000,0.000000]
theFlow.AddPoint [0,0,0] --Add some points
--> true
theFlow.AddPoint [1000,0,0] 
--> true
theFlow.AddPoint [2000,1000,0] 
--> true
theFlow.AddPoint [2000,2000,0] 
--> true
theFlow.NumPoints() --Check the number of points
--> 4
theFlow.GetPoint 1 --Get the first points
--> [0, 0, 0]
theFlow.InsertPoint 3 [1500,1000,0] --Insert a new point between the second and third points
--> true
theFlow.DeletePoint 3 --Delete the new third point
--> true
theFlow.InsertPoint 3 [1700,800,0] --Insert a different new point between the second and third points
--> true
theFlow.CreateRamp 3 --Create a Ramp at the third point - this will introduce new points 4 and 5
--> true
theFlow.SetPoint 3 ((theFlow.getPoint 3) + [0,0,100]) --Lift the third point by 100 units along +Z
--> true

--Print the Crease values:
for i = 1 to theFlow.NumPoints() do format "%: %\n" i (theFlow.GetCreasePercent i)
--> 1: 0.0
--> 2: 0.0
--> 3: 0.0
--> 4: 0.33
--> 5: 0.66
--> 6: 0.0
--> 7: 0.0
--> OK

theFlow.SetCreasePercent 1 0.25 --Cannot set a non-ramp point to a non-zero crease value
--> false
theFlow.SetCreasePercent 4 0.0  --cannot set a ramp point to a zero value
--> false

theFlow.SetCreasePercent 4 0.25 --can set ramp points to non-zero values
--> true
theFlow.SetCreasePercent 5 0.75 
--> true

theFlow.DeleteRamp 3 --Cannot delete the Ramp at the 3rd point
--> false
theFlow.DeleteRamp 4 --But it is ok to delete it at the 4th
--> true

See Also