<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'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"><<a href="mailto:guillaume.rouault.fx@gmail.com" target="_blank">guillaume.rouault.fx@gmail.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">After reflection, It'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 'uv_cube.xml'</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"><<a href="mailto:guillaume.rouault.fx@gmail.com" target="_blank">guillaume.rouault.fx@gmail.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">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 'index_offset' stays at 0 ? </div><div>Shouldn'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"><<a href="mailto:nathan@mcneel.com" target="_blank">nathan@mcneel.com</a>></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'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'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>
><br>
> I couldn't find a file named blender_mesh.cpp in the sources I<br>
> have. And I think it would mainly give me some infos on how to<br>
> format the mesh in the xml object file. but my main issue, I think,<br>
> is at the shader level in the scene xml file, using the standalone<br>
> XML API . How do I force the shader to use uv coordinates provided<br>
> on the mesh ?<br>
><br>
> Now that I think of it, there are no examples using uv mapped<br>
> objects in the /examples folder, at least nothing using coordinates<br>
> generated during modeling. Is it even supported at this stage in<br>
> the standalone version ?<br>
><br>
> Guillaume<br>
><br>
> On Wed, Dec 9, 2015 at 10:19 PM, Mohamed Sakr <<a href="mailto:3dsakr@gmail.com" target="_blank">3dsakr@gmail.com</a><br>
</span><span>> <mailto:<a href="mailto:3dsakr@gmail.com" target="_blank">3dsakr@gmail.com</a>>> wrote:<br>
><br>
> in blender_mesh.cpp, find attr_create_uv_map() function and see<br>
> how they create UVs<br>
><br>
> On Wed, Dec 9, 2015 at 10:26 PM, Guillaume Rouault<br>
> <<a href="mailto:guillaume.rouault.fx@gmail.com" target="_blank">guillaume.rouault.fx@gmail.com</a><br>
</span><span>> <mailto:<a href="mailto:guillaume.rouault.fx@gmail.com" target="_blank">guillaume.rouault.fx@gmail.com</a>>> wrote:<br>
><br>
> Hi,<br>
><br>
> I can't find any infos on uv coordinates for cycles standalone. As<br>
> of now, I haven't been able to render an object with the correct<br>
> uvs. I can see a texture, but it's mapped to every triangle on the<br>
> mesh.<br>
><br>
> I searched the xml api , and came up with that setup :<br>
><br>
><br>
</span>> *<!-- floor shader-->* *<shader name="floor" >* *<diffuse_bsdf<br>
> name="diffuse" roughness="0.05" color="1.0, 1.0, 1.0" />*<br>
> *<glossy_bsdf name="glossy" roughness="0.05" color="0.2, 0.2, 0.2"<br>
> />* * * *<texture_coordinate name="uv" />* *<image_texture<br>
> name="tex" src="./maps/aaa.jpg" />* *<add_closure name="mix" />*<br>
> *<fresnel name="fresnel" />* *<connect from="fresnel fac"<br>
> to="glossy color" />* * * *<connect from="uv uv" to="tex vector"<br>
> />* *<connect from="tex color" to="diffuse color" />* * * * *<br>
> *<connect from="diffuse bsdf" to="mix closure1" />* *<connect<br>
> from="glossy bsdf" to="mix closure2" />* *<connect from="mix<br>
> closure" to="output surface" />* *</shader>* * * * * Am I on the<br>
> right path ? * * Are there any examples or infos on uvs somewhere<br>
<span>> ? Actually, on my meshes, I don't even know if I have to export uv<br>
</span>> 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>