In the exported MXS, you should find one camera for each Scene in the SKP. I assume that there is some method to their names, as created by your plugin, such that you could script Maxwell Render to render each camera using its setActiveCamera(name) function. I quickly threw such a script together; it assumes SketchUp's own default Scene-naming convention:
Code: Select all// This script loops through a set of cameras, specified by name and
// index. It must be customized to fit the characteristics of the given
// MXS file. As set up, it expects to find the MXS filled with cameras
// whose names begin with 'Scene '. This base name is stored below
// in the 'baseName' variable. It expects the scene numbers to begin
// at 1 and to end at 3, with these limits being stored below in the
// 'firstFrame' and 'lastFrame' variables. It will loop through the frame
// range looking for cameras which fit the pattern 'Scene 1', rendering
// each one as it is found.
var firstFrame = 1;
var lastFrame = 3;
var baseName = "Scene ";
// internal vars & events
var isRendering = 0;
var currentFrame = firstFrame;
var outputFolder = FileManager.getFileFolder(Scene.mxsPath);
RenderEvents["renderFinished()"].connect(renderHasFinished);
// render loop
while (currentFrame <= lastFrame)
{
renderCamera(currentFrame);
while(1)
{
if(isRendering == 0)
{
break;
}
}
currentFrame++;
}
// functions
function renderCamera(frameNumber)
{
var sceneName = baseName + frameNumber;
Scene.setActiveCamera(sceneName);
if (Scene.activeCameraName != sceneName)
{
Maxwell.print("The MXS contains no camera named '" + sceneName + "'!");
}
else
{
Maxwell.print("rendering Scene: " + sceneName);
Scene.setMxiPath(outputFolder + "\" + sceneName + ".mxi");
Scene.setImagePath(outputFolder + "\" + sceneName + ".png");
isRendering = 1;
Maxwell.startRender();
}
}
function renderHasFinished()
{
isRendering = 0;
Maxwell.print("Render finished!!");
}