# Scene

The `Scene` class implements properties and methods to access the objects in a scene.

## Properties

This module exposes no properties.

## Methods

| Method       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `child`      | <p><code>child(name: string): SceneObjectBase</code></p><p>Returns a child object by name. An exception is thrown if the object isn't found.</p><p><strong>See Also</strong>: <code>SceneObjectBase.find</code>, <code>SceneModule.root</code>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `find`       | <p><code>find(name: string): SceneObjectBase</code></p><p>Returns a descendant object by name. An exception is thrown if the object isn't found or if more than one is found.</p><p><strong>Note</strong>: object D is considered to be a descendant of object P if either D is a child of P or if such an object C which is a child of P exists that D is a descendant of C.</p><p><strong>See Also</strong>: <code>SceneObjectBase.child</code>, <code>SceneModule.root</code>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `findAll`    | <p><code>findAll(name: string): Promise&#x3C;Array&#x3C;SceneObjectBase>> findAll(name: string, config:{ recursive: bool }): Promise&#x3C;Array&#x3C;SceneObjectBase>></code></p><p>Returns a promise that is resolved with the all of the scene objects with given name or empty array if none was found.</p><p><code>recursive</code> param of <code>config</code> controls whenever the find should be performed recursively (<code>true</code> by default). Empty array is returned in no objects are found.</p><p><strong>See Also</strong>: <code>SceneObjectBase.findFirst</code>, <code>SceneObjectBase.findByPath</code>, <code>SceneModule.root</code>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `findByPath` | <p><code>findByPath(pathQuery: string): Promise&#x3C;Array&#x3C;SceneObjectBase>> findByPath(pathQuery: string, config: {limit: number}): Promise&#x3C;Array&#x3C;SceneObjectBase>></code></p><p>Returns a promise that is resolved with the all occurances of scene objects matching the path query or empty array if none was found.</p><p>Path query format: <code>*</code> matches any characters sequence. <code>*</code> as standalone component matches one level of the scene tree (i.e. any child) <code>**</code> as standalone component matches any level of scene tree (will result in recursive find) <code>/</code> is a path component separator <code>\</code> can be used to include in component name any of the control characters (including '\' itself)</p><p>Examples: <code>findByPath("*")</code> will match all the direct children of the caller. <code>findByPath("*/A")</code> will match all grandchildren of the caller named A. <code>findByPath("**/A")</code> will match all descendants of the caller named A. <code>findByPath("A*")</code> will match all children of the caller which name is prefixed with 'A', like 'ABC'. <code>findByPath("**/*A*")</code> will match all descendants of the caller which name contains 'A', like 'AX' and 'XA'. <code>findByPath("**/A", {limit: 10})</code> will match at most first 10 descendants of the caller named A. <code>findByPath("\\*")</code> will match all children of the caller named *. <code>findByPath("\\\\")</code> will match all children of the caller named .</p><p><code>limit</code> parameter describes if <code>findByPath</code> should finish the search if it finds specified number of results (default is no limit). Non-positive values for limit are treated as unlimited.</p><p><strong>Note</strong>: object D is considered to be a descendant of object P if either D is a child of P or if such an object C which is a child of P exists that D is a descendant of C.</p><p><strong>See Also</strong>: <code>SceneObjectBase.findAll</code>, <code>SceneObjectBase.findFirst</code>, <code>SceneModule.root</code>.</p> |
| `findFirst`  | <p><code>findFirst(name: string): Promise&#x3C;SceneObjectBase> findFirst(name: string, config:{ recursive: bool }): Promise&#x3C;SceneObjectBase></code></p><p>Returns a promise that is resolved with the first occurance of scene object with given name or null if none was found. <code>recursive</code> param of <code>config</code> controls whenever the find should be performed recursively (<code>true</code> by default).</p><p><strong>See Also</strong>: <code>SceneObjectBase.findAll</code>, <code>SceneObjectBase.findByPath</code>, <code>SceneModule.root</code>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
