<div dir="ltr">The checker texture will not use UV coordinates by default, you'd need to link in a UVMapNode node for that. For the image texture node it should work though.<div><br></div><div>It's not clear to me what is wrong. A few things you could try:</div><div>* UVs are per face corner by default, verify that you are doing that or switch to ATTR_ELEMENT_VERTEX.</div><div>* Adding some random value like 0.12345 to all UV coordinates to see if they are having an effect at all.</div><div>* Create just an UVMapNode and output that directly, to see if the UV coordinates are getting loaded.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 13, 2018 at 2:25 PM, F Escobar <span dir="ltr"><<a href="mailto:materialesescobar@hotmail.es" target="_blank">materialesescobar@hotmail.es</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">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
Thank you it worked like a charm!</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
I'm driving nuts with other issue now <br>
<br>
I've created my UVs with<br>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span>ccl::Attribute *attr_uv = mesh->attributes.add(ccl::<wbr>ATTR_STD_UV, ccl::ustring("UV"));</div>
<div><span style="white-space:pre-wrap"></span>ccl::float3 *attr_data_uv = attr_uv->data_float3();</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<br>
</div>
Filled <span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">attr_data_uv</span> and so, but I cannot see the checker
 only one plain color, same issue if I use a ImageTextureNode even if I set Tex->projection = ccl::NodeImageProjection::<wbr>NODE_IMAGE_PROJ_BOX;</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
Any tip on this?</div>
<hr style="display:inline-block;width:98%">
<div id="m_-5956384996399456495divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De:</b> Bf-cycles <<a href="mailto:bf-cycles-bounces@blender.org" target="_blank">bf-cycles-bounces@blender.org</a><wbr>> en nombre de Brecht Van Lommel <<a href="mailto:brechtvanlommel@pandora.be" target="_blank">brechtvanlommel@pandora.be</a>><br>
<b>Enviado:</b> jueves, 8 de febrero de 2018 15:34<br>
<b>Para:</b> Discussion list to assist Cycles render engine developers<br>
<b>Asunto:</b> Re: [Bf-cycles] Any sample on creating basic materials from scratch?</font>
<div> </div>
</div><div><div class="h5">
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>We don't have any example code for this specifically. It's easiest to create node with the corresponding class directly.
<div><br>
</div>
<font face="monospace, monospace">CheckerTextureNode *checker = new CheckerTextureNode();<br>
checker->color1 = make_float3(1.0f, 0.0f, 0.0f);<br>
checker->color2 = make_float3(0.0f, 0.0f, 1.0f);<br>
checker->scale = 1.0f;<br>
graph->add(checker);<br>
shader->set_graph(graph);</font>
<div><br>
</div>
<div>If you want to use the generic API, don't create your own <font face="monospace, monospace">
SocketType</font>, look it up in the node.</div>
<div><br>
</div>
<div><font face="monospace, monospace">const SocketType *color1 = snode->find_input(ustring("<wbr>color1"));</font></div>
<div><font face="monospace, monospace">snode->set(*color1, make_<wbr>float3(1.0f, 0.0f, 0.0f));</font></div>
<div><br>
Regards,</div>
<div>Brecht.</div>
<div><br>
</div>
</div>
</div>
<div class="m_-5956384996399456495x_gmail_extra"><br>
<div class="m_-5956384996399456495x_gmail_quote">On Thu, Feb 8, 2018 at 2:13 PM, F Escobar <span dir="ltr">
<<a href="mailto:materialesescobar@hotmail.es" target="_blank">materialesescobar@hotmail.es</a>></span> wrote:<br>
<blockquote class="m_-5956384996399456495x_gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<div><span style="background-color:rgba(0,0,0,0)">I tried with this:</span><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span>ccl::Shader *shader = new ccl::Shader();</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span>if (scene != NULL)</div>
<div><span style="white-space:pre-wrap"></span>scene->shaders.push_back(shade<wbr>r);</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span>shader->name=ccl::ustring(mate<wbr>rial->mName);</div>
<div><span style="white-space:pre-wrap"></span>ccl::ShaderGraph *graph = new ccl::ShaderGraph();</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span>const ccl::NodeType *node_type = ccl::NodeType::find(ccl::ustri<wbr>ng("checker_texture"));</div>
<div><span style="white-space:pre-wrap"></span>if (!node_type) {</div>
<div><span style="white-space:pre-wrap"></span>fprintf(stderr, "Unknown shader node \n");</div>
<div><span style="white-space:pre-wrap"></span>}</div>
<div><span style="white-space:pre-wrap"></span>else if (node_type->type != ccl::NodeType::SHADER) {</div>
<div><span style="white-space:pre-wrap"></span>fprintf(stderr, "Node type \"%s\" is not a shader node.\n", node_type->name.c_str());</div>
<div><span style="white-space:pre-wrap"></span>}</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span>ccl::ShaderNode* snode = (ccl::ShaderNode*)node_type->c<wbr>reate(node_type);</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span>ccl::SocketType color1;</div>
<div><span style="white-space:pre-wrap"></span>color1.type = ccl::SocketType::COLOR;</div>
<div><span style="white-space:pre-wrap"></span><a href="http://color1.name" target="_blank">color1.name</a> = ccl::ustring("color1");</div>
<div><span style="white-space:pre-wrap"></span>snode->set(color1, ccl::make_float3(1.0f, 0.0f, 0.0f));</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span>ccl::SocketType color2;</div>
<div><span style="white-space:pre-wrap"></span>color2.type = ccl::SocketType::COLOR;</div>
<div><span style="white-space:pre-wrap"></span><a href="http://color2.name" target="_blank">color2.name</a> = ccl::ustring("color2");</div>
<div><span style="white-space:pre-wrap"></span>snode->set(color2, ccl::make_float3(0.0f, 0.0f, 1.0f));</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span>ccl::SocketType scale;</div>
<div><span style="white-space:pre-wrap"></span>scale.type = ccl::SocketType::FLOAT;</div>
<div><span style="white-space:pre-wrap"></span><a href="http://scale.name" target="_blank">scale.name</a> = ccl::ustring("scale");</div>
<div><span style="white-space:pre-wrap"></span>snode->set(scale, 1.0f);
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span>graph->add(snode);</div>
<div><span style="white-space:pre-wrap"></span>shader->set_graph(graph);</div>
</div>
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
But I had crashes creating color2 probably I'm doing it wrongly, is there any sample on this?</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
Thank you in advance.</div>
</div>
<br>
______________________________<wbr>_________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a><br>
<a href="https://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">https://lists.blender.org/mail<wbr>man/listinfo/bf-cycles</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div></div></div>

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