GenerativeComponents Help

Exporting Frames

This simplest way to export individual frames to stitch together later is to use the SaveViewToImageFile() function. As arguments, you can specify which view window to export, the height of the image to export in pixels (the width will be derived proportionally from the aspect ratio of the window), and a file path for the exported JPEG. The current view's shading settings will be used for rendering the image before exporting it.

A sample script would look like the following:

transaction script 'animate camera'
{
	int frames = 15;
	double tVal = 0;
	double tInc = 1/frames; 

	for (int i = 1; i <= frames; i++)
	{ 
		camPt.T = tVal;
		UpdateGraph();
		SaveViewToImageFile(1, 1080, "file path here
including name of file.jpg" + (i+1)); 
		tVal = tVal + tInc;
	} 
}
Note: The file path argument in the SaveViewToImageFile function is concatenated using the plus sign (+) to add an increment counter at the end of each file exported. This will allow the images to be exported as an image sequence, which will facilitate importing them into your preferred video editing software. Without the increment counter, every new file exported would replace the previous image file until the script had finished, at which point only the final frame would be present in your animation folder.