FxView โ
This module contains functions to control the viewport.
Load โ
FxView = require "FxView";Functions โ
| Function | Description |
|---|---|
| Capture (Filename) | Saves the current view as an image file. |
| FrameNode (NodeID) | Moves the camera so it has specified nodes in its field of view. |
| FrameScene () | Moves the camera so it has all objects in its field of view. |
| GetCamera () | Returns the active camera. |
| SetCamera (NodeID) | Activates a camera. |
Capture (Filename) โ
This function saves the current view as an image file.
Parameters โ
- Filename: The absolute file path the image file is to be saved as
Errors โ
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_FILE_OPERATION_FAILED
Since โ
Version 1.0
Example โ
FxView.Capture("c:\\myfolder\\capture.png");FrameNode (NodeID) โ
This function moves the camera to a position where it has the specified nodes in its field of view.
Parameters โ
NodeID: The NodeID to identify the nodes to frame
Errors โ
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND
Since โ
Version 1.0
Example โ
-- frame selected nodes
FxView.FrameNode("/s");FrameScene () โ
This function moves the camera to a position where it has all objects in its field of view.
Errors โ
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE
Since โ
Version 1.0
Example โ
FxView.FrameScene();GetCamera () โ
This function returns the ID of the active camera. If the active camera is the default camera then an empty string is returned.
Returns โ
An empty string if the default camera is active, otherwise the NodeID of the active Camera.
Errors โ
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE
Since โ
Version 1.0
Example โ
camera = FxView.GetCamera();SetCamera (NodeID) โ
This function activates the specified Camera. To activate the default camera, pass an empty string.
Parameters โ
- NodeID: The NodeID of the Camera node to activate
Errors โ
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND
Since โ
Version 1.0
Example โ
-- activate camera1
FxView.Set("camera1");
-- activate default camera
FxView.Set("");