SpaceNodeEditor error for CustomRenderEngine example


I’m trying to implement a custom render engine, following the example for Blender 2.8 here.

When I activate my custom render engine and switch to the Shading workspace, the node menus disappear and I get the error:

WARN (bpy.rna): c:\b\win64_cmake_vs2017\win64_cmake_vs2017\blender.git\source\blender\python\intern\bpy_rna.c:1449 pyrna_enum_to_py: current value '0' matches no enum in 'SpaceNodeEditor', '(null)', 'tree_type'

I’ve pored over the Python API and looked at how other render engines (Lux) does this, but I’m stumped.

It seems that the Shader Node Editor wants to disappear when I switch to my custom render engine, and it feels like there should be a COMPAT_ENGINES field that I can add my engine to, much like the other panels.

Any clues / tips about how to fix this?

Do you want to use the Cycles nodes or do you have your own node trees?
You have to set bl_use_shading_nodes_custom accordingly in your RenderEngine class:
If it’s True, Cycles node trees are hidden, if it’s False, they are visible.

I’m not sure that this is what’s causing your issues, but maybe it helps.

Thanks, @B.Y.O.B, that did the trick!

Also, do you have any idea if it’s possible to add another option to the target enum on the Material Output node?

It’s described in the API (ShaderNodeOutputMaterial(ShaderNode)) but doesn’t say how to expand it, if you can at all…

You’ll have to ask the Blender developers about that, for example on

1 Like