Search Issue Tracker

Won't Fix

Votes

0

Found in

2021.3.30f1

2022.3.8f1

2023.2.0b7

2023.3.0a3

Issue ID

UUM-47606

Regression

No

Material override is reset after subsequent drag operation hovers over Scene view

--

-

Steps to reproduce:
1. Open the attached user project "DecalGlitch 2.zip"
2. Open the scene "1_HouseOriginal.unity"
3. Enable the MaterialDropper script using the top menu bar ‘MaterialDropper > Enable’
4. Drag the 'test 1' Material on to the red/black strip
5. Observe logs in the console and the wall behind it goes black
6. Start to drag 'test 2' Material over the Scene view
7. Observe the wall returns to it's original material

Expected results: material override remains when performing subsequent material drag operation
Actual results: material override gets reset when performing subsequent material drag operation (See attached Repro.mp4)

Reproducible with: 2021.3.30f1, 2022.3.8f1, 2023.1.1f10, 2023.2.0b7, 2023.3.0a3

Reproducible on: Windows 10 2H22
Not reproducible on: No other environment tested

Notes:
-This test is inconsistently repeatable with the 2_HouseMinimal and 3_Plane scenes (if it's not reproducing, reloading the project or changing scenes sometimes fixes this)

  1. Resolution Note:

    This seems to be an issue with the user's script. It can be shown that sometimes the user's code is calling PrefabUtility.RevertPropertyOverride and sometimes it is manually setting the material. When the material "reverts", it is calling PrefabUtility.RevertPropertyOverride which sets the value back to what was in the prefab which has not been changed. This can be shown by logging what materialIndex is changed.

    Another way to show this is by just changing MaterialBackup::Restore to always call MaterialDropper.SetMaterial, in this case the script seems to behave as expected.

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.