Universal Render Pipeline/Lit - WorkflowMode

Hi everyone!

The question is simple and the answer will probably also be.

At runtime i create an Object and need to change material Workflow Mode from Metallic (set by default) to specular.

This shader code shows:
_WorkflowMode(“WorkflowMode”, Float) = 1.0

So i’m trying in my script (C#) this:
newMaterial.SetFloat(“_WorkflowMode”, 0.0f);

But material Workflow not changing or returning error. Anyone knows how to help me?

After some tests, I notice that the changes are made but only take effect after i open Material properties in the Inspector. This type of commands at runtime needs some sort of update?

This gets the job done:

newMaterial.EnableKeyword(“_METALLICSPECGLOSSMAP”);
newMaterial.EnableKeyword(“_SPECULAR_SETUP”);

it was missing _METALLICSPECGLOSSMAP