From 60feb96afdf62b9be069e56d4b76aa61ec704921 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 9 Mar 2019 00:40:50 +0100 Subject: [PATCH] let vtk decide on the file extension --- processing/post/vtk_addGridData.py | 3 +-- processing/post/vtk_addPointCloudData.py | 3 +-- processing/post/vtk_addRectilinearGridData.py | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/processing/post/vtk_addGridData.py b/processing/post/vtk_addGridData.py index 34f01e7bf..5ed50b60e 100755 --- a/processing/post/vtk_addGridData.py +++ b/processing/post/vtk_addGridData.py @@ -67,7 +67,6 @@ elif vtk_ext == '.vtk': reader.Update() rGrid = reader.GetRectilinearGridOutput() writer = vtk.vtkXMLRectilinearGridWriter() - vtk_ext = '.vtr' elif vtk_ext == '.vtu': reader = vtk.vtkXMLUnstructuredGridReader() reader.SetFileName(options.vtk) @@ -77,7 +76,7 @@ elif vtk_ext == '.vtu': else: parser.error('Unsupported VTK file type extension.') -writer.SetFileName(vtk_file+vtk_ext) +writer.SetFileName(vtk_file+'.'+writer.GetDefaultFileExtension()) Npoints = rGrid.GetNumberOfPoints() Ncells = rGrid.GetNumberOfCells() diff --git a/processing/post/vtk_addPointCloudData.py b/processing/post/vtk_addPointCloudData.py index 0a1cb1231..f37def80a 100755 --- a/processing/post/vtk_addPointCloudData.py +++ b/processing/post/vtk_addPointCloudData.py @@ -61,7 +61,6 @@ elif vtk_ext == '.vtk': reader.SetFileName(options.vtk) reader.Update() Polydata = reader.GetPolyDataOutput() - vtk_ext = '.vtp' else: parser.error('unsupported VTK file type extension.') @@ -152,7 +151,7 @@ for name in filenames: writer = vtk.vtkXMLPolyDataWriter() writer.SetDataModeToBinary() writer.SetCompressorTypeToZLib() - writer.SetFileName(vtk_file+vtk_ext) + writer.SetFileName(vtk_file+'.'+writer.GetDefaultFileExtension()) writer.SetInputData(Polydata) writer.Write() diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index 868fdc387..890b28fa8 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -64,7 +64,6 @@ elif vtk_ext == '.vtk': reader.SetFileName(options.vtk) reader.Update() rGrid = reader.GetRectilinearGridOutput() - vtk_ext = '.vtr' else: parser.error('unsupported VTK file type extension.') @@ -161,7 +160,7 @@ for name in filenames: writer = vtk.vtkXMLRectilinearGridWriter() writer.SetDataModeToBinary() writer.SetCompressorTypeToZLib() - writer.SetFileName(vtk_file+vtk_ext) + writer.SetFileName(vtk_file+'.'+writer.GetDefaultFileExtension()) writer.SetInputData(rGrid) writer.Write()