Search Issue Tracker

By Design

Votes

0

Found in

2019.3

2019.3.0f6

2020.1

Issue ID

1215741

Regression

No

Modifications to textures with AssetDatabase.ForceReserializeAssets() reset upon restarting Editor when using Asset Database v2

Asset - Database

-

How to reproduce:
1. Open the project from the attached file "1215741.zip"
2. Expand the TestSquare.png file in the Assets folder
3. Right-click on the TestSquare sprite(the file that appears after expanding)
4. From the dropdown, select "Modify UV"
5. Close and re-open the same project
6. Inspect the Scene View

Expected result: The sprite looks the same as before closing the project
Actual result: Sprite has returned to its initial value

Reproducible with: 2019.3.0f6, 2020.1.0a23
Could not test with: 2017.4.37f1, 2018.4.17f1, 2019.3.0a1(Asset Database v2 not introduced)

Note: Texture Type of the texture has to be set to Sprite(2D and UI)

  1. Resolution Note:

    Sprite is and imported asset from texture file. It is generated and immutable. Modifying it by script will work for as long as asset is not reimported again or library is not deleted. Changing ADB versions make this "bug" appear just because we reimport all assets. Script made changes to sprite would disappear as well after manual reimport was triggered via context menu item.

    For such use cases AssetPostprocessor.OnPostprocessTexture or OnPostProcessAllAssets should be used. (preferably first one). More information here: https://docs.unity3d.com/ScriptReference/AssetPostprocessor.OnPostprocessTexture.html

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.