class_docstr: An implementation of a rendering backend in Blender/Cycles.
class_docstr_tok: ["An","implementation","of","a","rendering","backend","in","Blender\/Cycles","."]
code: def _setup_scene_shading(self):
      self.blender_scene.world.use_nodes = True
      tree = self.blender_scene.world.node_tree
      links = tree.links
  
      # clear the tree
      for node in tree.nodes.values():
          tree.nodes.remove(node)
  
      # create nodes
      out_node = tree.nodes.new(type="ShaderNodeOutputWorld")
      out_node.location = 1100, 0
  
      mix_node = tree.nodes.new(type="ShaderNodeMixShader")
      mix_node.location = 900, 0
      lightpath_node = tree.nodes.new(type="ShaderNodeLightPath")
      lightpath_node.location = 700, 350
      self.ambient_node = tree.nodes.new(type="ShaderNodeBackground")
      self.ambient_node.inputs["Color"].default_value = (
          0.0,
          0.0,
          0.0,
          1.0,
      )
      self.ambient_node.location = 700, 0
      self.bg_node = tree.nodes.new(type="ShaderNodeBackground")
      self.bg_node.inputs["Color"].default_value = (0.0, 0.0, 0.0, 1.0)
      self.bg_node.location = 700, -120
  
      links.new(
          lightpath_node.outputs.get("Is Camera Ray"),
          mix_node.inputs.get("Fac"),
      )
      links.new(
          self.ambient_node.outputs.get("Background"),
          mix_node.inputs[1],
      )
      links.new(
          self.bg_node.outputs.get("Background"), mix_node.inputs[2]
      )
      links.new(
          mix_node.outputs.get("Shader"), out_node.inputs.get("Surface")
      )
  
      # create nodes for HDRI images, but leave them disconnected until
      # set_ambient_illumination or set_background
      coord_node = tree.nodes.new(type="ShaderNodeTexCoord")
  
      self.bg_mapping_node = tree.nodes.new(type="ShaderNodeMapping")
      self.bg_mapping_node.location = 200, 200
      self.bg_hdri_node = tree.nodes.new(
          type="ShaderNodeTexEnvironment"
      )
      self.bg_hdri_node.location = 400, 200
      links.new(
          coord_node.outputs.get("Generated"),
          self.bg_mapping_node.inputs.get("Vector"),
      )
      links.new(
          self.bg_mapping_node.outputs.get("Vector"),
          self.bg_hdri_node.inputs.get("Vector"),
      )
  
      self.illum_mapping_node = tree.nodes.new(type="ShaderNodeMapping")
      self.illum_mapping_node.location = 200, -200
      self.ambient_hdri_node = tree.nodes.new(
          type="ShaderNodeTexEnvironment"
      )
      self.ambient_hdri_node.location = 400, -200
      links.new(
          coord_node.outputs.get("Generated"),
          self.illum_mapping_node.inputs.get("Vector"),
      )
      links.new(
          self.illum_mapping_node.outputs.get("Vector"),
          self.ambient_hdri_node.inputs.get("Vector"),
      )
  
imports: import collections
  import io
  import logging
  import os
  import sys
  from contextlib import redirect_stdout
  from typing import Any, Dict, Optional, Sequence, Union
  import tempfile
  from kubric.safeimport.bpy import bpy
  import numpy
  import tensorflow
  from singledispatchmethod import singledispatchmethod
  import kubric
  from kubric import core
  from kubric.core.assets import UndefinedAsset
  from kubric.redirect_io import RedirectStream
  from kubric.renderer import blender_utils
  from kubric import file_io
  from kubric.file_io import PathLike
label_desc: Use image node_id 34 for calling the Blender obj's underlying member method code with example usage: obj._setup_scene_shading() without return types