[Bf-cycles] Creating a sky environment programatically

F Escobar materialesescobar at hotmail.es
Fri Feb 23 14:23:38 CET 2018

The BSDF was just a desesperate try,

For future readers: my bad was not connecting bkNode to the graph!

Regards, F.
De: Bf-cycles <bf-cycles-bounces at blender.org> en nombre de Brecht Van Lommel <brechtvanlommel at pandora.be>
Enviado: jueves, 22 de febrero de 2018 16:34
Para: Discussion list to assist Cycles render engine developers
Asunto: Re: [Bf-cycles] Creating a sky environment programatically

A couple issues:
* bkNode is not added to the background shader graph.
* Don't add BSDF to the background shader, it makes no sense.
* Connect bkNode->output("Background") to graph->output()->input("Surface") directly.

On Thu, Feb 22, 2018 at 3:27 PM, F Escobar <materialesescobar at hotmail.es<mailto:materialesescobar at hotmail.es>> wrote:
I thought that this could be easy... but I was wrong

ccl::BackgroundNode* bkNode = new ccl::BackgroundNode();
ccl::Background* bk = scene->background;
ccl::Shader *shader = scene->default_background;
ccl::ShaderGraph *graph = shader->graph ;

ccl::SkyTextureNode* sky = new ccl::SkyTextureNode();

ccl::DiffuseBsdfNode *diffuseBSDF = new ccl::DiffuseBsdfNode();
graph->connect(sky->output("Color"), bkNode->input("Color"));
graph->connect(bkNode->output("Background"), diffuseBSDF->input("Color"));
graph->connect(diffuseBSDF->output("BSDF"), graph->output()->input("Surface"));


That looks fair on my head but I only get a black environment so that's wrong for sure.

Any Idea on this? I bet that is something related to update the bk or the bkNode.

Thank you in advance

Bf-cycles mailing list
Bf-cycles at blender.org<mailto:Bf-cycles at blender.org>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-cycles/attachments/20180223/084ca272/attachment.html>

More information about the Bf-cycles mailing list