It has a ShadowOnlyMaterial mesh to receive a shadow from a DirectionalLight that only casts the shadow. If scene has another DirectionalLight created before the shadow setup, the shadow doesn’t show up.
However it does show up if you click on the Inspector → Nodes → BaseLight → “Turn on/off the light” toggle. And it stays visible ever afterwards:
Thanks! This is interesting. In the original codebase it looks like includedOnlyMeshes was set to an empty array in the case where I discovered this problem and that apparenly doesn’t disable said lights but rather makes them active for all meshes again.
I guess setting activeLight makes sense as a precaution regardless, to make sure it is never replaced by unintented light even when scene doesn’t at that time have light using meshes. And probably also best that I setEnabled(false) to lights when the include mesh list is empty.