<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ks_c_5601-1987">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12.0pt; line-height:1.3; color:#1F497D">
<div>VTK's OBJ exporter can save solid color that is set in the actor's property and Blender can use that. Point scalar data could be exported to texture and probably Blender would use that, but that has not been implemented in VTK's OBJ exporter yet - contributions
 are welcome.<br>
<br>
VTK's PLY writer can write RGB point scalars and some software, for example MeshLab can display the colored model correctly. However, Blender ignores this color information (at least it does not show up when you simply import the file; maybe there are plug-ins
 or some settings that would fix this). MeshLab may be able to export the colored model into a format that Blender can read.
<br>
</div>
<div><br>
</div>
<div id="x_signature-x" class="x_signature_editor" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12.0pt; color:#1F497D">
Andras<br>
</div>
</div>
<div id="x_quoted_header" style="clear:both">
<hr style="border:none; height:1px; color:#E1E1E1; background-color:#E1E1E1">
<div style="border:none; padding:3.0pt 0cm 0cm 0cm"><span style="font-size:11.0pt; font-family:'Calibri','sans-serif'"><b>From:</b> kenichiro yoshimi <rccm.kyoshimi@gmail.com><br>
<b>Sent:</b> Saturday, December 8, 2018 5:01 AM<br>
<b>To:</b> rastor.ragereaver@gmail.com<br>
<b>Cc:</b> vtkusers@public.kitware.com<br>
<b>Subject:</b> Re: [vtkusers] Exporting RGB Polydata to .OBJ or .PLY<br>
</span></div>
</div>
<br type="attribution">
</div>
<font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi,<br>
<br>
You can use the vtkX3DExporter or vtkVRMLExporter to export VTK scene<br>
and render the meshes and colors in blender.<br>
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.vtk.org%2Fgitweb%3Fp%3DVTK.git%3Ba%3Dblob%3Bf%3DIO%2FExport%2FTesting%2FCxx%2FX3DTest.cxx&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=YaDsvSv7gjU5x3ilese0EXWFXXP%2FwfbM36CNGZFT2xM%3D&amp;reserved=0">https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.vtk.org%2Fgitweb%3Fp%3DVTK.git%3Ba%3Dblob%3Bf%3DIO%2FExport%2FTesting%2FCxx%2FX3DTest.cxx&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=YaDsvSv7gjU5x3ilese0EXWFXXP%2FwfbM36CNGZFT2xM%3D&amp;reserved=0</a><br>
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.vtk.org%2Fgitweb%3Fp%3DVTK.git%3Ba%3Dblob%3Bf%3DRendering%2FCore%2FTesting%2FPython%2Fcells.py&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=s3zn9M6VhL8ISVFAq6pXutgYLsC1tT4%2BQGOcuB%2F7%2Bgo%3D&amp;reserved=0">https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.vtk.org%2Fgitweb%3Fp%3DVTK.git%3Ba%3Dblob%3Bf%3DRendering%2FCore%2FTesting%2FPython%2Fcells.py&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=s3zn9M6VhL8ISVFAq6pXutgYLsC1tT4%2BQGOcuB%2F7%2Bgo%3D&amp;reserved=0</a><br>
<br>
Regards<br>
2018Ҵ127() 3:13 Radosaw Furmaniak <rastor.ragereaver@gmail.com>:<br>
><br>
> Hello,<br>
> I have set up PolyData and added 4 component scalar array to it. When I create PolyDataMapper, set scalar visibility and add actor to the scene, all colors are rendered properly.<br>
> However, I have a problem with exporting this scene or just the polydata to the .OBJ (+mtl) file or to the .PLY. When I open it up in Blender, geometry is exported correctly, however OBJ is created all white, and .PLY has a single, grayish color (apart from
 the shadows of course), which I don't think is even present in input PolyData.<br>
><br>
> I am trying to do it like this:<br>
><br>
> plyWriter = vtk.vtkPLYWriter()<br>
> plyWriter.SetInputData(polydata)<br>
> plyWriter.SetFileTypeToBinary()<br>
> plyWriter.SetDataByteOrderToLittleEndian()<br>
> plyWriter.SetArrayName("Scalars")<br>
> plyWriter.SetFileName("model.ply")<br>
> plyWriter.Write()<br>
><br>
> I have also tried setting up different color modes in plyWriter,<br>
>  but the results are always the same.<br>
><br>
> Scalar array is set up like this:<br>
><br>
> scalarArray = vtk.vtkDoubleArray()<br>
> scalarArray.SetNumberOfComponents(4)<br>
> scalarArray.SetName("Scalars")<br>
><br>
> polydata.GetPointData().AddArray(scalarArray)<br>
><br>
> polydata.GetPointData().SetActiveScalars("Scalars")<br>
><br>
> (I am omitting the part where I am actually setting elements of this array)<br>
><br>
> I have also tried using the OBJExporter:<br>
><br>
> writer = vtk.vtkOBJExporter()<br>
> writer.SetFilePrefix(output_prefix)<br>
> writer.SetInput(renWin)<br>
> writer.Write()<br>
><br>
> where renWin is rendering window with a single actor made from polydata mentioned above.<br>
><br>
> I am using Python 3.6 and VTK 8.1.1.<br>
><br>
> Any help how to export geometry and colors, so they can be reused in other programs?<br>
><br>
> Thanks in advance.<br>
><br>
> _______________________________________________<br>
> Powered by <a href="https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=PeaSVC7fX37vaEEQwDU9tjq%2FRKKkqqekeYXkr1xuvBA%3D&amp;reserved=0">
https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=PeaSVC7fX37vaEEQwDU9tjq%2FRKKkqqekeYXkr1xuvBA%3D&amp;reserved=0</a><br>
><br>
> Visit other Kitware open-source projects at <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=3RrDlN1d5fM25xQ9EsSRczIGHKV3dBkig4LeYNLuX%2B0%3D&amp;reserved=0">
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=3RrDlN1d5fM25xQ9EsSRczIGHKV3dBkig4LeYNLuX%2B0%3D&amp;reserved=0</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at: <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=Pmqn82Jp7%2FGZuwY6IZ5ipdL0qa8vlnHpqEar9fDkUjk%3D&amp;reserved=0">
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=Pmqn82Jp7%2FGZuwY6IZ5ipdL0qa8vlnHpqEar9fDkUjk%3D&amp;reserved=0</a><br>
><br>
> Search the list archives at: <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=B6DlpR1Z4bStYhDE4jPKthNVzS7f%2BWIkcl2roYr3Z9E%3D&amp;reserved=0">
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=B6DlpR1Z4bStYhDE4jPKthNVzS7f%2BWIkcl2roYr3Z9E%3D&amp;reserved=0</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=q5CzMjBx1OH7rByxI0E1gaDDKYSnHx292eNNVf9rcIQ%3D&amp;reserved=0">
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=q5CzMjBx1OH7rByxI0E1gaDDKYSnHx292eNNVf9rcIQ%3D&amp;reserved=0</a><br>
_______________________________________________<br>
Powered by <a href="https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=PeaSVC7fX37vaEEQwDU9tjq%2FRKKkqqekeYXkr1xuvBA%3D&amp;reserved=0">
https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=PeaSVC7fX37vaEEQwDU9tjq%2FRKKkqqekeYXkr1xuvBA%3D&amp;reserved=0</a><br>
<br>
Visit other Kitware open-source projects at <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=3RrDlN1d5fM25xQ9EsSRczIGHKV3dBkig4LeYNLuX%2B0%3D&amp;reserved=0">
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=3RrDlN1d5fM25xQ9EsSRczIGHKV3dBkig4LeYNLuX%2B0%3D&amp;reserved=0</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=Pmqn82Jp7%2FGZuwY6IZ5ipdL0qa8vlnHpqEar9fDkUjk%3D&amp;reserved=0">
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=Pmqn82Jp7%2FGZuwY6IZ5ipdL0qa8vlnHpqEar9fDkUjk%3D&amp;reserved=0</a><br>
<br>
Search the list archives at: <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=B6DlpR1Z4bStYhDE4jPKthNVzS7f%2BWIkcl2roYr3Z9E%3D&amp;reserved=0">
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=B6DlpR1Z4bStYhDE4jPKthNVzS7f%2BWIkcl2roYr3Z9E%3D&amp;reserved=0</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=q5CzMjBx1OH7rByxI0E1gaDDKYSnHx292eNNVf9rcIQ%3D&amp;reserved=0">https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&amp;data=02%7C01%7Classo%40queensu.ca%7C1e8d31503e08484147da08d65cf4124d%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636798600696862805&amp;sdata=q5CzMjBx1OH7rByxI0E1gaDDKYSnHx292eNNVf9rcIQ%3D&amp;reserved=0</a><br>
</div>
</span></font>
</body>
</html>