07-04-2009, 07:54 AM
I noticed two examples from the help file which were not working when used. Here are my fixed recommendations..
EXAMPLE: FumeFX MAXScript Functions for Accessing the Simulation
Variables k and nz are integers, so dividing k/nz will always result in 0 in maxscript. A fix would be is to convert one of them to a float type, or just multiply one of them to 1.0.
FIX:
--------------------------------------------------------------------------------------
EXAMPLE: More Channel Functions
The index input required by the functions GetSmokeByIndex and SetSmokeByIndex was not set.
FIX:
I also changed the recommended code format as it is more maxscript-centric.
EXAMPLE: FumeFX MAXScript Functions for Accessing the Simulation
Code:
fn PostObjects = (
for i in 0 to (nx - 1) do
for j in 0 to (ny - 1) do
for k in 0 to (nz - 1) do
SetSmoke i j k k/nz
)FIX:
Code:
fn PostObjects =
(
for i in 0 to (nx - 1) do
(
for j in 0 to (ny - 1) do
(
for k in 0 to (nz - 1) do
(
val = k/(nz as float) -- fix
SetSmoke i j k val
)
)
)
)--------------------------------------------------------------------------------------
EXAMPLE: More Channel Functions
Code:
fn PostLoad = (
sm = 1.0 -- desired minimum smoke value
for i in 0 to (voxels-1) do
(
s = GetSmokeByIndex
if (s < sm) then ( SetSmokeByIndex sm )
)
)FIX:
Code:
fn PostLoad =
(
sm = 1.0 -- desired minimum smoke value
for i in 0 to (voxels-1) do
(
s = GetSmokeByIndex i
if (s < sm) then ( SetSmokeByIndex i sm )
)
)I also changed the recommended code format as it is more maxscript-centric.
Jeff Lim

