<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Dave,<o:p></o:p></p>
<p class="MsoNormal">Would this be a good set of scripts to put in our brand new, squeeky clean Tips and Tricks section of Discourse?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><a href="https://discourse.paraview.org/">https://discourse.paraview.org/</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Alan<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><b>From:</b> ParaView [mailto:paraview-bounces@public.kitware.com]
<b>On Behalf Of </b>David E DeMarle<br>
<b>Sent:</b> Tuesday, May 22, 2018 12:10 PM<br>
<b>To:</b> Jonathan Borduas <jonathan.borduas@caboma.com><br>
<b>Cc:</b> paraview@public.kitware.com<br>
<b>Subject:</b> [EXTERNAL] Re: [Paraview] OSPRay textures and materials mapping<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in">And here is a python schell script to make step 4 (create the lookuptable) automatic.<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;white-space:pre-wrap">
<span style="font-size:9.0pt;font-family:Courier;color:black">apartment = FindSource("sample_apartment.obj")</span><o:p></o:p></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;white-space:pre-wrap">
<span style="font-size:9.0pt;font-family:Courier;color:black">vtklevel = apartment.GetClientSideObject()</span><o:p></o:p></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;white-space:pre-wrap">
<span style="font-size:9.0pt;font-family:Courier;color:black">lut = GetColorTransferFunction('MaterialIds')</span><o:p></o:p></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;white-space:pre-wrap">
<span style="font-size:9.0pt;font-family:Courier;color:black">arr = vtklevel.GetOutput().GetFieldData().GetAbstractArray(0)</span><o:p></o:p></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;white-space:pre-wrap">
<span style="font-size:9.0pt;font-family:Courier;color:black">lut.InterpretValuesAsCategories = 1</span><o:p></o:p></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;white-space:pre-wrap">
<span style="font-size:9.0pt;font-family:Courier;color:black">ll = []</span><o:p></o:p></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;white-space:pre-wrap">
<span style="font-size:9.0pt;font-family:Courier;color:black">for x in range(0, arr.GetNumberOfTuples()):</span><o:p></o:p></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;white-space:pre-wrap">
<span style="font-size:9.0pt;font-family:Courier;color:black">ll.append(str(x))</span><o:p></o:p></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;white-space:pre-wrap">
<span style="font-size:9.0pt;font-family:Courier;color:black">ll.append(arr.GetValue(x))</span><o:p></o:p></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;white-space:pre-wrap">
<span style="font-size:9.0pt;font-family:Courier;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in">David E DeMarle<br>
Kitware, Inc.<br>
Principal Engineer<br>
21 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: 518-881-4909<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in">On Tue, May 22, 2018 at 1:51 PM, David E DeMarle <<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in">On Tue, May 22, 2018 at 12:34 PM, David E DeMarle <<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in">On Tue, May 22, 2018 at 10:34 AM, Jonathan Borduas <<a href="mailto:jonathan.borduas@caboma.com" target="_blank">jonathan.borduas@caboma.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt;margin-left:.5in">
Hi David, <br>
<br>
I was able to complete all the steps. As you probably know, the step four was tedious.
<br>
<br>
However I couldn’t get the result I wanted since I couldn’t assign the right textures to the right areas. Is there a mechanism to assign the texture just like we assign materials ?<br>
I guess this is what you mean by “multi-texture isn’t implemented yet”. I could probably extract all objects using a connectivity filter and then manually assign the textures, but again it is a tedious process for complex objects.
<o:p></o:p></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Better to do it in the code. We read in all of the texture coordinates when we read the .obj and all of the texture files when we read the .mtl -> we just aren't using the right set of texture coordinates in all
cases yet. That is most of what I mean by multitexture.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
Is there a roadmap as to when the multi-texture could be implemented ?<o:p></o:p></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">I'm hoping for 5.6 in a couple of months time. Although this is important it may very well slip because of other priorities.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><br>
In the meantime, this python programmable filter is a workaround.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<pre style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt">pdi <span style="color:#666666">=</span> <span style="color:green">self</span><span style="color:#666666">.</span>GetInput()<o:p></o:p></pre>
<pre style="margin-left:.5in">pdo <span style="color:#666666">=</span> <span style="color:green">self</span><span style="color:#666666">.</span>GetOutput()<o:p></o:p></pre>
<pre style="margin-left:.5in">pdo<span style="color:#666666">.</span>ShallowCopy(pdi)<o:p></o:p></pre>
<pre style="margin-left:.5in"><o:p> </o:p></pre>
<pre style="margin-left:.5in">arraynames <span style="color:#666666">=</span> []<o:p></o:p></pre>
<pre style="margin-left:.5in">arrays <span style="color:#666666">=</span> {}<o:p></o:p></pre>
<pre style="margin-left:.5in"><b><span style="color:green">for</span></b> a <b><span style="color:#AA22FF">in</span></b> <span style="color:green">range</span>(<span style="color:#666666">0</span>,pdi<span style="color:#666666">.</span>GetPointData()<span style="color:#666666">.</span>GetNumberOfArrays()):<o:p></o:p></pre>
<pre style="margin-left:.5in"> array <span style="color:#666666">=</span> pdi<span style="color:#666666">.</span>GetPointData()<span style="color:#666666">.</span>GetArray(a)<o:p></o:p></pre>
<pre style="margin-left:.5in"> <b><span style="color:green">if</span></b> array<span style="color:#666666">.</span>GetNumberOfComponents() <span style="color:#666666">!=</span> <span style="color:#666666">2</span>:<o:p></o:p></pre>
<pre style="margin-left:.5in"> <b><span style="color:green">continue</span></b><o:p></o:p></pre>
<pre style="margin-left:.5in"> arrname <span style="color:#666666">=</span> array<span style="color:#666666">.</span>GetName()<o:p></o:p></pre>
<pre style="margin-left:.5in"> pdo<span style="color:#666666">.</span>GetPointData()<span style="color:#666666">.</span>RemoveArray(arrname)<o:p></o:p></pre>
<pre style="margin-left:.5in"> arraynames<span style="color:#666666">.</span>append(arrname)<o:p></o:p></pre>
<pre style="margin-left:.5in"> arrays[arrname] <span style="color:#666666">=</span> array<o:p></o:p></pre>
<pre style="margin-left:.5in"><o:p> </o:p></pre>
<pre style="margin-left:.5in">tcoords <span style="color:#666666">=</span> vtk<span style="color:#666666">.</span>vtkFloatArray()<o:p></o:p></pre>
<pre style="margin-left:.5in">tcoords<span style="color:#666666">.</span>SetName(<span style="color:#BA2121">"TCoords"</span>)<o:p></o:p></pre>
<pre style="margin-left:.5in">tcoords<span style="color:#666666">.</span>SetNumberOfComponents(<span style="color:#666666">2</span>)<o:p></o:p></pre>
<pre style="margin-left:.5in">pdo<span style="color:#666666">.</span>GetPointData()<span style="color:#666666">.</span>SetTCoords(tcoords)<o:p></o:p></pre>
<pre style="margin-left:.5in"># todo numpy this to make it 100x faster<o:p></o:p></pre>
<pre style="margin-left:.5in"><b><span style="color:green">for</span></b> p <b><span style="color:#AA22FF">in</span></b> <span style="color:green">range</span>(<span style="color:#666666">0</span>, pdi<span style="color:#666666">.</span>GetNumberOfPoints()):<o:p></o:p></pre>
<pre style="margin-left:.5in"> tcoord <span style="color:#666666">=</span> [<span style="color:#666666">0</span>,<span style="color:#666666">0</span>]<o:p></o:p></pre>
<pre style="margin-left:.5in"> <b><span style="color:green">for</span></b> arrname <b><span style="color:#AA22FF">in</span></b> arrays:<o:p></o:p></pre>
<pre style="margin-left:.5in"> candidate <span style="color:#666666">=</span> arrays[arrname]<span style="color:#666666">.</span>GetTuple2(p)<o:p></o:p></pre>
<pre style="margin-left:.5in"> <b><span style="color:green">if</span></b> candidate[<span style="color:#666666">0</span>] <span style="color:#666666">==</span> <span style="color:#666666">-1</span> <b><span style="color:#AA22FF">and</span></b> candidate[<span style="color:#666666">1</span>] <span style="color:#666666">==</span> <span style="color:#666666">-1</span>:<o:p></o:p></pre>
<pre style="margin-left:.5in"> <b><span style="color:green">continue</span></b><o:p></o:p></pre>
<pre style="margin-left:.5in"> tcoord <span style="color:#666666">=</span> candidate<o:p></o:p></pre>
<pre style="margin-left:.5in"> tcoords<span style="color:#666666">.</span>InsertNextTuple2(tcoord[<span style="color:#666666">0</span>],tcoord[<span style="color:#666666">1</span>])<o:p></o:p></pre>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
It would be great to have readers that can load texture/Geometry/Materials files such as .obj (.mtl and .png), .fbx and .dwg.
<o:p></o:p></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Agreed.<o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
Best regards,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
Jonathan Borduas<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<b>From:</b> David E DeMarle <<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>>
<br>
<b>Sent:</b> Friday, May 18, 2018 10:58 AM<br>
<b>To:</b> Jonathan Borduas <<a href="mailto:jonathan.borduas@caboma.com" target="_blank">jonathan.borduas@caboma.com</a>><br>
<b>Cc:</b> <a href="mailto:paraview@public.kitware.com" target="_blank">paraview@public.kitware.com</a><br>
<b>Subject:</b> Re: [Paraview] OSPRay textures and materials mapping<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
Hi Jonathan.<o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
Yes you can do that.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
1) File->Load OSPRay Materials, switch the file type from "OSPRay Material Files (*.json)" to "Wavefront Material FIles (*.mtl)". That will let you load all of the materials and textures. They should all show up in the Material list.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
2) The OSPRay Material selection (on Display section of Properties Tab advanced) will have all of the individual materials listed in it + a few others including "Value Indexed" which is all the way at the bottom. Choose that it means "use the categorical color
lookup table to decide what material to use for each block and or polygon"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
3) Now change the scalar array to color by to "Material Id", a cell aligned array which has the material index to use for each cell.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
4) Make up a categorical lookup table.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
open spreadsheet view, switch to Field Data, look at the Material Names.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
open the color map editor for the "Material Id", click on Interpret Values As Categories and the color will change from bluewhitered to extremely YELLOW.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
add annotations, value 0 should be the name of the first entry in the Material Names array.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
Notes:<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in;background:white">
<span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222">* I have the trivial script somewhere that I used for the SC17 demo that makes up the lookup table for you. I'll try and dig that up.</span><o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
* in general it isn't a 1:1 match between mtl and ospray, in particular multitextures are not yet implemented<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
* along those lines, the mtl parser I whipped up $PVSRC/VTK/Rendering/OSPRay/vtkMaterialLibrary::InternalParseMTL recognizes a "type" extension outside of mtl that lets you bring in ospray's nice materials instead of the default OBJMaterial. Glass and Metal
are particularly nice.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
At some point I'll get around to making this all automatic. Patches are welcome in the meantime.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
good luck<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
David E DeMarle<br>
Kitware, Inc.<br>
Principal Engineer<br>
<a href="https://maps.google.com/?q=21+Corporate+Drive+%0D%0AClifton+Park,+NY+12065&entry=gmail&source=g" target="_blank">21 Corporate Drive</a><br>
Clifton Park, NY 12065-8662<br>
Phone: 518-881-4909<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
On Fri, May 18, 2018 at 10:25 AM, Jonathan Borduas <<a href="mailto:jonathan.borduas@caboma.com" target="_blank">jonathan.borduas@caboma.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
Hi, <br>
<br>
I tried rendering an .obj file running OSPRay that was exported from PCon Planner Version 7.7 Patch 1. The original file is a .dwg
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
I used the PathThracer mode. However, attached to the .obj there is an .mtl file containing 50+ materials and 50+ texture (.png) files.
<br>
<br>
I didn’t find an automated way to map all polydata of the .obj with their respective material and texture file and rendering them using OSPRay.
<br>
<br>
It seems that I have to assign the material and texture to each polydata one-by-one.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt;margin-left:.5in">
Is there a feature that will automatically map the respective textures and materials ?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
Here is the link to download the original .dwg file. <a href="https://www.easterngraphics.com/pcon/en/wp-content/uploads/2015/03/sample_apartment.dwg" target="_blank">
https://www.easterngraphics.com/pcon/en/wp-content/uploads/2015/03/sample_apartment.dwg</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
You will need to export it to .obj using PCon Planner Version 7.7 Patch 1 with the File/Export/Geometry menu.
<br>
I couldn’t share the .obj file since the size is 60mb+ <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
Thank you<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="color:#888888"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt;margin-left:.5in">
<span style="color:#888888">Jonathan Borduas</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="color:#888888"> </span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt;margin-left:.5in">
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">
http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" target="_blank">
http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/paraview" target="_blank">https://public.kitware.com/mailman/listinfo/paraview</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>