# Ospray material library from python

**URL:** https://discourse.vtk.org/t/ospray-material-library-from-python/2459
**Category:** Support
**Created:** [January 20, 2020, 7:17am UTC](https://discourse.vtk.org/t/ospray-material-library-from-python/2459 "2020-01-20T07:17:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gilcu2](https://discourse.vtk.org/user_avatar/discourse.vtk.org/gilcu2/32/1108_2.png) [@gilcu2](https://discourse.vtk.org/u/gilcu2)
#### Post date: [January 20, 2020, 7:17am UTC](https://discourse.vtk.org/t/ospray-material-library-from-python/2459/1 "2020-01-20T07:17:41Z")

</div>

Hello, I am trying to load an mtl file from python following the C++ code like this:

```
        import vtkmodules.vtkRenderingRayTracing as vtkrt

        osprayMtlLibrary = vtkrt.vtkOSPRayMaterialLibrary()
        osprayMtlLibrary.ReadFile('../data/vase.mtl');
        materialNames=osprayMtlLibrary.GetMaterialNames()
        print(materialNames)

```

but like that GetMaterialNames is not exported to python. I get:

AttributeError: ‘vtkmodules.vtkRenderingRayTracing.vtkOSPRayMateria’ object has no attribute ‘GetMaterialNames’

How can I get the material names from Python?  
Thanks

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [March 16, 2020, 3:48pm UTC](https://discourse.vtk.org/t/ospray-material-library-from-python/2459/2 "2020-03-16T15:48:58Z")

</div>

@dgobbi The `GetMaterialNames()` method returns a `std::set<std::string>`. Does the Python wrapper need to learn how to handle `std::set` for this?
