<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 22, 2018 at 10:34 AM, Jonathan Borduas <span dir="ltr"><<a href="mailto:jonathan.borduas@caboma.com" target="_blank">jonathan.borduas@caboma.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-3890961665135156206WordSection1">
<p class="MsoNormal">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.
<br>
<br></p></div></div></blockquote><div><br></div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_-3890961665135156206WordSection1"><p class="MsoNormal">
Is there a roadmap as to when the multi-texture could be implemented ?</p></div></div></blockquote><div><br></div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_-3890961665135156206WordSection1"><p class="MsoNormal">It would be great to have readers that can load texture/Geometry/Materials files such as .obj (.mtl and .png), .fbx and .dwg.
<br></p></div></div></blockquote><div><br></div><div>Agreed.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_-3890961665135156206WordSection1"><p class="MsoNormal">
Best regards,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Jonathan Borduas<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span class=""><b>From:</b> David E DeMarle <<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>> <br>
</span><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><span class=""><br>
<b>Subject:</b> Re: [Paraview] OSPRay textures and materials mapping<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi Jonathan.<u></u><u></u></p><div><div class="h5">
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Yes you can do that.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">4) Make up a categorical lookup table.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">   open spreadsheet view, switch to Field Data, look at the Material Names.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">   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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">   add annotations, value 0 should be the name of the first entry in the Material Names array.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Notes:<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal" style="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.<u></u><u></u></span></p>
</div>
</div>
<div>
<p class="MsoNormal">* in general it isn't a 1:1 match between mtl and ospray, in particular multitextures are not yet implemented<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">* 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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">At some point I'll get around to making this all automatic. Patches are welcome in the meantime.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">good luck<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div></div></div><div><div class="h5">
<div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">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">21 Corporate Drive</a><br>
Clifton Park, NY 12065-8662<br>
Phone: 518-881-4909<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">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:<u></u><u></u></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">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" style="margin-bottom:12.0pt">Is there a feature that will automatically map the respective textures and materials ?<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.<wbr>com/pcon/en/wp-content/<wbr>uploads/2015/03/sample_<wbr>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<u></u><u></u></p>
<p class="MsoNormal"><span style="color:#888888"> <u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:#888888">Jonathan Borduas<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#888888"> <u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
______________________________<wbr>_________________<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/<wbr>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/<wbr>ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" 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" target="_blank">https://public.kitware.com/<wbr>mailman/listinfo/paraview</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

</blockquote></div><br></div></div>