Convert standard material to shader material from script

Converting a StandardMaterial3D to a ShaderMaterial is an editor-only feature. Without getting the Shader RID of the Material It’s not possible to replicate it in code at runtime.

You can re-import your models overriding their materials though. More info here: