Export scene

Dear all,

Please forgive me if this question has been already answered, I could not find clear explanations in other threads.

I am currently working with a simple java-vtk window in which I do several things like set image background, create points, lines, surfaces etc.

I was wondering if there is a simple way to save everything from the scene to a file, with all properties like camera, point sizes, colors, array names, well everything. Then I could later import that file and keep on adding things.

I had a first try with VRML exporter/importer but some properties are lost in the process (array names for example). I was thinking maybe something similar to load state/save state used in Paraview.

Thank you for your help !

Hello, friend,

I think you’re better off by using the several subclasses of vtkDataWriter (https://vtk.org/doc/nightly/html/classvtkDataWriter.html) to save the objects into .vtk file format. You can restore them by using the matching vtkDataReader subclasses: https://vtk.org/doc/nightly/html/classvtkDataReader.html. Exporting to other formats often results in some loss due to unsupported features.

cheers,

Paulo

Thank you Paolo, I will have a look :slight_smile: