Announcement

Collapse
No announcement yet.

Reusing part of old simulation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reusing part of old simulation

    I've filled a glass with liquid which comes to rest by frame 39.
    I pause the sim then unhide some animated objects which drop into the glass.
    I un-paused the sim and let the liquid react.

    Now I would like to tweak the sim settings but I don't want to have to re-simulate the filling of the glass from scratch. It would be great to start simulating from frame 39 however when I do this, the glass is cleared of the existing fluid.

    I wrote the following Phoenix script to try to initialize the grid based on the cell temperatures of the previous frame:

    fn OnSimulationBegin=(
    --Will be executed once when simulation begins
    a_setsystem 0 --"core"
    xc=this.xc; yc=this.yc; zc=this.zc;
    for x=0 to xc do
    (
    for y=0 to yc do
    (
    for z=0 to zc do
    (
    t=38
    temperature=a_gett[x,y,z]
    t=39
    a_sett x y z temperature
    )
    )
    )
    )


    However the grid is still cleared even with this code. Is it even possible to do what I'm trying to do?
    Thanks
    Graham Macfarlane
    3D Studio Max, Vray and motion graphics specialist
    Elyarch Ltd - London UK

  • #2
    the script code is wrong, however this can be done without scripting, just export the velocity when simulating, and press "restore" to start the simulation from the desired frame.
    the best way to do the same with a script is to create a second phoenix object with input path directed to the simulation result of the first one and set to use only the desired frame (see the animindex option)
    then the cycle budy should be like this
    temperature=a_gett $secondphx x y z
    a_sett x y z temperature
    ______________________________________________
    VRScans developer

    Comment


    • #3
      Thanks Ivaylo,
      Works like a charm now!
      Graham Macfarlane
      3D Studio Max, Vray and motion graphics specialist
      Elyarch Ltd - London UK

      Comment

      Working...
      X