Skip to main content

LensStudio:HierarchyUtils.js.findInAncestorsByType

Function

Finds a scene object or an array of scene objects in the ancestors of a given base scene object by the specified component type.

findInAncestorsByType(base, componentType, options?): SceneObject[]

Finds a scene object or an array of scene objects in the ancestors of a given base scene object by the specified component type.

Parameters

ParameterTypeDescription
baseSceneObjectThe base scene object from which to start the search.
componentTypekeyof ComponentNameMapThe type of component to search for.
options?SearchOptionsOptional search options.

Returns

SceneObject[]

An array of found scene objects, or null if not found.