Search Unity

Failed to load LightingData.asset

Discussion in 'General Graphics' started by Freaking-Pingo, Aug 7, 2019.

  1. Freaking-Pingo

    Freaking-Pingo

    Joined:
    Aug 1, 2012
    Posts:
    310
    We are running multiple projects that includes baked lighting, but once in a while Unity fails to load the LightingData.

    Unknown error occurred while loading 'Assets/Scenes/Standard/LightingData.asset'.

    The light can be rebaked, but it is a nuisance that we have to re-bake a lot. We have experienced this with different versions of Unity and we haven't yet found a systematic approach to reproduce it. The error happens after pulling from git.

    Before I go knee-deep into investigating this issue, have anyone experienced the same and might know of a trivial fix?

     
    vittorioleo82 likes this.
  2. Freaking-Pingo

    Freaking-Pingo

    Joined:
    Aug 1, 2012
    Posts:
    310
    Alright, after investigating this a bit more it appears the error is actually caused our version control, most likely LFS. We figured it out by manually moving the LightingData.asset in which case Unity could load it. I tried opening the LightingData.asset in a text editor, just to make sure the file contained actual binary data and not just a LFS pointer, but the data seems to be there. Anyone have an idea how git LFS can mess your LightingData.asset file?
     
  3. Sompol_Rznet

    Sompol_Rznet

    Joined:
    Sep 14, 2018
    Posts:
    22
    I met this issue also with Unity2019.2.11f1

    Workaround is set your .gitattributes to ensure that git see your LightingData.asset as binary file.
    So it don't get messed up with autocrlf feature anymore.
     
    Faimen and chrismarch like this.
  4. the_invizible_dood

    the_invizible_dood

    Joined:
    Jan 9, 2017
    Posts:
    5

    can you elaborate more? I'm not sure what I'm suppose to do here?
     
  5. LTPStudioXR

    LTPStudioXR

    Joined:
    Nov 1, 2016
    Posts:
    11
    No solution yet even with the ".asset -diff -merge* but we did find that it started to occur once light probes were brought into the scene
     
  6. TajSensei

    TajSensei

    Joined:
    May 4, 2019
    Posts:
    1
    find that corrupted Lightning Data and delete it and go Windows/Rendering/Lighting Setting and you will see Generate Lighting bottom of panel
     
  7. vittorioleo82

    vittorioleo82

    Joined:
    Jan 15, 2021
    Posts:
    4
    Hi i have the same problems. do you solved in any way? thanks in advance
     
  8. He_Howard

    He_Howard

    Joined:
    May 14, 2020
    Posts:
    1
    1、open [.gitattributes] file
    2、remove [*.asset filter=lfs diff=lfs merge=lfs -text]
    re-bake your lighting and push your change, it should work.
     
  9. IIporpammep

    IIporpammep

    Joined:
    Aug 16, 2015
    Posts:
    39
    You don't need to remove *.asset filter=lfs diff=lfs merge=lfs -text

    If you check the difference(using WinMerge for example) between the original LightingData.asset and the same file moved through git to another PC they will have different End Of Line characters on some lines.

    So the working solution is:
    1. Open .gitattributes file
    2. In the end of file add the following line:
    LightingData.asset binary
     
    Last edited: Feb 13, 2023
  10. unity_AB0DE69EF5EADCB7FAC7

    unity_AB0DE69EF5EADCB7FAC7

    Joined:
    May 11, 2022
    Posts:
    2
    Give this person a medal, this fixed my issue
     
    Dance_M and IIporpammep like this.