Search Issue Tracker
By Design
Votes
0
Found in
2020.3
2020.3.25f1
2021.2
2022.1
2022.2
Issue ID
1395773
Regression
No
Prefab Variant isn't reimported after ScriptedImporter result changes
Reproduction steps:
1. Open project "SIOrder"
2. Reimport "Assets/DependsOnSphere-c1 Variant" (Right-click > Reimport)
3. Reimport "Assets/SpherePrefab"
Expected result: The "DependsOnSphere-c1 Variant" GameObject's material does not get removed
Actual result: The "DependsOnSphere-c1 Variant" GameObject's material gets removed
Reproducible with: 2020.3.31f1, 2021.2.15f1, 2022.1.0b11, 2022.2.0a8
Could not test with: 2019.4.36f1 (Compilation errors: Assets/Editor/CustomImporter1.cs(9,40): error CS0246: The type or namespace name 'AssetImportContext' could not be found (are you missing a using directive or an assembly reference?))
Notes:
-Reimporting "Assets/DependsOnSphere-c1 Variant" again makes "DependsOnSphere-c1 Variant" GameObject's material appear
-If the issue is not reproducible on the first try, do steps 2-3 again
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Fixing Message Loss in UMPE During Domain Reload
- The Editor freezes when ScheduleReadOnly of IJobParallelForTransform with dependency is used
- Text is truncated in the Inspector when the display scale is set to 150%
- CancellationTokenSource(<timeout>) has incorrect cancellation status when used in WebGL Player
- VFX property value names are cut off when properties with 'Arc' are viewed in the VFX Blackboard
Resolution Note:
To fix the issue:
In CustomImporter0.cs change:
From:
[ScriptedImporter(0, ".custom-0", importQueueOffset: 1000)]
to
[ScriptedImporter(1, ".custom-0", importQueueOffset: 500)]
CustomImporter1.cs:
From:
[ScriptedImporter(0, ".custom-1", importQueueOffset: 1000)]
to
[ScriptedImporter(1, ".custom-1", importQueueOffset: 500)]
The first argument is the version number, this is not strictly needed but avoid any need to manually reimport the assets.
The importQueueOffset set to 500 is important for the resulting prefabs/variants to be processed with the other prefabs.