GrowFX Manual: 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

Methods:

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.

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.

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.



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.

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.



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 disk.

ResetCache()

Resets the cache data.

DeleteCache()

Deletes the cache file from the disk.



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.



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>

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