find

find

Source:

Find the first node with the given validator. By default, the first argument accepts a string that is used to find the first node with the matching name value. For more advanced queries, you can provide a function to validate any property to find the desired node.

The second argument is an option argument where you can specify the parent node to search down the all children nodes. By default, it will search from the top of the THREE.js scene across all nodes.

Example

// returns the first node with the `name` being `Cube_1`
$$$.find('Cube_1');

// returns the first node with the `name` being `Cube_1`
$$$.find(node => node.name === 'Cube_1');

// returns the first node with geometry type being 'PlaneBufferGeometry'
$$$.find(node => node.geometry.type === 'PlaneBufferGeometry');