Scene

With the Scene functions, you can retrieve and set global scene attributes, like the aspect ratio of the cells in the scene grid.

The following is a list of the Scene functions:

beginUndoRedoAccum
cancelUndoRedoAccum
clearHistory
closeScene
closeSceneAndExit
closeSceneAndOpen
coordAtCenterX
coordAtCenterY
currentEnvironment
currentJob
currentProjectPath
currentProjectPathRemapped
currentResolutionX
currentResolutionY
currentScene
currentVersion
currentVersionName
defaultResolutionFOV
defaultResolutionName
defaultResolutionX
defaultResolutionY
endUndoRedoAccum
fromOGL
getCameraMatrix
getFrameRate
getMissingPalettes
numberOfUnitsX
numberOfUnitsY
numberOfUnitsZ
redo
saveAll
saveAsNewVersion
setCoordAtCenter
setDefaultResolution
setFrameRate
setNumberofUnits
setUnitsAspectRatio
toOGL
undo
unitsAspectRatioX
unitsAspectRatioY

Example

This script uses an undo/redo wrapper to enclose several functions in one command called “Set Scene”. The Set Scene command sets the aspect ratio of the scene, sets the number of units of the scene and sets the centre coordinates.

function setScene()

{

// Sets the beginning of the undo/redo command wrapper

scene.beginUndoRedoAccum("Set Scene");

// Sets the aspect ratio of the scene to 4, 3

scene.setUnitsAspectRatio(4, 3);

// Sets the number of units in the scene

scene.setNumberOfUnits(1200, 900, 12);

// Sets the value of the center coordinate

scene.setCoordAtCenter(5000, 5000);

// Terminates the undo/redo command wrapper

scene.endUndoRedoAccum();

}

Related Topics 

Scripting Reference