User Tools

Site Tools


DzViewRenderHandler

A render handler that renders to a new window.

More...

Inherits :

Constructors

DAZ Script
DzViewRenderHandler ( Size size, DzTime time, String filename, Boolean isSoftware )

Detailed Description

TODO: Add detailed description.

Constructors


DzViewRenderHandler( Size size, DzTime time, String filename, Boolean isSoftware )

Create a new view render handler for rendering a single frame.

Parameter(s):

  • size - The width & height of the rendered image.
  • time - The time to render the frame at.
  • filename - The filename to save the image to.
  • isSoftware - If true, the window shows itself at the beginning of rendering so that the user can see the progress of the render. If false, the window stays hidden until the render is complete so that it does not interfere with the OpenGL viewport.

Example:

// Get the active viewport and camera
var oActiveView = MainWindow.getViewportMgr().getActiveViewport();
var oCamera = oActiveView.get3DViewport().getCamera();
 
// Get the render options
var oRenderOptions = App.getRenderOptions();
 
// Create a handler
var oHandler = new DzViewRenderHandler( oRenderOptions.getImageSize(), 0, App.getTempPath() + "/test.jpg", true );
 
// If we have a valid handler
if( oHandler ){
	// Set the background color
	oHandler.setBackColor( oActiveView.get3DViewport().background );
 
	// Get the renderer
	var oRenderer = oRenderOptions.getActiveRenderer();
 
	// Render, using our handler and options
	oRenderer.render( oHandler, oCamera, oRenderOptions );
}