<div dir="ltr">Screenshot to help. I'm partially through step 4 in it.<div><img src="cid:ii_jhc3csaw0_16373c487da7c8b2" width="563" height="370"><br><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>David E DeMarle<br>Kitware, Inc.<br>Principal Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, May 18, 2018 at 10:57 AM, David E DeMarle <span dir="ltr"><<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Jonathan.<div><br></div><div>Yes you can do that.</div><div><br><div>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.</div><div><br></div><div>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"</div><div><br></div><div>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.</div><div><br></div><div>4) Make up a categorical lookup table.</div><div> open spreadsheet view, switch to Field Data, look at the Material Names.</div><div> 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.</div><div> add annotations, value 0 should be the name of the first entry in the Material Names array.</div><div><br></div><div>Notes:</div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">* 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.</div></div><div>* in general it isn't a 1:1 match between mtl and ospray, in particular multitextures are not yet implemented</div><div>* along those lines, the mtl parser I whipped up $PVSRC/VTK/Rendering/OSPRay/<wbr>vtkMaterialLibrary::<wbr>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.</div><div><br></div><div>At some point I'll get around to making this all automatic. Patches are welcome in the meantime.</div><div><br></div><div>good luck</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_-1468367982713630406gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>David E DeMarle<br>Kitware, Inc.<br>Principal Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div></div></div></div></div>
<br><div class="gmail_quote"><div><div class="h5">On Fri, May 18, 2018 at 10:25 AM, Jonathan Borduas <span dir="ltr"><<a href="mailto:jonathan.borduas@caboma.com" target="_blank">jonathan.borduas@caboma.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="m_-1468367982713630406m_2328634131255210503WordSection1">
<p class="MsoNormal">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
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Is there a feature that will automatically map the respective textures and materials ?<br>
<br>
<u></u><u></u></p>
<p class="MsoNormal">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.co<wbr>m/pcon/en/wp-content/uploads/<wbr>2015/03/sample_apartment.dwg</a><u></u><u></u></p>
<p class="MsoNormal">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+ <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thank you<span class="m_-1468367982713630406HOEnZb"><font color="#888888"><u></u><u></u></font></span></p><span class="m_-1468367982713630406HOEnZb"><font color="#888888">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Jonathan Borduas<br>
<br>
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</font></span></div>
</div>
<br></div></div>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaV<wbr>iew</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">https://public.kitware.com/mai<wbr>lman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>