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
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.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Add comment