# ParaView failed to open OBJ with Texture

**URL:** https://discourse.paraview.org/t/paraview-failed-to-open-obj-with-texture/7547
**Category:** ParaView Support
**Created:** [July 5, 2021, 2:04am UTC](https://discourse.paraview.org/t/paraview-failed-to-open-obj-with-texture/7547 "2021-07-05T02:04:20Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jhz](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/c5a1d2/32.png) [@jhz](https://discourse.paraview.org/u/jhz)
#### Post date: [July 5, 2021, 2:04am UTC](https://discourse.paraview.org/t/paraview-failed-to-open-obj-with-texture/7547/1 "2021-07-05T02:04:20Z")

</div>

Hello, I am trying to import an obj with texture to ParaView GUI. I followed [this](https://discourse.paraview.org/t/show-obj-with-mtl/2932/2) thread and created ParaView state file (pvsm) by running the python script in pvpython. When I run this script, it creates some vtp and json files in a directory without any error. However, when I load pvsm file from the ParaView menu File\>Load State, it gives me the following error and does not show anything in the viewer.

```auto
 Error opening file cylinder/defdbee1c07e59125e204acc1b670839.vtp
ERROR: In /home/runner/work/ttk-paraview/ttk-paraview/VTK/IO/XML/vtkXMLReader.cxx, line 303
vtkXMLPolyDataReader (0x56020fd5e4b0): Error opening file cylinder/defdbee1c07e59125e204acc1b670839.vtp

 Reader cannot read file img.png
ERROR: In /home/runner/work/ttk-paraview/ttk-paraview/VTKExtensions/FiltersRendering/vtkNetworkImageSource.cxx, line 147
vtkNetworkImageSource (0x56020effee90): Reader cannot read file img.png

 Error opening file cylinder/defdbee1c07e59125e204acc1b670839.vtp
 ERROR: In /home/runner/work/ttk-paraview/ttk-paraview/VTK/IO/XML/vtkXMLReader.cxx, line 303
 vtkXMLPolyDataReader (0x56020fd5e4b0): Error opening file 
 cylinder/defdbee1c07e59125e204acc1b670839.vtp

  Algorithm vtkFileSeriesReader(0x56020ff8a370) returned failure for request: vtkInformation (0x56020dc30f40) Debug: Off Modified Time: 1200397 Reference Count: 1 Registered Events: (none) Request: REQUEST_DATA FROM_OUTPUT_PORT: 0 ALGORITHM_AFTER_FORWARD: 1 FORWARD_DIRECTION: 0

 Algorithm vtkPVGeometryFilter(0x56020feb9e50) returned failure for request: vtkInformation (0x56020effaca0) Debug: Off Modified Time: 1200449 Reference Count: 1 Registered Events: (none) Request: REQUEST_DATA_OBJECT FROM_OUTPUT_PORT: 0 ALGORITHM_AFTER_FORWARD: 1 FORWARD_DIRECTION: 0

```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 5, 2021, 7:26am UTC](https://discourse.paraview.org/t/paraview-failed-to-open-obj-with-texture/7547/2 "2021-07-05T07:26:25Z")

</div>

Not sure why but these paths should be absolute, not relative. Can you check if they are absolute in the .pvsm file ?

---

<div class="post-metadata">

### Author: ![jhz](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/c5a1d2/32.png) [@jhz](https://discourse.paraview.org/u/jhz)
#### Post date: [July 5, 2021, 10:06am UTC](https://discourse.paraview.org/t/paraview-failed-to-open-obj-with-texture/7547/3 "2021-07-05T10:06:12Z")

</div>

The paths look relative to me in .pvsm file. I am uploading the .pvsm file as well, please correct me on what I am doing wrong.

---

<div class="post-metadata">

### Author: ![jhz](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/c5a1d2/32.png) [@jhz](https://discourse.paraview.org/u/jhz)
#### Post date: [July 5, 2021, 10:15am UTC](https://discourse.paraview.org/t/paraview-failed-to-open-obj-with-texture/7547/4 "2021-07-05T10:15:58Z")

</div>

Here are my test files to reproduce the error.  
[cylinder.zip](https://discourse.paraview.org/uploads/short-url/nY3z0fgB0gFkuLMHl3QQykzxRhG.zip) (340.9 KB)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 5, 2021, 2:50pm UTC](https://discourse.paraview.org/t/paraview-failed-to-open-obj-with-texture/7547/5 "2021-07-05T14:50:56Z")

</div>

Your statefile should contain absolute path, not relative path. How do you generate it ?

---

<div class="post-metadata">

### Author: ![jhz](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/c5a1d2/32.png) [@jhz](https://discourse.paraview.org/u/jhz)
#### Post date: [July 5, 2021, 2:59pm UTC](https://discourse.paraview.org/t/paraview-failed-to-open-obj-with-texture/7547/6 "2021-07-05T14:59:21Z")

</div>

First, I run [obj-mtl-importer.py](https://github.com/Kitware/vtk-js/blob/master/Utilities/ParaView/obj-mtl-importer.py) on my .obj file in pvpython which generates .pvsm state file and .json file along with .vtp files. Next, I have also tried [apply-materials.py](https://github.com/Kitware/vtk-js/blob/master/Utilities/ParaView/apply-materials.py) by running it in ParaView and applying applyMaterialToRepresentation(’/path/to/representations.json’) function.  
Furthermore, I have tried editing .pvsm state file and manually adding absolute paths. Now I don’t see errors on import but there is nothing in the viewer but changes its color to white.  
Please refer to the image below.

 ![paraview](https://discourse.paraview.org/uploads/default/original/2X/e/e01e7cb8d0739158714fa83c00dde19669113b34.png)

**EDIT:**  
If I apply some filter on the imported file, then it shows me 3D object in the viewer but without texture. If I change coloring option from the properties panel to TextureCoordinates, it shows me magnitude color and not the original color/texture of the object.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 5, 2021, 3:11pm UTC](https://discourse.paraview.org/t/paraview-failed-to-open-obj-with-texture/7547/7 "2021-07-05T15:11:43Z")

</div>

So I guess this is a @jourdain question

---

<div class="post-metadata">

### Author: ![jhz](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/c5a1d2/32.png) [@jhz](https://discourse.paraview.org/u/jhz)
#### Post date: [July 5, 2021, 3:17pm UTC](https://discourse.paraview.org/t/paraview-failed-to-open-obj-with-texture/7547/8 "2021-07-05T15:17:29Z")

</div>

Thank you very much @mwestphal for your attention. I hope someone will help me out with this.
