Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Frequent instances of "the following immutable asset(s) were unexpectedly altered..."

Discussion in 'Editor & General Support' started by chemicalcrux, Jan 15, 2023.

  1. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    I am working in Unity 2022.2.2, on both Windows and macOS. I'm using the HDRP in a 3D project.

    Unity frequently displays a prompt saying that it is importing packages after I hit save. After the prompt goes away (it's very quick), I see a warning:

    The package cache was invalidated and rebuilt because the following immutable asset(s) were unexpectedly altered:
    Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/Material/DefaultHDMaterial.mat

    It's pretty much always that one material. I do not understand what is happening to the material -- I noticed that the md5 of the material file does change when this error comes up, so something is happening, but I have no clue why it would be getting changed.

    I thought this could be because of the HDRP wizard getting a bit too eager when looking for things to upgrade, but it happens over and over!

    I'm unclear how specific it is to my project. I'm pretty sure I've seen it in other projects.

    I guess I could try to use the profiler to see when the file is getting written to, but I have not tried to do that yet.

    Anyone else seeing this? It is harmless, but annoying.
     
    OBiwer likes this.
  2. OBiwer

    OBiwer

    Joined:
    Aug 2, 2022
    Posts:
    61
    I see the same warning. also have no real clue, it might be that I'm changing the sharedMaterial somewhere where the DefaultHDMaterial.mat is assigned, though. (have not checked that yet)
     
  3. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    Ah, that's a thought...perhaps I have something that's touching it. I know I used to be directly editing materials in other places, creating lots of version control churn.

    I don't have any references to the material in the current scene, though.
     
  4. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    I've worked out my problem, at least!

    I'm using PoseidonCSG, which does magic(tm) to do unions and differences of geometry. I worked out that it wanted to do something to the default HD material (whether or not it was on a mesh being modified).

    And, indeed, there was one cube in my scene that used the material from the package!

    It turns out I didn't experience this in the past because I also have a copy of the material (with the same name, of course) in my assets folder :p

    Thank goodness I worked this out, too -- making a new asset would trigger two reinstalls of packages, followed by two script reloads!
     
    halley likes this.