how to use vtkJSONSceneExporter to export data to a json file and some .gz compressed files

I used vtkJSONSceneExporter in vtk c++ library to export data. And the whole codes are below:


vtkSmartPointer exporter =
vtkSmartPointer::New();
exporter->SetFileName("./Scenes");
exporter->SetInput(m_renderWindow);
exporter->SetActiveRenderer(m_renderer);
exporter->Write();


But in the end, only a json file was generated in “./Scenes” directory, and no .gz compressed file was exported. The picture down below showed that.

And the json file contained no scene and lookupTables information, just like down below:
345

So, did I forget some key codes when exporting? Or, was there any additional steps when using vtkJSONSceneExporter?

Looking forward to your reply and any reply will be highly appreciated!!!
Thank you very much.

If you don’t have anything in your renderer, you are indeed getting the right thing.

The c++ exporter is missing the last bundle/zip action which as been left to some python helper that is available here.

That helper script also allow you to bundle the scene export along with the ParaViewGlance viewer.

That new exporter can be used inside ParaView/master where it has been integrated.

I had a similar problem when dealing with vtkUnstructuredGrid. processing it into vtkPolyData (extract_surface) solved the issue.