LensStudio:HierarchyUtils.js.getNearestOrFirstCamera
FunctionFinds the nearest camera ancestor of a scene object, if one exists.
getNearestOrFirstCamera(
sceneObject,scene,cameraType?):SceneObject
Finds the nearest camera ancestor of a scene object, if one exists. if not, it returns the first camera in the scene.
Parameters
| Parameter | Type | Description |
|---|---|---|
sceneObject | SceneObject | The scene object to search for orthographic camera ancestors. |
scene | Scene | - |
cameraType? | CameraType | The type of camera to search for, or null to find any camera. |
Returns
The nearest camera ancestor of the scene object, or null if none is found.