LensStudio:HierarchyUtils.js.findOrCreateCameraObject
FunctionFinds or creates a camera object of the specified type within the given scene.
findOrCreateCameraObject(
scene,cameraType,bearerSceneObject?):SceneObject
Finds or creates a camera object of the specified type within the given scene.
Parameters
| Parameter | Type | Description |
|---|---|---|
scene | Scene | The scene in which to find or create the camera object. |
cameraType | CameraType | The type of camera to find or create (Orthographic or Perspective). |
bearerSceneObject? | SceneObject | Optional. The scene object to which the new camera will be attached if created. |
Returns
The scene object containing the camera of the specified type.
Throws
Will throw an error if the camera type is invalid.