Search Unity

Rename Alder Tree Asset Without Ruining Lighting

Discussion in 'Immediate Mode GUI (IMGUI)' started by Venryx, Oct 7, 2012.

  1. Venryx

    Venryx

    Joined:
    Sep 25, 2012
    Posts:
    444
    (From Unity Answers: )

    I'm using the Alder tree model in my scene, the one from the Terrain Assets free package. It works fine, including the lighting.

    Then I change the file-name of the Alder asset. The lighting immediately gets messed up in the Scene view, and preview, with some areas of the leaves becoming far too bright.

    How do I rename the Alder tree asset without ruining its lighting? And why would the Alder tree be having this problem?
     
  2. Venryx

    Venryx

    Joined:
    Sep 25, 2012
    Posts:
    444
    Odd. I deleted the entire Terrain Assets folder, reimported it from a backup before the problem, and the messed-up lighting remains.

    The lighting problem persists, even when I delete the Alder instance in the scene, and drag a new one in from the newly imported Terrain Assets folder, which has exactly the same contents as the backup before the problem. So it seems as though the Unity IDE itself has a problem.

    Edit: Btw, I played around with some import settings, and the "messed-up lighting" is apparently identical to what happens when you check the "Swap UVs" checkbox on the Alder tree asset. Note that this, too, causes the same irrevocable change on the Alder tree's lighting.

    Edit 2: Did some more testing. Apparently, you can only fix the problem if you overwrite the Library folder with a pre-lighting-problem backup AND rebuild the program rather than simply run it in Unity. THEN the Alder tree's lighting will return to normal. Only way I've found so far. (other than performing a complete backup, which is ultimately the same solution)
     
    Last edited: Oct 7, 2012
  3. Venryx

    Venryx

    Joined:
    Sep 25, 2012
    Posts:
    444
    Well, I finally found a work-around, but it's very hacky.

    I used a Process Monitor to see what files were changed when I renamed the Alder asset file. After narrowing-down the results, the files in these two folders were the prime suspects: "Library/Previews/25" and "Library/metadata/25"

    To make a long story short, I replaced the "/metadata/25" folder with a backup prior to the lighting-problem/asset-rename, which kept the new Asset name while also fixing the lighting problem. (I had to rebuild the project for the changes to show up, though)
     
  4. Venryx

    Venryx

    Joined:
    Sep 25, 2012
    Posts:
    444
    Here's an image of the problem:

    My graphics: NVIDIA GeForce 6150SE nForce 430

    Bug report message:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    1) What happened

    I changed the import settings for the Alder Tree asset in the official Unity Terrain Assets package, which I got the latest version of on the Asset Store, and as soon as I hit Apply for the import settings changes, the lighting of the tree became messed-up, both in preview view and in-scene. More info here: http://forum.unity3d.com/threads/153928-Rename-Alder-Tree-Asset-Without-Ruining-Lighting

    Note that this problem happens with any import settings being changed, or even if you just rename the asset file in the project view. Also note that it only happens on some of the trees. (about half)

    My computer graphics: NVIDIA GeForce 6150SE nForce 430

    2) How can we reproduce it using the example you attached

    ^Read above.
     
    Last edited: Oct 16, 2012
  5. Deleted User

    Deleted User

    Guest

    I've got the same Problem, but no solution at all...

    My tree gets lighten up even if the flashlight does not hit it.
    Hope there will be a fix for it soon >.<

    I didn't rename my tree but I think I changed the import settings...
    Have you got a idea how to solve my problem? (Maybe explain your solution in detail) ^^

    Greetings,
    TheCSharpFreak
     
  6. Venryx

    Venryx

    Joined:
    Sep 25, 2012
    Posts:
    444
    Okay, first you need to find which files are being changed when you change the tree import settings. To do this, use a file monitor program, or just use the Resource Monitor program that comes with Windows.

    So, open Task Manager using Ctrl+Alt+Delete, click on the performance tab, press Resource Monitor, go to the Disk tab, open the Disk Activity section, and see which files are added to that list when you change the import settings in Unity.

    Once you figure out what files it's changing, either replace those files with backups, or I think it will also reset if you simply delete them, though I'm not sure so make sure you keep a backup of them if you try this.

    For me, the changed files were the files in these two folders: "Library/Previews/25" and "Library/metadata/25"

    And I eventually found out that I really only needed to replace the files in here: "Library/metadata/25" So I don't think you need to mess with the Previews folder.

    I had to rebuild the project for the changes to show up, though. I think closing and reopening Unity does too.