Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug Theme style sheet loses reference to style sheets on rename/move of .uss => "Invalid Asset Path"

Discussion in '2022.2 Beta' started by CodeSmile, Dec 4, 2022.

  1. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,005
    Unity 2022.2.0b16.112.5806

    I have a "Theme Style Sheet" .tss asset and a "Style Sheet" .uss asset.
    In the theme asset's Inspector there is a list of "Style Sheets" and a .uss style sheet asset is listed in there.

    If I move, rename, or change the path to said .uss style sheet I'll get a warning "invalid asset path" in the console. Going back to the theme style sheet inspector it shows the style sheet asset as "(Missing Reference)".

    NOTE: to see the broken reference in the theme you may have to unselect and select the theme style sheet . The Inspector won't refresh the dependencies list when it's currently visible.

    Merely undoing the path or filename change of the .uss also won't make the .uss asset re-appear in the theme's list - the reference is lost due to the path to the referenced asset no longer valid. This shouldn't happen obviously. It requires selecting or dropping the referenced .uss file to the list again.

    It reminds me of the early days of Assembly Definition Files, where they too did lose referenced dependencies when renaming an asmdef that was referenced. In both these cases there is (was) some sort of reliance on the asset's path.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,005
    No shizzle, this happens in 2021.3.15f1 too. :confused:
     
  3. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,005
    Same behaviour with "Inherited Themes" and .tss files with one notable oddity: if the reference to a .tss file is lost, the theme will actually list a "missing reference" under Style Sheets rather than under Inherited Themes.
     
  4. sebastiend-unity

    sebastiend-unity

    Unity Technologies

    Joined:
    Nov 9, 2015
    Posts:
    184
    Hi CodeSmile,

    Thanks for the detailed info. Even though it’s “known”, I think there is a lot of value in submitting a bug for this; I may not have a direct answer for you right now, as we are looking for different ways to address this, but I agree with you, this is a v1/early stages kind of bug that needs a solution. Reporting a bug externally will also ensure that the issue is treated with the correct priority. You can add both behaviors (including the missing reference oddity mentioned in your 3rd message) in the same bug. Thanks!
     
  5. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,005
    Is there a public issue tracker link available? Especially to get notifications.

    I'll see to it that I make a simple example project to submit a bug report. I always hesitate to use the Bug Reporter in actual projects simply because it's taking so long (mostly compressing & upload the project).
     
  6. CitrioN

    CitrioN

    Joined:
    Oct 6, 2016
    Posts:
    101
    Any news on a fix for this? It's a pretty annoying issue to work around. It's also surprising to me how the serialization was approached here which is the issue for all this. Usually references are serialized using guids but ThemeStyleSheets use the actual paths. What was the reason to use this approach instead of the guid approach like with most other files?