Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object3D: Added getObjectsByProperty() #25006

Merged
merged 8 commits into from
Dec 21, 2022
Merged

Object3D: Added getObjectsByProperty() #25006

merged 8 commits into from
Dec 21, 2022

Conversation

ANFADEV
Copy link
Contributor

@ANFADEV ANFADEV commented Nov 23, 2022

Description

A clear and concise description of what the problem was and how this pull request solves it.

Problem:

Sometimes, as it's common when using a 3D engine, a programmer would want to select all Objects with a property,
The function that would allow to do so, doesn't currently exists in Three.js, so developers will need to re-implement this basic function each time they want to do so.

Solution:

A recursive version of the Object3D.getObjectByProperty() function, named getAllObjectsByProperty
that gives all matching objects, instead of just the first.

Updated documentation ✔
Linting✔
Test passed✔

@Mugen87 Mugen87 changed the title Get multiple child objects by property Object3D: Get multiple child objects by property. Nov 23, 2022
src/core/Object3D.js Outdated Show resolved Hide resolved
@mrdoob mrdoob changed the title Object3D: Get multiple child objects by property. Object3D: Added getObjectsByProperty() Dec 21, 2022
@mrdoob mrdoob added this to the r148 milestone Dec 21, 2022
@mrdoob mrdoob merged commit 768ea93 into mrdoob:dev Dec 21, 2022
@0b5vr 0b5vr mentioned this pull request Dec 23, 2022
10 tasks
0b5vr added a commit to three-types/three-ts-types that referenced this pull request Dec 27, 2022
- add `Object3D.getObjectsByProperty()`
- add doc comment of `Object3D.getObjectByProperty()`

See: mrdoob/three.js#25006
joshuaellis added a commit to three-types/three-ts-types that referenced this pull request Jan 3, 2023
* docs: update constructor doc comment of geometries

See: mrdoob/three.js#25086

* docs: update doc comment of the constructor of BufferAttribute

See: mrdoob/three.js#25046

the `normalized` was already optional in the typedef

* feat: add TwoPassDoubleSide

See: mrdoob/three.js#25165

also add doc comment of Side

* feat: add `Mesh.getVertexPosition()`

- add `Mesh.getVertexPosition()`
- add doc comment of `SceneUtils.reduceVertices`

See: mrdoob/three.js#25049

* feat: add `Object3D.getObjectsByProperty()`

- add `Object3D.getObjectsByProperty()`
- add doc comment of `Object3D.getObjectByProperty()`

See: mrdoob/three.js#25006

* docs: add a doc comment of `PointLight.castShadow`

See: mrdoob/three.js#25136

* feat (GLTFLoader): add loadNode hook

See: mrdoob/three.js#25077

* feat (Nodes): New features and revisions

- add three new nodes: `CacheNode`, `StackNode`, and `SpecularMIPLevelNode`
- add `NodeCache`
- add `getDefaultUV()` to `CubeTextureNode` and `TextureNode`
- add `isGlobal()` to `Node`
- add `cache` and `globalCache` to `NodeBuilder`
- add missing `flowsData` to `NodeBuilder`
- add `hasDependencies` to `TempNode`
- add `maxMipLevel` and `cache` to `ShaderNodeBaseElements`
- replace `maxMipLevel` -> `specularMIPLevel` of `ShaderNodeElements`
- change constructor type and texture type of `MaxMipLevelNode`
- add `SpecularMIPLevelNode`

* feat (Nodes): add FogExp2 node

Co-authored-by: Josh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants