Strange Warning with custom render Engine in Blender
Error
WARN (bpy.rna): c:\b\win64_cmake_vs2017\win64_cmake_vs2017\blender.git\source\blender\python\intern\bpy_rna.c:1476 pyrna_enum_to_py: current value ‘3’ matches no enum in ‘SpaceNodeEditor’, ‘(null)’, ‘tree_type’
Similar reports
Custom RenderEngine: Shader Editor issues
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:
https://developer.blender.org/T68473
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’
SpaceNodeEditor error for CustomRenderEngine example
When I activate my custom render engine and switch to the Shading workspace, the node menus disappear and I get the error:
https://blenderartists.org/t/spacenodeeditor-error-for-customrenderengine-example/1162743
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’
Cause
The cause is unclear. However, in my case, this error occurs when I access SpaceNodeEditor.tree_type in register() function with the flag “bl_use_shading_nodes_custom” set to True. My solution was one of the following:
- To set SpaceNodeEditor.tree_type not to be accessed in register() function.
- Set the flag “bl_use_shading_nodes_custom to False and use my node in ShaderEditor for existing Eevee, Cycles.
Thanks for more information and help…