Search Unity

Official [2020.1] New Feature - Lighting Settings Asset

Discussion in 'Global Illumination' started by kristijonas_unity, Feb 21, 2020.

  1. VoodooDetective

    VoodooDetective

    Joined:
    Oct 11, 2019
    Posts:
    239
    I keep having lighting settings assets randomly generated in my 2D project that doesn't use lighting. Is there any way to prevent this from happening? It didn't happen before I upgraded to 2020 from 2019.
     
  2. joe_nk

    joe_nk

    Joined:
    Jan 6, 2017
    Posts:
    67
    I just had to assign null to the lighting settings asset (and bump the serialized version to 12) in 213 scenes when upgrading from 2019 to 2020. The upgrade path here wasn't handled very gracefully, I don't think. I'm not sure that Unity realises probably 99% of all unity developers just want a global "I'm not even using basic lighting, so just turn all that off, thanks" option.
     
    AMO_Noot and Jap like this.
  3. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    Bumping this. How can we turn this off? I am not using lighting and would like to turn this off by default so a .lighting file is not generated everytime a scene is modified.
     
  4. sameng

    sameng

    Joined:
    Oct 1, 2014
    Posts:
    184
    I found a "workaround" that's alright for me: click "New Lighting Settings" but then when the new file comes up, click ESC. It seems to then save the lighting settings inside the scene file or something, and no new .lighting file is generated.
     
    Edy likes this.
  5. AMO_Noot

    AMO_Noot

    Joined:
    Aug 14, 2012
    Posts:
    433
    Hey, yeah; updating from 2019 LTS to 2020 LTS. How can we turn this irritating behavior off without per-case workaround? We have a 2D project that does not use lighting, with hundreds of scenes and I don't want this cluttering up the project with useless assets every time I work on a scene.

    Can't we just add a *global* toggle in Project Settings for not generating these assets instead of having to go to the lighting tab for each and every one?
     
    Last edited: Feb 8, 2022
    BTStone and meross like this.
  6. matttardiff

    matttardiff

    Joined:
    Feb 27, 2018
    Posts:
    30
    Working on a 2D project here as well and the lighting settings file generated is more annoying than anything. I know I can just delete it everytime it pops up, but is there still no option to turn it off? I'm using version, 2021.3.8f1
     
  7. wei-jiaxing

    wei-jiaxing

    Joined:
    Nov 12, 2015
    Posts:
    3
    I am also experiencing this problem after upgrading from 2019. What I tried was assigning null to the LightingSetting when the scene is saving, and it worked.

    Code (CSharp):
    1. using UnityEditor;
    2. using UnityEditor.SceneManagement;
    3.  
    4. using UnityEngine;
    5. using UnityEngine.SceneManagement;
    6.  
    7. public static class SceneSaveHook
    8. {
    9.     [InitializeOnLoadMethod]
    10.     static void Init()
    11.     {
    12.         EditorSceneManager.sceneSaving += OnSceneSaving;
    13.     }
    14.  
    15.     private static void OnSceneSaving(Scene scene, string path)
    16.     {
    17.         if (Lightmapping.TryGetLightingSettings(out var settings))
    18.         {
    19.             Debug.Log($"Set Lighting Settings to null: {path}");
    20.             Lightmapping.lightingSettings = null;
    21.         }
    22.     }
    23. }