Page MenuHome

Custom RenderEngine: shading editor missing
Open, Needs Triage by DeveloperPublic


System Information
Operating system: Arch Linux
Graphics card: GTX Titan

Blender Version
Broken: git version, 2.81.8 (f2400c1bb5e2)

Short description of error

Behaviour with respect to keeping Cycles/Evee shader nodes around seems to be inconsistent with the documentation, as the shader editor is either not available or shows an incomplete list of shader nodes.

Exact steps for others to reproduce the error

On the property bl_use_shading_nodes_custom is described as

Don't expose Cycles and Eevee shading nodes in the node editor user interface, so own nodes can be used instead

Using the attached RenderEngine test class, which is based on the code in the above doc page:

  1. Start blender -P
  2. Switch to Custom renderer

I see the following depending on bl_use_shading_nodes_custom:

  • When bl_use_shading_nodes_custom is False (i.e. keep Cycles/Eevee nodes around) the Shader editor's add node menu (Shift+A) under Shader only has a Principled Volume entry, other Cycles nodes are gone. But when creating a new material in the editor the initial graph is Principled BSDF -> Material Output, i.e. using the principled BSDF node that cannot be created from the menu.
  • When bl_use_shading_nodes_custom is True the Shader editor is no longer available. Is this new behaviour, where a custom RE needs to provide its own editor page, instead of adding to the existing shader editor?

There's also a corner case when having the Shader editor visible (for example when Cycles is active) and then switching to a render engine that has bl_use_shading_nodes_custom=True: the icon for the editor will become blank, but the Shader editor remains visible. In the console I warnings in this case:

WARN (bpy.rna): ../source/blender/python/intern/bpy_rna.c:1451 pyrna_enum_to_py: current value '3' matches no enum in 'SpaceNodeEditor', '(null)', 'tree_type'



Event Timeline

Looking at the logic in ./source/blender/nodes/shader/node_shader_tree.c

static bool shader_tree_poll(const bContext *C, bNodeTreeType *UNUSED(treetype))
  Scene *scene = CTX_data_scene(C);
  const char *engine_id = scene->r.engine;

  /* Allow empty engine string too,
   * this is from older versions that didn't have registerable engines yet. */
  return (engine_id[0] == '\0' || STREQ(engine_id, RE_engine_id_CYCLES) ||

and the tooltip for bl_use_shading_nodes_custom in ./source/blender/makesrna/intern/rna_render.c

prop = RNA_def_property(srna, "bl_use_shading_nodes_custom", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_SHADING_NODES_CUSTOM);
RNA_def_property_boolean_default(prop, true);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
                         "Use Custom Shading Nodes",
                         "Don't expose Cycles and Eevee shading nodes in the node editor user "
                         "interface, so own nodes can be used instead");

seem to be inconsistent? The check !BKE_scene_use_shading_nodes_custom() disables the shader editor whenever custom nodes are enabled, but the tooltip suggests this will only hide the Cycles/Eevee nodes in the editor (instead of the complete editor itself).

Paul Melis (paulmelis) renamed this task from Custom RenderEngine shading editor behaviour to Custom RenderEngine: shading editor missing.Sep 11 2019, 10:51 AM
Paul Melis (paulmelis) updated the task description. (Show Details)

Ah, release/scripts/startup/ doesn't have a poll method like the others. But why? And why are the other nodes hidden due to the used poll methods, even when bl_use_shading_nodes_custom is False?

    NodeItem("ShaderNodeHoldout", poll=object_eevee_cycles_shader_nodes_poll),
    NodeItem("ShaderNodeVolumeAbsorption", poll=eevee_cycles_shader_nodes_poll),
    NodeItem("ShaderNodeVolumeScatter", poll=eevee_cycles_shader_nodes_poll),
    NodeItem("ShaderNodeEeveeSpecular", poll=object_eevee_shader_nodes_poll),
    NodeItem("ShaderNodeBsdfHairPrincipled", poll=object_cycles_shader_nodes_poll)