<div dir="ltr">Hi again, <div><br></div><div> @Nathan, you mentionned to me somewhere that uvs a listed by triangles, but in the example file you gave me:  <a href="https://github.com/jesterKing/CCSycles/blob/master/tests/objects/uv_cube.xml">https://github.com/jesterKing/CCSycles/blob/master/tests/objects/uv_cube.xml</a></div><div><br></div><div>uvs are clearly listed by squares ( 6 of them of course) </div><div><br></div><div>To be honest, I have really hard time exporting my uvs from houdini. I&#39;ve tried a lot of things already, and nothing seems to work, I am on the verge of giving up frankly, which would be a shame, because uvs are my last main issue, I have almost a basic working solution for simple animations rendering with houdini. </div><div><br></div><div>Guillaume</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 1:14 PM, Guillaume Rouault <span dir="ltr">&lt;<a href="mailto:guillaume.rouault.fx@gmail.com" target="_blank">guillaume.rouault.fx@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">After reflection, It&#39;s dumb of me to think that the error comes from source code. It definitely comes from my python code : <div>I was able to render correctly the example object you gave me &#39;uv_cube.xml&#39;</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Guillaume</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 12:45 PM, Guillaume Rouault <span dir="ltr">&lt;<a href="mailto:guillaume.rouault.fx@gmail.com" target="_blank">guillaume.rouault.fx@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thank you guys for your answers, I wanted some infos, and I have plenty of them now ^^ . <div>I am trying to code a exporter from Houdini to Cycles Standalone. I use python to do that in houdini 15. <br><div>The fact is , I am really bad at C++ and after several hours of reading the source code, my head hurts a little ^^ . </div></div><div><br></div><div>indeed a lot of infos in cycles_xml.cpp </div><div>I adapted my export script to try and mimic the way mesh is computed. </div><div><br></div><div> in the part of the code you mentionned <a href="https://developer.blender.org/diffusion/C/browse/master/src/app/cycles_xml.cpp;65ff373f0c71c043dd7b5632580501f1fc4bea7e$982" target="_blank">https://developer.blender.org/diffusion/C/browse/master/src/app/cycles_xml.cpp;65ff373f0c71c043dd7b5632580501f1fc4bea7e$982</a></div><div><br></div><div>Is it normal that the variable &#39;index_offset&#39; stays at 0 ? </div><div>Shouldn&#39;t it be incremented at every iteration ?</div><span><font color="#888888"><div><br></div><div>Guillaume</div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 6:42 AM, Nathan Letwory <span dir="ltr">&lt;<a href="mailto:nathan@mcneel.com" target="_blank">nathan@mcneel.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<br>
I haven&#39;t actually tested this in the C++ standalone version, but only<br>
in my C# CCSycles tester, but check out<br>
<br>
<a href="https://github.com/jesterKing/CCSycles/blob/master/tests/objects/uv_cube.xml" rel="noreferrer" target="_blank">https://github.com/jesterKing/CCSycles/blob/master/tests/objects/uv_cube<br>
.xml</a><br>
<br>
You&#39;ll have to add a texture coordinate input node and connect it to<br>
the image texture node (vector). That should have your shader use UV<br>
coordinates from the mesh data.<br>
<br>
UV coordinates are per triangle (you can double-check here:<br>
<a href="https://developer.blender.org/diffusion/C/browse/master/src/app/cycles_x" rel="noreferrer" target="_blank">https://developer.blender.org/diffusion/C/browse/master/src/app/cycles_x</a><br>
ml.cpp;65ff373f0c71c043dd7b5632580501f1fc4bea7e$982)<br>
<br>
Here a custom RhinoCycles material using XML with a texture coordinate<br>
input node:<br>
<a href="https://github.com/mcneel/RhinoCycles/blob/master/Materials/BrickWithChe" rel="noreferrer" target="_blank">https://github.com/mcneel/RhinoCycles/blob/master/Materials/BrickWithChe</a><br>
ckeredMortar.cs<br>
<br>
And here for the C#-way of creating nodes in RhinoCycles where I set<br>
projection and mappings<br>
<a href="https://github.com/mcneel/RhinoCycles/blob/master/RenderEngine.Utils.cs#L131" rel="noreferrer" target="_blank">https://github.com/mcneel/RhinoCycles/blob/master/RenderEngine.Utils.cs#<br>
L131</a><br>
- - in this function the last else block is probably the most<br>
interesting, since here I connect the UV output from texture<br>
coordinate input node :)<br>
<br>
Hope that helps,<br>
<br>
/Nathan<br>
<span><br>
On 09/12/2015 23:42, Guillaume Rouault wrote:<br>
&gt;<br>
&gt; I couldn&#39;t find a file named blender_mesh.cpp in the sources I<br>
&gt; have. And I think it would mainly give me some infos on how to<br>
&gt; format the mesh in the xml object file. but my main issue, I think,<br>
&gt; is at the shader level in the scene xml file, using the standalone<br>
&gt; XML API . How do I force the shader to use uv coordinates provided<br>
&gt; on the mesh ?<br>
&gt;<br>
&gt; Now that I think of it, there are no examples using uv mapped<br>
&gt; objects in the /examples folder, at least nothing using coordinates<br>
&gt; generated during modeling.  Is it even supported at this stage in<br>
&gt; the standalone version ?<br>
&gt;<br>
&gt; Guillaume<br>
&gt;<br>
&gt; On Wed, Dec 9, 2015 at 10:19 PM, Mohamed Sakr &lt;<a href="mailto:3dsakr@gmail.com" target="_blank">3dsakr@gmail.com</a><br>
</span><span>&gt; &lt;mailto:<a href="mailto:3dsakr@gmail.com" target="_blank">3dsakr@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt; in blender_mesh.cpp, find attr_create_uv_map() function and see<br>
&gt; how they create UVs<br>
&gt;<br>
&gt; On Wed, Dec 9, 2015 at 10:26 PM, Guillaume Rouault<br>
&gt; &lt;<a href="mailto:guillaume.rouault.fx@gmail.com" target="_blank">guillaume.rouault.fx@gmail.com</a><br>
</span><span>&gt; &lt;mailto:<a href="mailto:guillaume.rouault.fx@gmail.com" target="_blank">guillaume.rouault.fx@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I can&#39;t find any infos on uv coordinates for cycles standalone. As<br>
&gt; of now, I haven&#39;t been able to render an object with the correct<br>
&gt; uvs. I can see a texture, but it&#39;s mapped to every triangle on the<br>
&gt; mesh.<br>
&gt;<br>
&gt; I searched the xml api , and came up with that setup :<br>
&gt;<br>
&gt;<br>
</span>&gt; *&lt;!-- floor shader--&gt;* *&lt;shader name=&quot;floor&quot; &gt;* *&lt;diffuse_bsdf<br>
&gt; name=&quot;diffuse&quot; roughness=&quot;0.05&quot; color=&quot;1.0, 1.0, 1.0&quot; /&gt;*<br>
&gt; *&lt;glossy_bsdf name=&quot;glossy&quot; roughness=&quot;0.05&quot; color=&quot;0.2, 0.2, 0.2&quot;<br>
&gt; /&gt;* * * *&lt;texture_coordinate name=&quot;uv&quot; /&gt;* *&lt;image_texture<br>
&gt; name=&quot;tex&quot; src=&quot;./maps/aaa.jpg&quot; /&gt;* *&lt;add_closure name=&quot;mix&quot; /&gt;*<br>
&gt; *&lt;fresnel name=&quot;fresnel&quot; /&gt;* *&lt;connect from=&quot;fresnel fac&quot;<br>
&gt; to=&quot;glossy color&quot; /&gt;* * * *&lt;connect from=&quot;uv uv&quot; to=&quot;tex vector&quot;<br>
&gt; /&gt;* *&lt;connect from=&quot;tex color&quot; to=&quot;diffuse color&quot; /&gt;* * * * *<br>
&gt; *&lt;connect from=&quot;diffuse bsdf&quot; to=&quot;mix closure1&quot; /&gt;* *&lt;connect<br>
&gt; from=&quot;glossy bsdf&quot; to=&quot;mix closure2&quot; /&gt;* *&lt;connect from=&quot;mix<br>
&gt; closure&quot; to=&quot;output surface&quot; /&gt;* *&lt;/shader&gt;* * * * * Am I on the<br>
&gt; right path ? * * Are there any examples or infos on uvs somewhere<br>
<span>&gt; ? Actually, on my meshes,  I don&#39;t even know if I have to export uv<br>
</span>&gt; coords as vector2  (uv) , or vector3 (uvw) ? * * * * *Guillaume*<br>
<br>
<br>
- --<br>
Nathan Letwory<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2<br>
<br>
iQEcBAEBCAAGBQJWaRDMAAoJEKtfN7KsE0TtOXsH/2soTeJzRwChnzexs2SqgnJc<br>
QWFo750pglTVpmmH2SDLGKg6fVofCYPzhc5UWnbR1+mlCkC+E8VsBLLu6CaG5Whb<br>
6Tfwq7uOE9Rht1dlE2PxzhzaoV/Q++cOIgubaCfq3sofBXIE5qbjYSLwtyrKDj7c<br>
lhrPx/FwaapEHzEArjfWENbESVEHb7kJh9d39E3qeeCarflBDgJKVNxVC/SoVnsM<br>
GZIrUWeujIhLpcWt6XN0P68jwQdyUnX6Kx8k7aN3iG6Un7BfxaqlY+/+W5sUKQhG<br>
w7c349NeHj+gTJzbYTdY3f9zMLrVc2Iz7eVCmVy048aK2nMvG6+PunXcLBh6KVQ=<br>
=/YDa<br>
-----END PGP SIGNATURE-----<br>
<div><div>_______________________________________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>