LensStudio:HierarchyUtils.js.findNearestCameraInAncestors
FunctionFinds the nearest camera in the ancestors of the given scene object.
findNearestCameraInAncestors(
baseSceneObject,cameraType?,maxDepth?):SceneObject
Finds the nearest camera in the ancestors of the given scene object.
Parameters
| Parameter | Type | Description |
|---|---|---|
baseSceneObject | SceneObject | The scene object from which to start the search. |
cameraType? | CameraType | The type of camera to search for (e.g., Orthographic, Perspective). Use null for any type. |
maxDepth? | number | Maximum search depth. Default is 1000. |
Returns
The nearest matching camera or null.