Search Unity

Copy Lighting Settings From Scene To Scene

Discussion in 'Editor & General Support' started by SteveJ, Mar 9, 2015.

  1. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,046
    Am I missing something or is there no way to copy lighting settings between scenes? It seems like you have to set everything manually in each scene in your project?
     
    dog_funtom likes this.
  2. kerg

    kerg

    Joined:
    Feb 20, 2013
    Posts:
    25
    Same question, same problem!
    If someone have an answer it would be great, even a negative one!
     
  3. Aranda

    Aranda

    Joined:
    Jan 23, 2015
    Posts:
    16
    Just wondered the same thing. Perhaps someone has written an editor extension.
     
  4. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    71
  5. Aranda

    Aranda

    Joined:
    Jan 23, 2015
    Posts:
    16
    I found a workaround.

    - Ensure your assets are in text serialization mode (Edit -> Project Settings -> Editor -> Asset Serialization = Force Text)
    - Save each scene again
    - Used a diff program (eg Beyond Compare) to push the RenderSettings block from one scene to another.

    I know, it's pretty clunky. If I get around to writing an editor extension, I'll post it here :)
     
    ercion likes this.
  6. davedev

    davedev

    Joined:
    Jan 12, 2009
    Posts:
    67
    Unless I am missing something here, an easy way to do this is create a game object in scene 1 called "Lights", move your lights to the game object, drag the Lights game object to the Projects folder to make a prefab, open scene 2 and drag the Lights prefab to that scene.
     
  7. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,046
    Talking about the lighting settings, not the lights.
     
  8. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    554
    Dupe scene, open duped delete all objects, additively open copy target and move all objects from it to dupe.
     
  9. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,046
    Yep - i.e. it's a workaround. The point of this thread was why there isn't a button or something to simply save the settings in one scene and then load them in the next. Kind of the way Beast was able to save settings into an XML file.
     
    phobos2077 and ThatoMogale like this.
  10. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    554
    Maybe we could do it ourselves? You can start a github repo for that or ill do it when i have time. Should be simple enough
     
  11. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,046
  12. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    554
    Yeah when you select lightmap quality per object there is dropdown with quality when you make new quality setting it creates this asset
     
  13. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,046
    Okay - weird. The doco says it's in the Scene tab of the Lighting Panel. Anyway, doesn't really help things either way.
     
  14. Johnny-Ge

    Johnny-Ge

    Joined:
    Apr 26, 2014
    Posts:
    11
    Steve, anything update about this issue? I wanna to do the same as u mentioned, if u have news , please let me know.

    THX
     
  15. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,046
    Far as I know, it still can't be done.
     
  16. Steamc0re

    Steamc0re

    Joined:
    Nov 24, 2014
    Posts:
    140
    Have 100 scenes already made that I have to copy lighting settings to/from. Can't believe this is still not possible.
     
  17. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    554
    Guys you can do it with a crutch, make a podo where you copy current scene settings, serialize it as an asset, load another thing and apply those parameters, it can be made with as editor script in an hour.
     
  18. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,046
    Okay, so make it and share it with everyone :)

    It's not about whether or not there's a workaround. This is a feature that absolutely should be there out-of-the-box.

    Beast had it many versions of Unity ago.
     
    angrypenguin and pointcache like this.
  19. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    554
    I absolutely agree that its unitys fault, half assed architectural decisions with aftermath of neglect for years to follow, and still, its a fast workaround. I wont make it until i need it, which i don't at this point so you guys are on your own.
     
  20. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    571
    Is this still for real? How is this a thing.
     
  21. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,086
    Last edited: Dec 10, 2020
  22. samdax

    samdax

    Joined:
    Oct 2, 2017
    Posts:
    1
    Nice! but can't install the extension, how can i do it?

    thanks!
     
  23. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    571
    Awesome thanks for sharing!

    I feel like the community should create a list of simple pain points like this. A few weeks of unity dev time could shore up most of the editor pain points. Simple things like this or native support for enums with lots of values that need custom editors/filters would go a lot farther to improving quality of life in large products. E.g. try setting script execution order when you have 10000 script files in the game...navigating that list is beyond painful.
     
    YoungDeveloper and Peter77 like this.
  24. YoungDeveloper

    YoungDeveloper

    Joined:
    Jun 28, 2013
    Posts:
    53
    Lighting settings in form of scriptable objects would be great imo, where every scene has default set just like default material on new mesh renderers, and then you can just swap modules like different presets and share them easily between scenes. If unity team would consider something like this would be great.
     
    NeatWolf likes this.
  25. dhaynes89

    dhaynes89

    Joined:
    Mar 14, 2014
    Posts:
    3
    This took me 30 seconds to hook up and it works like a charm. Thank you!
     
    Peter77 likes this.
  26. Deleted User

    Deleted User

    Guest

    It doesn't work with 2018.2 anymore, The class LightmapEditorSettings is a static one now and can therefore no longer be passed as generic parameter
     
    mandisaw and Peter77 like this.
  27. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,086
    Thanks for the info. I will take a look at this later this weekend and post here if I've added 2018.2 support or if it's not possible anymore.
     
  28. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,086
    I fixed the issue and it does work with Unity 2018.2.0b9 now. See here for download link.
     
    Last edited: Jul 4, 2020
  29. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,158
    Not sure why Unity doesn't make this a bit easier to manage. In my view, it shouldn't be static, ever. In fact the whole concept of prefabs and scenes are in general holding back performance anyway...
     
    joshcamas likes this.
  30. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,086
    What exactly do you mean with "concept of prefabs and scenes are in general holding back performance"?
     
  31. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,158
    Scenes are a bloated system, and what ECS shows me is that it would be better to work with data itself rather than have anything scene based or static at all.
     
  32. Deleted User

    Deleted User

    Guest

    @Peter77 nice one, I will grab it on Monday.
     
    Peter77 likes this.
  33. mandisaw

    mandisaw

    Joined:
    Jan 4, 2018
    Posts:
    54
    @Peter77 Thanks for this - it's one of those, "didn't realize I wanted it, until I needed it", sort of tools. But I like @YoungDeveloper's idea of making an Asset variant as well, and wouldn't mind sharing that when it's done.
     
    Peter77 likes this.
  34. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,163
    Awesome, been using this for a while but it broke. So glad someone figured out how to fix it!
     
  35. Alejandro-Martinez-Chacin

    Alejandro-Martinez-Chacin

    Joined:
    Oct 15, 2013
    Posts:
    109
    Have a like.
    Works perfectly fine. Thanks a lot.

    For those suggesting duplicating and adding objects manually. Sometimes we work in teams on different parallel scenes, some gameplay tests, some lighting look here, post processing there, particle gyms, so on and so forth. Mixing everything on a single scene is sometimes a very painful task... not being able to copy the lighting settings just made it even worse.

    Thanks to Peter, our hero of the day.
     
    Peter77 likes this.
  36. bansheesoft

    bansheesoft

    Joined:
    Oct 3, 2014
    Posts:
    59
    Thanks so much still works great. This should be a unity tool by default.

    Great Job!
     
    Peter77 likes this.
  37. TheSenpaiCode

    TheSenpaiCode

    Joined:
    Jan 21, 2016
    Posts:
    50
    @Petter77 Great job for taking the initiative and making this. Also thanks for keeping it up to date during new versions of unity.
     
    Peter77 likes this.
  38. RG_Keith

    RG_Keith

    Joined:
    Mar 14, 2017
    Posts:
    35
    @Peter77 You just saved me a chunk of time, thanks a lot!
     
    Peter77 likes this.
  39. RMGK

    RMGK

    Joined:
    Sep 30, 2011
    Posts:
    68
    And you win the prize! Thank you so much. Working for me in 2018.2.10f1
     
    Peter77 likes this.
  40. ercion

    ercion

    Joined:
    Aug 15, 2016
    Posts:
    73
    I used to do it by editing the scene file but they started to open in binary lately. It's a good thing that I found your post. Now I can edit them again :)
     
  41. starvanger

    starvanger

    Joined:
    Oct 4, 2010
    Posts:
    18
    Works and saves a lot of time.

    Thanks a lot
     
    Peter77 likes this.
  42. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    330
    I wonder why this thread was closed:
    https://forum.unity.com/threads/war...up-has-inconsistent-lighting-settings.527997/

    Unity should not complain about different lighting settings AT ALL if there is not a single game object on the second scene that might be affected by lighting. It seems loading UI in separate scenes is a pretty common practice.

    For new games on 2018.3 this might not be an issue if you make all your UI as a root prefab using nesting, but not everybody is willing to upgrade from 2018.2 and for existing projects it's not viable to remake everything from scenes to prefabs just because you can, it may take too much time.

    PS: of course Unity should provide some button to copy/paste any scene-specific data, it's wrong that users have to use 3rd-party tools for such basic scene manipulation.
     
    sivrikaya likes this.
  43. frnkundrwd

    frnkundrwd

    Joined:
    Mar 11, 2018
    Posts:
    5
    Works great in 2018.3.6f1 as well! Thanks.
     
    Peter77 likes this.
  44. JenDoodle

    JenDoodle

    Joined:
    May 19, 2015
    Posts:
    4
    Marry me
     
    phobos2077, joshcamas and Peter77 like this.
  45. darbotron

    darbotron

    Joined:
    Aug 9, 2010
    Posts:
    319
    @Peter77 - nice one!!

    Total life saver, well, saved me hours of my life at least ;) Extra bonus points for you!

    Do you have ko-fi or similar?

    Also your memory profiler thing looks awesome too, not tried it yet.
     
    Peter77 likes this.
  46. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,086
    I've improved the tool by adding functionality to paste settings to all open scenes. The new menu item is called "Paste Lighting Settings in open Scenes". If your levels are built with many scenes, this will make it much easier/faster now.

    You can find the download link here:
    https://forum.unity.com/threads/copy-lighting-settings-from-scene-to-scene.308634/#post-3271269
     
  47. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    316
    Thank you so much for this very useful tool. :)
     
    Lars-Steenhoff and Peter77 like this.
  48. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    915
    And, thank you from me as well, wish I could reference the data externally with a ScriptableObject, so every scene in the game (of a certain category) gets automatically in sync!

    Does that copy Occlusion/Pathfinding settings as well? (are they per-scene, right? I'm in doubt now) :D

    This should be available out of the box, via static settings, not with copy/paste data duplication! :/

    You click on the Scene asset in the Project tab - and you get a list of static references to scene settings, instead of a blank panel :/
     
    Peter77 and Lars-Steenhoff like this.
  49. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,086
    Thanks! :)

    I guess that should be do-able. If there is enough interest, I could take a look at it.

    Not that I know of.
     
  50. UzairHassan11

    UzairHassan11

    Joined:
    Sep 3, 2019
    Posts:
    3
    Peter77 likes this.
unityunity