• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
global variables not acceseble when sim again...?
#1
Hi

I'm trying to learn some fume sim scripting. I've tried this:
Code:
-- GLOBAL VARIABLES
------------------
-- declare here...

-- FUNCTIONS
------------

-- before first step has started, but after snapshots have been loaded etc...
fn PreSim = (
    print pointArr
    print "pointArr should be printed above!"
    if pointArr != undefined then(
        for i in pointArr do(
            delete i
        )
    )
    global pointArr = #()
    for i in 0 to (voxels-1) do(
        myPoint = point pos:(ffxIndexToWorld i) Box:on cross:off size:2 constantscreensize:on
        append pointArr myPoint
        --addModifier myPoint (Voxel_Data())
    )
    ffxHoldWindowOnce()
    print pointArr
    print "STOP-----------------\n---------------------"
)

but when I run the sim again, the global pointArr isn't there anymore. Is there a way to make the array accessible in all simulations of this FFX?
  Reply
#2
strange things happening here :lol:

I have to find out what's going on...

Just one thing I would like to whish for future before i forget is that the script is saveable seperatly, and does not save with the file automatically. I did some testings, updated the script till it worked, saved it and then closed the file and clicked do not save changes. and the script has been rewritten to the previous state :?
  Reply
#3
Is there a way to get voxel data from outside the fumeFx script window? some kind of "$FumeFx01.getSmokeWorld [50,100,20] $FumeFx01.transform" ?
  Reply
#4
Hi,

try to run this in PostStep, that will fill it with actual data for that frame.

You can also run this in PostLoad. Anytime a frame is loaded (slider change, render...). After you have run the simulation you can make a preview or render, so all frames get loaded and your code can be executed on all frames.

I'm not sure why pointArr should not remain available since it's global and should remain visible for the entire max session.

Vjeko
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)