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

Reimporting Small Assets

Discussion in '2017.2 Beta' started by edwardrowe, Sep 6, 2017.

  1. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    I have a few scripts that call OnValidate and change various things on sibling components or the GameObject. For example:

    Code (CSharp):
    1.     protected void OnValidate()
    2.     {
    3.         // Keep lights off in editor for now cause it's annoying to see them
    4.         this.SpriteRenderer.enabled = false;
    5.     }
    In 2017.1 I noticed this started to mark my assets dirty regardless of if the SpriteRenderer was already disabled, but only on the first reimport (save). The symptom of this is that I will see the Reimporting Small Assets dialog, and the OnPostprocessAllAssets callback reports them as importedAssets the first time I called OnValidate on the object (which happened when loading a scene with the objects in them). Has anyone else noticed this? Did something change with the way Unity marks objects dirty?

    * Edit * Actually, I can't say this was related to 2017 at all. Doing this type of operation in OnValidate may have always triggered a reimport. But I'm leaving this here as it's possibly helpful in understanding the issue I'm seeing in 2017.2b with the DynamicsManager.asset and Physics2DSettings.asset

    In 2017.2b I'm seeing something similar with my ynamicsManager.asset and Physics2DSettings.asset, only I can't track down what's causing them to get reimported. Is anyone else having these assets reimported constantly, even though they haven't changed? Basically every time I save it tries to reimport them.

    Disclaimer: It's very possible this is due to some plugin that I've downloaded. But so far I haven't been able to track anything down that's affecting it.
     
    Last edited: Sep 6, 2017
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Hi Edward,
    The devs said this is "usually caused by the user having a postprocessor or other script touching materials or prefabs without reimporting".
     
  3. edwardrowe

    edwardrowe

    Joined:
    Feb 11, 2014
    Posts:
    52
    Thanks for the response. It sounds like it's not a known issue and therefore is likely something on my end. I'll continue to investigate and add a reply if I can track it down.
     
    LeonhardP likes this.