def export_materials(self, pth):
        """ Exports a list of all materials found in the current scene in a
        serialized format to the given path """

        with open(pth, "w") as handle:
            for i, material in enumerate(Globals.render.find_all_materials()):
                if not material.has_base_color() or not material.has_roughness() or not material.has_refractive_index():
                    print("Skipping non-pbr material:", material.name)
                    continue

                handle.write(
                    ("{} " * 11).format(
                        self._get_serialized_material_name(material, i),
                        material.base_color.x,
                        material.base_color.y,
                        material.base_color.z,
                        material.roughness,
                        material.refractive_index,
                        material.metallic,
                        material.emission.x,  # shading model
                        material.emission.y,  # normal strength
                        material.emission.z,  # arbitrary 0
                        material.emission.w,  # arbitrary 1
                    ) + "\n"
                )
 Exports a list of all materials found in the current scene in a
        serialized format to the given path 
metadrive/render_pipeline/rpcore/render_pipeline.py