Hello all,<br><br>I am using vtkOBJExporter and vtkOBJReader to save and load .obj files of colored surfaces. This works well, except that when I load in a saved .obj file, all objects are white. How can I maintain the colors, as well as the objects' geometry, when I load in .obj files?<br>
<br>I save the files like so:<br> vtkOBJExporter* vtkExporter = vtkOBJExporter::New();<br> vtkExporter->SetRenderWindow(renderWindowName);<br> vtkExporter->SetFilePrefix(filename.c_str());<br> vtkExporter->Write();<br>
<br>And load files like so:<br> vtkOBJReader* vtkReader = vtkOBJReader::New();<br> vtkReader->SetFileName(filename.c_str());<br> vtkReader->Update(); // force the VTK pipeline to update<br> int nPoints = vtkReader->GetOutput()->GetNumberOfPoints();<br>
vtkContourNormals = vtkPolyDataNormals::New();<br> vtkContourNormals->SetInput(vtkReader->GetOutput());<br> vtkContourNormals->SetFeatureAngle(60.0);<br> vtkContourMapper = vtkPolyDataMapper::New();<br>
vtkContourMapper->SetInput(vtkContourNormals->GetOutput());<br> vtkContourMapper->ScalarVisibilityOff();<br> //Then visualize the data<br><br>Thanks,<br>Catherine