Error when exporting vtkjs with paraviewGlance html

Hi,

When exporting a scene from ParaView for use with ParaView Glance I seem to be running into trouble. My workflow is:
exportScene > “name”.vtkjs > click cog and select paraviewGlance HTML (save textures had both on & off)

I get the error with:

  • Both Paraview Version 5.8.0 and the nightly build v5.8.0-680-g92ad34aa43
  • Paraview Glance npm version 4.9.4
  • Have reproduced on 2 different machines
Generic Warning: In C:\bbd\ecd3383f\build\superbuild\paraview\src\Remoting\Export\vtkPVWebExporter.cxx, line 97
Failed to bundle vtkjs data file into HTML viewer

Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.8.0-Windows-Python3.7-msvc2015-64bit\bin\Lib\site-packages\vtkmodules\web\vtkjs_helper.py", line 50, in addDataToViewer
    for line in srcHtml:
  File "C:\Program Files\ParaView 5.8.0-Windows-Python3.7-msvc2015-64bit\bin\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1032: character maps to <undefined>

A vtkjs file is produced which can be loaded into ParaView Glance and this seems to work fine. The HTML file is also produced, but this does not render in chrome or firefox.

Is there any way to fix this, or an update I need to do?

When exporting without link to HTML is fine. Although, all of the pipelines in the view set their visibility to on which is a bit of a pain (any way to remedy this would also be appreciated)

Many thanks for any help you can give :slight_smile:

My guess it is a small glitch that is specific to Python 3. The code should be fixable on your side.

Try editing the file "C:\Program Files\ParaView 5.8.0-Windows-Python3.7-msvc2015-64bit\bin\Lib\site-packages\vtkmodules\web\vtkjs_helper.py" by adding the encoding argument like below.

# Create new output file
with open(srcHtmlPath, mode='r', encoding="utf-8") as srcHtml:
   with open(dstHtmlPath, mode='w', encoding="utf-8") as dstHtml:

Please let me know if that fixed the issue for you.
Thanks,

Seb

Thanks! That worked. Had to open files admin, but it worked :slight_smile:

1 Like

Hi,

I am using using ParaView 5.8.1-Windows-Python3.7-msvc2015-64bit and I am facing a similar problem when I try to export scene as .vtkjs with or without the link to .html file.

It works with Paraview v.5.7.0

the error message is:

Generic Warning: In C:\bbd\8fbebceb\build\superbuild\paraview\src\Remoting\Export\vtkPVWebExporter.cxx, line 63
Failed to import paraview.web.vtkjs_helper module.

Traceback (most recent call last):
File “C:\Program Files\ParaView 5.8.1-Windows-Python3.7-msvc2015-64bit\bin\Lib\site-packages\paraview\web\vtkjs_helper.py”, line 1, in
from paraview import simple
File “C:\Program Files\ParaView 5.8.1-Windows-Python3.7-msvc2015-64bit\bin\Lib\site-packages\paraview\simple.py”, line 41, in
from paraview import servermanager
File “C:\Program Files\ParaView 5.8.1-Windows-Python3.7-msvc2015-64bit\bin\Lib\site-packages\paraview\servermanager.py”, line 3374, in
__initialize()
File “C:\Program Files\ParaView 5.8.1-Windows-Python3.7-msvc2015-64bit\bin\Lib\site-packages\paraview\servermanager.py”, line 3365, in __initialize
c = Connection(iter.GetCurrentSessionId(), iter.GetCurrentSession())
File “C:\Program Files\ParaView 5.8.1-Windows-Python3.7-msvc2015-64bit\bin\Lib\site-packages\paraview\servermanager.py”, line 2039, in init
_createModules(self.Modules)
File “C:\Program Files\ParaView 5.8.1-Windows-Python3.7-msvc2015-64bit\bin\Lib\site-packages\paraview\servermanager.py”, line 2712, in _createModules
m.filters = createModule(‘filters’)
File “C:\Program Files\ParaView 5.8.1-Windows-Python3.7-msvc2015-64bit\bin\Lib\site-packages\paraview\servermanager.py”, line 2815, in createModule
cobj = _createClass(groupName, proxyName, apxm=pxm)
File “C:\Program Files\ParaView 5.8.1-Windows-Python3.7-msvc2015-64bit\bin\Lib\site-packages\paraview\servermanager.py”, line 2759, in _createClass
if (prop.GetInformationOnly() and propName != “TimestepValues”
AttributeError: ‘NoneType’ object has no attribute ‘GetInformationOnly’

Can you please help?

Kind Regards,

RC

Hum, it looks like you might be running into some issue with some time handling via your dataset. I’m not sure why.

Just out of curiosity, what do you get with ParaView 5.9?

Is it a simple scene that you export? Is it always happening regardless the content of the scene? Any additional information would be great.

Thanks,

Seb

Hi,

Thanks for the support. There’s nothing special about the dataset. It corresponds to a steady case simulation results and I selected some fields like temperature and velocity to be exported to the .html file.

The error message doesn’t show up with Paraview 5.9 (exactly the same state file). I was able to export and visualize the data.

RC

I’m glad that is working with 5.9. I’m not sure what is happening with 5.8.1. Thanks for reporting the issue though.

One last question, what is the most appropriate/last html file to use in the exporting process?

Something interesting happened, if I use an old version of the html file I can visualize correctly the data (ParaViewGlance.html) but I use the a version I downloaded today I cannot visualize my dataset on the browser (ParaViewGlance1.html).

Do you know the reason for that or am I missing something?

ParaViewGlance.html (3.3 MB) ParaViewGlance1.zip (1.9 MB)

1 Like

There is work in progress to handle time dataset (animation) and right now Glance and PV are not in sync with the capabilities. (That is my guess)

In general, you should use the Glance that is bundled with ParaView.

FYI @Forrest_Li and @Adrien_Boucaud

@rcarneiro could you share the vtkjs instead? That way I’ll be able to test it across various version of Glance.

It works better, indeed.

thanks

Hum, I was able to load your vtkjs file on all the Glance viewers version (pv-5.9 Glance 4.4.2, Glance 4.9.4 and Glance 4.15.0)

What is the issue that you are seeing?

the errors are:

I saw those errors but it seems that the application is fine. It is just that you may have some color map with no scalar range.

As far as I can tell, the application behave the way it is expected regardless of those errors.

Could you share some details on animation support? I can’t find anything in docs or elsewhere on the forum.

Thanks this fixed my problem also!

https://www.kitware.com/export-paraview-animations-to-paraview-glance-2/