I made a separate list of shader nodes for eevee; works fine now
Philipp Oeser (lichtwerk)
- Maniphest Tasks
- T60011: Node wrangler: switch shader list in Eevee shows Cycles list
Thx for this!
This however will then exclude some cycles shaders [when you are working in cycles].
So I guess we could either:
- keep separate lists for cycles and eevee [this should check for context.scene.render.engine on each occasion the list is used], or
- keep them all in one list, add specular there [and live with the fact that not all shaders in the list are actually supported by the partucular engine...]
The first choice seems a bit cleaner [though a bit more work]
Note there are more nodes that differ from one engine to the other [e.g. Shader to RGB]; ideally these would be handled as well [though this could be added later as well]
For a nice overview see https://docs.blender.org/manual/en/dev/render/eevee/materials/nodes_support.html
[I also wanted to check if it is possible to extract supported nodes dynamically for each engine, so we dont have to keep these lists at all -- but this could also be done at a later stage]
If you want to work on this, you are very welcome [otherwise I can also update the Diff accordingly]
Made separate lists for shaders and converters. The Shader To RGB node and the Specular node can be switched to now, and the rest of the cycles nodes work as well. Please have a look at the changes.
@Vaishnav S (padthai): please excuse the delay again (now reserved some time to look into addon-related reports...)
Two things before looking deeper:
(1) current patch doesnt apply to master [is this possibly based off of a previous version?] (e.g. list(eevee_shaders_shader_nodes_props) is not in current master code)
(2) as @Brecht Van Lommel (brecht) mentioned, it would be really best to use nodeitems_utils to loop over categories and nodes. Are you willing to look into this? (I'm available to help out in case of issues...)
sorry again for the inconvenience caused by replying late here...
Thanx for updating and sorry again for the delay, looked into this again, and while this would work, it would really be good to not add more code [in regards to cycles vs. eevee], but use functionality already provided in nodeitems_utils.
This is ensured to be up to date (uses the builtin lists and polls from nodeitems_builtins) and is already taking care of returning the right nodes depending on renderengine, shading/compositing/texture nodetree etc...
Sooo, we can get rid of all these lists in nodewrangler:
list(shaders_input_nodes_props) + list(shaders_output_nodes_props) + list(shaders_shader_nodes_props) + list(shaders_texture_nodes_props) + list(shaders_color_nodes_props) + list(shaders_vector_nodes_props) + list(shaders_converter_nodes_props) + list(shaders_layout_nodes_props) + list(compo_input_nodes_props) + list(compo_output_nodes_props) + list(compo_color_nodes_props) + list(compo_converter_nodes_props) + list(compo_filter_nodes_props) + list(compo_vector_nodes_props) + list(compo_matte_nodes_props) + list(compo_distort_nodes_props) + list(compo_layout_nodes_props) + list(blender_mat_input_nodes_props) + list(blender_mat_output_nodes_props) + list(blender_mat_color_nodes_props) + list(blender_mat_vector_nodes_props) + list(blender_mat_converter_nodes_props) + list(blender_mat_layout_nodes_props) + list(texture_input_nodes_props) + list(texture_output_nodes_props) + list(texture_color_nodes_props) + list(texture_pattern_nodes_props) + list(texture_textures_nodes_props) + list(texture_converter_nodes_props) + list(texture_distort_nodes_props) + list(texture_layout_nodes_props)
and instead get them from nodeitems_utils. For example, this could be used to get shading shader nodes [you dont have to worry about cycles/eevee]:
for cat in nodeitems_utils.node_categories_iter(context): if cat.identifier == 'SH_NEW_SHADER': for item in [it for it in cat.items(context) if isinstance(it, nodeitems_utils.NodeItem)]: op = layout.operator(NWSwitchNodeType.bl_idname, text=item.label) op.to_type = item.nodetype
or check output of a test operator[this automatically adapts when you change renderengines, or are in compositing, etc...]
Let me know if there is anything blocking from getting this patch updated to use this...