Search Issue Tracker

By Design

Votes

0

Found in

2018.2.0x

Issue ID

1063806

Regression

No

[Backend] PrefabUtility.CreatePrefab returns null when called from ScriptedImporter.OnImportAsset

Asset - Database

-

How to reproduce:
1. Open the "CreatePrefab.zip" project
2. Delete "Assets/MyPrefab" asset
3. MyCustomMenu > Create Prefab, notice that no errors are thrown
4. Delete "Assets/MyPrefab" asset
5. Reimport "Assets/MyCustomAsset", notice the "prefab == null" error

Actual result: PrefabUtility.CreatePrefab references to null if called via ScriptedImporter.OnImportAsset
Expected result: PrefabUtility.CreatePrefab should refer to the recently created prefab

Reproducible with: 2018.3.0a6, 2018.2.0x-ImprovedPrefabs.
Not reproducible with: 2018.2.1f1, 2018.1.9f1, 2017.4.8f1.

Notes:
MyCustomImporter.cs calls "CreatePrefab()" (line 20) function on reimport or when "Create Prefab" menu option is pressed, which creates prefab.

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.