Search Unity

Question Methods of Accessing Light Probes

Discussion in 'Global Illumination' started by quinng, May 13, 2023.

  1. quinng

    quinng

    Joined:
    Jul 2, 2015
    Posts:
    22
    As far as I can tell, LightmapSettings.lightProbes is the only way to access and modify light probe data, but are there other ways, for example a way to access and modify the light probe data on a lighting data asset?

    Here is what I am trying to do. I have multiple scenes, that I intend to load additively. For my purposes I want to bake lighting for the scenes individually, and I want to run a script in editor that makes some modifications to the each scene's light probes. Unfortunately LightmapSettings.lightProbes seems to only give me access to combined array of all the light probes among loaded scenes.

    When level editing I usually have multiple scenes open, but then I need to open each scene individually to bake lighting and make modifications to the light probe data. Thus I'm wondering if there is a way to surgically modify the light probe data of a specific scene's lighting data, without needing to open the scene individually.

    If not, it seems like my workaround is continuing to manually open scenes and run scripts, or write an editor script to automate the process (loading each scene individually to make modifications, and then reloading the scenes I was working on before).
     
  2. Pema-Malling

    Pema-Malling

    Unity Technologies

    Joined:
    Jul 3, 2020
    Posts:
    328
    > Thus I'm wondering if there is a way to surgically modify the light probe data of a specific scene's lighting data, without needing to open the scene individually.

    There is no officially supported way to do this, I'm afraid. I believe there are some community-made tools for doing stuff like this floating around on the forums, but I can't make any guarantees about their robustness as they are essentially reverse engineering undocumented API.
     
    quinng likes this.