GrowFX Manual (for version 1.x)

MAXScript Access

MAXScript Access

Constructor:

growfx ...
Example:

gfx = growfx name:"Tree_01" position:[10,10,0]

Properties:

<growfx>.LineOnly : Boolean default: true
<growfx>.Manual : Boolean default: false
<growfx>.IconSize : Float default: 0.0
<growfx>.Seed : Integer default: (random value)
<growfx>.CountPaths : Integer : Read only
<growfx>.GfxFileName : String

Cache Mode properties:

<growfx>.CacheMode : Boolean default: false
<growfx>.CacheFileName : String : Read only
<growfx>.OneFile : Boolean default: false
<growfx>.OneFilePerFrame : Boolean default: true
<growfx>.NumThreads : Integer default: (number of cores on the current PC)
<growfx>.RecordCurrentFrame : Boolean default: false
<growfx>.RecordAnimation : Boolean default: true
<growfx>.CacheStartFrame : Timevalue default: 0
<growfx>.CacheEndFrame : Timevalue default: 100
<growfx>.PlaybackStartFrame : Timevalue default: 0
<growfx>.PlaybackSpeedFactor : Float default: 1.0
<growfx>.PlaybackLoopAnimation : Boolean default: true


Methods:

ConvertToGrowFX2()

Converts this object to GrowFX version 2.x. This is only available in version 1.9.9 (final), which comes with GrowFX 2.x.

SavePreset <pathfile_name_string>
LoadPreset <pathfile_name_string>

Save and Open preset files.

Update()

Updates the GrowFX internal caches and viewport display to account for all the changes made by other functions in this kit.

NewSeed()

Generate a new random seed.

addPath [ <path_name_string> ]

Adds a new path and returns the index of path, 0 if it failed.

addDistributor <path_index_integer> \
( #distr | #point | #path | #pathpos | #surface ) \
[ <name_string> ]

Adds a new distributor to the indexed path, where <path_index_integer> is the index of the path. The 2 argument specifies the type of the distributor. Returns true if the addition was successful, false if it failed.

addModifier <path_index_integer> \
( #random | #vector | #radial | #spiral | #zigzag | #noise | #twist | \
#react | #objslice | #seslice | #vectororient | #pathreact | #deviation | \
#spline | #optimize | #hardbend | #wind | #copy | #alignchildren | #eraser | #trim | \
#overridesteps | #shape ) \
[ <name_string> ]

Adds a new direction modifier to the indexed path, where <path_index_integer> is the index of the path. The 2 argument specifies the type of the modifier. Returns true if the addition was successful, false if it failed.

addMesh <path_index_integer> \
( #cylinder | #meta | #leaves | #instance | #stdleaves ) \
[ <name_string> ]

Adds a new mesh builder to the indexed path, where <path_index_integer> is the index of the path. The 2 argument specifies the type of the mesh builder. Returns true if the addition was successful, false if it failed.

addAfterMeshModifier <path_index_integer> \
( #random | #vector | #radial | #noise | #twist | \
#react | #vectororient | #hardbend | #wind ) \
[ <name_string> ]

Adds a new After Mesh modifier to the indexed path, where <path_index_integer> is the index of the path. The 2 argument specifies the type of the modifier. Returns true if the addition was successful, false if it failed.



deletePath <path_index_integer>

Deletes the specified path. <path_index_integer> is the path you want to delete. The order of paths is the order in which they are views.

deletePathByName <path_name_string>

Deletes the specified path. <path_name_string> is the name of path you want to delete. Returns true if path deleted, false otherwise.

deleteDistributor <path_index_integer> <distributor_index_integer>

Deletes the indexed distributor for the specified path, indexes are 1-based.

deleteModifier <path_index_integer> <modifier_index_integer>

Deletes the indexed modifier for the specified path, indexes are 1-based.

deleteMeshBuilder <path_index_integer> <mesh_index_integer>

Deletes the indexed mesh builder for the specified path, indexes are 1-based.

deleteAfterMeshModifier <path_index_integer> <aftermeshmodifier_index_integer>

Deletes the indexed after mesh modifier for the specified path, indexes are 1-based.



getNumPaths()

Returns the number of paths.

getNumDistributors <path_index_integer>

Returns the number of distributors for the specified path, index are 1-based.

getNumModifiers <path_index_integer>

Returns the number of modifiers for the specified path, index are 1-based.

getNumMeshBuilders <path_index_integer>

Returns the number of mesh builders for the specified path, index are 1-based.

getNumAfterMeshModifiers <path_index_integer>

Returns the number of after mesh modifiers for the specified path, index are 1-based.



getPath <path_index_integer>

Returns the indexed path, index are 1-based.

getPathByName <path_name_string>

Returns the path by name, <path_name_string> is the name of path to find.

getDistributor <path_index_integer> <distributor_index_integer>

Returns the indexed distributor for the specified path, indexes are 1-based.

getModifier <path_index_integer> <modifier_index_integer>

Returns the indexed modifier for the specified path, indexes are 1-based.

getMeshBuilder <path_index_integer> <mesh_index_integer>

Returns the indexed mesh builder for the specified path, indexes are 1-based.

getAfterMeshModifier <path_index_integer> <aftermeshmodifier_index_integer>

Returns the indexed after mesh modifier for the specified path, indexes are 1-based.



getNumSequences()

Returns the number of sequences. It equals the number of objects that are used in the distributors (the GrowFX icon, points, surfaces, etc.).

getNumLines <sequence_index_integer>

Returns the number of lines for the specified sequence, index are 1-based.

GenerateOneMesh <sequence_index_integer> <line_index_integer>

After calling this function, GrowFX generates a mesh for only the specified line, indexes are 1-based.

ResetOneMesh()

Resets the state of the previous function.



Cache Mode methods:

NewCacheFile <string_path_filename>

Specifies the name of the new cache file. Returns true if the file was successfully prepared, false if it failed.

LoadCacheFile <string_path_filename>

Loads the specified cache file. Returns true if the cache file was found and loaded successfully.

RecordCache()

Records the cache data of the given GrowFX object to the disk.

ResetCache()

Resets the cache data.

DeleteCache()

Deletes the cache file from the disk.



Paths properties:

<growfx>.<path>.Enabled : Boolean default: on
<growfx>.<path>.WireColor : Color default: (random color)

Distributors properties:

<growfx>.<path>.<distributor>.Enabled : Boolean default: on

Point Distributor:

<growfx>.<path>.<distributor>.AddPoint <point_object>

Path distributor and Path position distributor Methods:

<growfx>.<path>.<distributor>.AddStartPath <path_index_integer>

Adds the specified path to the Starting path list, where <path_index_integer> is the index of the added path.

Direction modifiers properties:

<growfx>.<path>.<modifier>.Enabled : Boolean default: on

Object reaction modifier:

<growfx>.<path>.<modifier>.SetObject <object>

Wind Animation modifier:

<growfx>.<path>.<modifier>.Enabled : Boolean default: on
<growfx>.<path>.<modifier>.Stiffness : Float default: 50.0
<growfx>.<path>.<modifier>.Flexibility : Float default: 1.0
<growfx>.<path>.<modifier>.ScaleFrequency : Float default: 1.0
<growfx>.<path>.<modifier>.AmplitudeMultiplier : Float default: 20.0
<growfx>.<path>.<modifier>.AxialRotation : Boolean default: off
<growfx>.<path>.<modifier>.MaxAngle : Float default: 90.0
<growfx>.<path>.<modifier>.OrientForLeaves : Boolean default: off
<growfx>.<path>.<modifier>.Looping : Boolean default: off
<growfx>.<path>.<modifier>.LoopingPeriod : Time default: 100f
<growfx>.<path>.<modifier>.SetWind <wind_object>

Spline direction modifier:

<growfx>.<path>.<modifier>.SetSpline <spline_object>

Mesh builders properties:

<growfx>.<path>.<mesh>.Enabled : Boolean default: on


Example:

gfx = growfx name:"Tree_01" position:[10,10,0]
gfx.IconSize = 30
gfx.addpath "path01"
gfx.addDistributor 1 #distr "Distr1"
gfx.addModifier 1 #random "RandomDir"
gfx.path01.Distr1.DistributorInPoint.count=10
gfx.path01.RandomDir.Max_Angle = 2
gfx.addpath "path02"
gfx.addDistributor 2 #path "Distr_on_path01"
gfx.path02.Distr_on_path01.addstartpath 1
gfx.Update()
gfx.SavePreset "d:\mytree.gfx"

showproperties gfx.path02.Distr_on_path01

TOP