Versions Compared

Key

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

...

Once a simulation has been reached the last simulation frame, RealFlow goes through the simulation, takes screenshots from every frame, and saves them. After this process, a message is being printed in orange to point you to the images' location.

Code Block
# Get the project's last simulation frame
lastFrame = scene.getMaxFrames()

...



# If the simulation has reached the last frame get the path where preview images will be stored
if (scene.getCurrentFrame() == lastFrame):
	path = scene.getExportResourcePath(2)
 
	# Create a playback function to go through the cached frames automatically
	for frame in range(scene.getMinFrame(), lastFrame + 1):
		scene.setCurrentFrame(frame)
 
		# Make a screenshot and save the image under the given path from above
		openGLImage = scene.getCurrentViewportImage()
		openGLImage.save(path)

...


	# Print out a coloured message when the preview is ready
	scene.message("<font color=orange> <font size=3>The images can be found under "+path+"</font>")