# Can I use the .getObjectByName method to target meshes that are grouped?

**URL:** <https://discourse.threejs.org/t/can-i-use-the-getobjectbyname-method-to-target-meshes-that-are-grouped/87976>\
**Category:** Questions\
**Created:** [November 6, 2025, 11:26pm UTC](https://discourse.threejs.org/t/can-i-use-the-getobjectbyname-method-to-target-meshes-that-are-grouped/87976 "2025-11-06T23:26:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grzesiek\_Rogala](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/grzesiek_rogala/32/57597_2.png) [@Grzesiek\_Rogala](https://discourse.threejs.org/u/Grzesiek_Rogala)\
**Post date:** [November 6, 2025, 11:26pm UTC](https://discourse.threejs.org/t/can-i-use-the-getobjectbyname-method-to-target-meshes-that-are-grouped/87976/1 "2025-11-06T23:26:15Z")

</div>

I have a very complex model created in blender and all the meshes are organised into groups (or empties) so the hierarchy looks like that:

 ![Screenshot 2025-11-06 at 23.01.19](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/2/0/20538eb6b0c2c3ed776999540ebd48eb64b68880.jpeg)

Can I still get individual meshes using the get .getObjectByName or do I have to get the group first and cycle through children to find the name.

Ungrouping that many meshes (over 60) will take me ages and also messes up the model so I would rather keep the hierarchy as is.

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![PavelBoytchev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/pavelboytchev/32/38639_2.png) [@PavelBoytchev](https://discourse.threejs.org/u/PavelBoytchev)\
**Post date:** [November 7, 2025, 7:59am UTC](https://discourse.threejs.org/t/can-i-use-the-getobjectbyname-method-to-target-meshes-that-are-grouped/87976/2 "2025-11-07T07:59:58Z")

</div>

According to the documentation, `getObjectByName` should traverse the object and its children. To have names, the model must be in a format that supports names. GLTF is such format. However, keep in mind that the names after loading the model in Three.js might differ from the names in Blender.

BTW you could make a quick experiment - export the model in GLTF/GLB, import it in Three.js, traverse recursively all nested objects and print their names. This would show whether names are existing and preserved, existing and nor preserved or not existing.

---

<div class="post-metadata">

**Author:** ![Grzesiek\_Rogala](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/grzesiek_rogala/32/57597_2.png) [@Grzesiek\_Rogala](https://discourse.threejs.org/u/Grzesiek_Rogala)\
**Post date:** [November 7, 2025, 9:34am UTC](https://discourse.threejs.org/t/can-i-use-the-getobjectbyname-method-to-target-meshes-that-are-grouped/87976/3 "2025-11-07T09:34:48Z")

</div>

Yeah I forgot to mention I plan to export the model as .glb

I will do a test to see if that works and report back soon. I think there would be a benefit in keeping these meshes grouped if I want to affect them in bulk but having individual control over single meshes is also useful.

---

<div class="post-metadata">

**Author:** ![Umbawa\_Sarosong](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/umbawa_sarosong/32/30107_2.png) [@Umbawa\_Sarosong](https://discourse.threejs.org/u/Umbawa_Sarosong)\
**Post date:** [November 7, 2025, 11:58am UTC](https://discourse.threejs.org/t/can-i-use-the-getobjectbyname-method-to-target-meshes-that-are-grouped/87976/4 "2025-11-07T11:58:25Z")

</div>

yes u can use `getObjectByName` but this method traverse the whole scene and if u have a scene that has too many assets or mesh in it would affect ur rendering performance, I suggest u index the assets u need to be looking for then search that index instead of using `getObjectByName` or `getObjectByProperty`.

---

<div class="post-metadata">

**Author:** ![Chaser\_Code](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/chaser_code/32/20199_2.png) [@Chaser\_Code](https://discourse.threejs.org/u/Chaser_Code)\
**Post date:** [November 7, 2025, 12:24pm UTC](https://discourse.threejs.org/t/can-i-use-the-getobjectbyname-method-to-target-meshes-that-are-grouped/87976/5 "2025-11-07T12:24:58Z")

</div>

```javascript
let mesh={};

model.traverse(function(child){
if(child.name){
mesh[child.name]=child;
}
});

mesh["Amygdala_L002"].position.x=5;
mesh["Cerebellum_R002"].position.z=1;

```

---

<div class="post-metadata">

**Author:** ![Grzesiek\_Rogala](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/grzesiek_rogala/32/57597_2.png) [@Grzesiek\_Rogala](https://discourse.threejs.org/u/Grzesiek_Rogala)\
**Post date:** [November 7, 2025, 3:35pm UTC](https://discourse.threejs.org/t/can-i-use-the-getobjectbyname-method-to-target-meshes-that-are-grouped/87976/6 "2025-11-07T15:35:24Z")

</div>

So after a few tests, using the `.getObjectByName` method works both the mesh and the group so if I want to transform a single mesh then target it by it’s name and if you want to transform a whole group then use the group name instead.

I like the above solutions too!

Thanks for your help!
