1
$\begingroup$

Is there a way to automatically switch the material by detecting the render engine change between Eevee and Cycles?

If there is a node like output 1 if the render engine was cycles and output 0 if the engine was Eevee, That will be great for implementing auto switch function because I can just connect that to mix shader node.

$\endgroup$
2

2 Answers 2

3
$\begingroup$

You can easily do it with drivers.

  • Click right mouse button (RMB) on render engine name and select Copy as a new driver
  • Go to your node, for example Value node (Input->Value)
  • Put cursor over value field and with RMB click Paste driver
  • RMB click again and this time choose Edit driver
  • In driver setting switch type from Averaged to Scripted Expression
  • Change expression to engine/2 (because Cycles is third engine in list, otherwise you'll have (0,2) output)
$\endgroup$
3
$\begingroup$

enter image description here There is a node-based option for detecting the render engine.

This works by using a node (Shader to RGB) that will return white (1) when it exists. This is only true if Eevee is the target render engine.

In any other case, it will return (0) which usually indicates cycles is the target engine.

This eliminates the need for a driver and is a good alternative to include engine checks in node groups.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .