code: def load_mtl_file(filename):
      class mtl_file:
          def __init__(self, filename):
              self.material_param_map = {}
  
              material_name_curr = None
  
              print("[HYPERSIM: OBJ_FILE_UTILS] Begin load_mtl_file...")
              print(
                  "[HYPERSIM: OBJ_FILE_UTILS] Parsing "
                  + filename
                  + "..."
              )
  
              for line in open(filename, "r"):
                  line = line.strip()
  
                  # hack for OBJ files exported from Unreal
                  if line.startswith("#") or line.startswith(
                      "\xef\xbb\xbf#"
                  ):
                      continue
  
                  values = line.split()
  
                  if not values or len(values) == 0:
                      continue
  
                  if values[0] in ["newmtl", "newmat"]:
                      try:
                          material_name_curr = values[1]
                      except ValueError:
                          print(
                              "[HYPERSIM: OBJ_FILE_UTILS] ERROR: Couldn't parse: "
                              + values
                          )
                          material_name_curr = "ERROR MATERIAL"
                      self.material_param_map[material_name_curr] = {}
  
                  else:
                      material_param_key = values[0]
                      try:
                          material_param_values = " ".join(values[1:])
                      except ValueError:
                          print(
                              "[HYPERSIM: OBJ_FILE_UTILS] ERROR: Couldn't parse: "
                              + values
                          )
                          material_param_values = 0.0
                      self.material_param_map[material_name_curr][
                          material_param_key
                      ] = material_param_values
  
              print("[HYPERSIM: OBJ_FILE_UTILS] Finished.")
  
          def __repr__(self):
              _str = ""
              _str = (
                  _str
                  + "material_param_map\n"
                  + str(self.material_param_map)
                  + "\n"
              )
  
              return _str
  
      return mtl_file(filename)
  
imports: from pylab import *
  import os
  import pandas
label_desc: Use image node_id 1 for calling a global function with example usage: load_mtl_file(filename) and returns: mtl_file, _str