Search Issue Tracker
By Design
Votes
0
Found in
2017.3.0a1
2018.1.0a1
2018.2.0a1
2018.2.3f1
2018.3.0a1
2019.1.0a1
Issue ID
1077243
Regression
No
Calling AssetDatabase.Refresh after ScreenCapture.CaptureScreenshot does not import the captured screenshot
How to reproduce:
1. Open tester-submitted project (CaptureScreenshotAndRefresh)
2. Open Scene 'SampleScene'
3. Enter Play Mode and press 'O'
Expected result: the screenshot, taken via ScreenCapture.CaptureScreenshot appears in the Assets folder
Actual result: the screenshot, taken via ScreenCapture.CaptureScreenshot does not appear in the Assets folder
Reproducible with: 2017.4.14f1, 2018.1.9f2, 2018.2.16f1, 2018.3.0b10, 2019.1.0a9
Notes:
The screenshot is imported when the capturing and refreshing is performed in an IEnumerator coroutine with a yield return
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
- "NullReferenceException: Object reference not set to an instance of an object" error is thrown when attempting to remove a binding in the UIBuilder for a UxmlObjectReference
- Missing script error when clicking “script” link in Cave scene’s Water Sample Description
- [VFX Graph] Set Position Shape Gizmo isn't refreshed after shaper switch
- NullReferenceException is thrown when trying to access volumeStack from the HDCamera class
- Visual artifacts appear when using an Orthographic camera with a Reflection Probe
Resolution Note:
Currently this behaviour is By Design - the screenshot generation is done asynchronously in the background in order not to block the application. Adding a blocking version of the API is possible, though unlikely to happen in the short term (we are currently rewriting the asset database and we will only address new feature requests late next year). A coroutine approach makes sense as a workaround, as the user can wait for the file to be written to disk before calling Refresh.