# Can't use the traverse function of a .drc file

**URL:** <https://discourse.threejs.org/t/cant-use-the-traverse-function-of-a-drc-file/5943>\
**Category:** Questions\
**Tags:** draco\
**Created:** [January 30, 2019, 9:39pm UTC](https://discourse.threejs.org/t/cant-use-the-traverse-function-of-a-drc-file/5943 "2019-01-30T21:39:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zenel\_bobi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/zenel_bobi/32/4027_2.png) [@zenel\_bobi](https://discourse.threejs.org/u/zenel_bobi)\
**Post date:** [January 30, 2019, 9:39pm UTC](https://discourse.threejs.org/t/cant-use-the-traverse-function-of-a-drc-file/5943/1 "2019-01-30T21:39:52Z")

</div>

Hi!

I want to apply textures to my .drc file but I am unable to do so. I cant se the traverse function.

So

```
dracoLoader.load( 'assets/model/model.drc', function ( mesh) {
    mesh.traverse( function ( child ) { <------ This will get me a error this error
 	console.log(child.name);                                                                          
 });                                                                                                          
      
      
Uncaught (in promise) TypeError: geometry.traverse is not a function
at script4.js:34
at THREE.DRACOLoader.decodeDracoFileInternal (DRACOLoader.js:139)
at DRACOLoader.js:108

```

I have tried to convert other models, but it is everytime the same error.  
Should I keep in mind something while exporting the model from 3ds Max or am I doing something wrong here?

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [January 31, 2019, 12:17am UTC](https://discourse.threejs.org/t/cant-use-the-traverse-function-of-a-drc-file/5943/2 "2019-01-31T00:17:06Z")

</div>

The draco loader returns a geometry and not a mesh – see this example: [https://github.com/mrdoob/three.js/blob/master/examples/webgl\_loader\_draco.html#L85-L98](https://github.com/mrdoob/three.js/blob/master/examples/webgl_loader_draco.html#L85-L98)

---

<div class="post-metadata">

**Author:** ![zenel\_bobi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/zenel_bobi/32/4027_2.png) [@zenel\_bobi](https://discourse.threejs.org/u/zenel_bobi)\
**Post date:** [January 31, 2019, 10:04am UTC](https://discourse.threejs.org/t/cant-use-the-traverse-function-of-a-drc-file/5943/3 "2019-01-31T10:04:51Z")

</div>

Thank you for the answer! 🙂

But now, how can i load multiple materials in one geometry? Is there a way? I tried to pass the materials as a array

geometry = new THREE.Mesh(obj, [material1, material2]);

But nothing shows up, not even the model

Thank you again

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [January 31, 2019, 4:14pm UTC](https://discourse.threejs.org/t/cant-use-the-traverse-function-of-a-drc-file/5943/4 "2019-01-31T16:14:40Z")

</div>

I don’t think Draco supports materials, except for vertex colors. You’ll need to use another format for that, like glTF or FBX. Draco compression can be used inside of a glTF file, see [https://threejs.org/docs/#examples/loaders/GLTFLoader](https://threejs.org/docs/#examples/loaders/GLTFLoader). There’s a glTF exporter for 3DS Max if you need it: [https://doc.babylonjs.com/resources/3dsmax\_to\_gltf](https://doc.babylonjs.com/resources/3dsmax_to_gltf)

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [January 31, 2019, 4:15pm UTC](https://discourse.threejs.org/t/cant-use-the-traverse-function-of-a-drc-file/5943/5 "2019-01-31T16:15:47Z")

</div>

Or have you created the materials yourself in code? It’s not quite clear what you’re asking if so.

---

<div class="post-metadata">

**Author:** ![looeee](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/looeee/32/59_2.png) [@looeee](https://discourse.threejs.org/u/looeee)\
**Post date:** [January 31, 2019, 5:36pm UTC](https://discourse.threejs.org/t/cant-use-the-traverse-function-of-a-drc-file/5943/6 "2019-01-31T17:36:05Z")

</div>

@zenel_bobi please show a complete code example that demonstrates your problem. Pasting in single lines is not enough to help you.
