Search Issue Tracker

By Design

Votes

0

Found in

2019.2

2019.3.0f6

2020.1

Issue ID

1219721

Regression

No

Missing refernces when reimporting many ScriptedImporter Assets

Asset - Database

-

Steps to reproduce:
1. Open user-supplied project
2. Inspect the Data folder

Expected: Scriptable object references match with what has been imported
Actual: notice that the Scriptable objects have different references than their import settings (see attached pictures).

Reproduced in: 2019.2.21f1, 2019.3.2f1, 2020.1.0a23
Not reproduced in: 2017.4.37f1 (assets break), 2018.4.17f1 (assets break)

Note: reimporting a single Asset will resolve the mismatch, however after "Reimport all" the references are mismatched again

  1. Resolution Note (2020.2.X):

    When you create a managed reference to an asset in your importer the asset needs to be loaded which means it has to be already imported.
    So it would seem this is an import order problem.
    And if it was only that then you could solve it with GatherDependenciesFromSourceFile making the referenced assets an import dependency.
    But it's more complicated than that since in your case the assets can reference each other in a cycle.
    And of course you can't create a cyclic dependency between assets.
    I suggest to take a look at LazyLoadReference<> and see if you can handle asset references through this class (both edit time and import time).

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.