Page Information

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
themeEclipse
linenumberstrue
languagepython
for projectFile in projectList:
    scene.load(projectRoot+"/"+projectFile+"/"+projectFile+".flw")
    scene.reset()
    scene.simulatesimulateRange(0, 200)

 

With scene.simulate(start, stop) you are able to specify the simulation range. In many cases the ranges are not the same for each project, and this will be an addition for this script. Assuming that the start frame is not subject to change, it is only a matter of different end frames. For this purpose another list is created containing all the stop frames. A counter is needed, too: 

Code Block
themeEclipse
linenumberstrue
languagepython
stopFrameList = [50,100,150,200]
counter       = 0
projectRoot   = "E:/RF Projects/Batch Simulations/Various/"
projectList   = ["Splash","filling_a_glass","rbd test_01","GridFluid_BeachScene"]

for projectFile in projectList:
    scene.load(projectRoot+"/"+projectFile+"/"+projectFile+".flw")
    scene.reset()
    stopFrame = stopFrameList[counter]
    scene.simulatesimulateRange(0, stopFrame)
    counter += 1

...