Possible to Render to a non-active camera via script? [SOLVED]

bigD3dbigD3d Posts: 75

Hello all,

I'm working on a script trying to render from different cameras in the scene programatically. I'm referencing this script for the constructor 

DzImageRenderHandlerSize size, DzTime renderTime, String filename )

(which btw, does not run as-is with 4.12 without a few syntax fixes)

http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/imagerenderhandler_dz#a_1a503b91ae4ce48a7fd4259655af0b8fcb

the script gets the camera based on the camera being active in the viewport.

// Get the active viewport and camera
var oActiveView = MainWindow.getViewportMgr().getActiveViewport();
var oCamera = oActiveView.get3DViewport().getCamera();

In my script I am selecting a camera which may or may not be active in the viewport. When I run it the rendering starts, I get a progress popup window, but then there is no resulting image saved off. It makes me wonder if it is REQUIRED to only render from the camera which is active in the viewport?

If yes, then I need to change the user's current camera in the viewport (depending on what layout?) and then make it active, and then start the render?

thanks in advance for any info.

EDIT: Found the problem in my image path which caused the file not to output - it wasn't an issue with the camera being inactive. And yes, it allowed me to render from the camera that was not active in the viewport...

Post edited by bigD3d on
Sign In or Register to comment.