Three.js - mtlLoader materials

154 Views Asked by At
  mtlLoader.load('.mtl_file_path', function (materials) {
    materials.preload()

    console.log(materials.materials)

    objLoader.setMaterials(materials)

    objLoader.load('/resource/obj/mycar.obj', function (car) {
      do somthing
    })
  })

This is my code. I want to know my mtl's values. So, console.log(materials.materials)

console result is enter image description here

I can see in my brower console, but i don't know how can approach it on code.

I tried

console.log(materials.materials[0])
console.log(materials.materials{"midnight_blue"})
console.log(materials.materials.midnight_blue)
1

There are 1 best solutions below

1
On
materials.preload()
console.log(materials.materials.midnight_blue)