Search Issue Tracker
Won't Fix
Votes
1
Found in
5.4.0b18
Issue ID
801797
Regression
No
Scene is instantly marked dirty when opened if any object is affected by both a ContentSizeFitter and VerticalLayoutGroup
How to reproduce:
1. Open the attached project
2. Drag the two scenes into the Hierarchy "temp" and "temp2"
3. Select the green box and enable the ContentSizeFitter, so that it resizes itself vertically based its contents. ("Canvas" > "Example Prefab" > "GameObjWithProblem")
4. Hit Ctrl+S to save the scene
5. Right click on the "temp" scene again then click GameObject > Create Empty and save the scene
6. Hit Delete to destroy the created GameObject and save the scene again
7. Right click on the "temp" scene in the Hierarchy tab then click Unload Scene to unload it
8. Right click it again then click Load Scene to reload it.
9. Notice that the scene WAS instantly marked dirty! This will now happen every time the scene is reopened
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
- Editor crashes on StoredGraphicsBuffer::GetGfxBufferID when VFX Graph property is modified during Play Mode and Application.targetFrameRate is used to limit FPS
- Crash on NVAPI_Thunk when changing Player resolution while HDR display is used and Direct3D12 is set as the graphics API
- Only one out of multiple cameras is shown in the Play Mode while HDR display is used and Direct3D12 is set as the graphics API
- The "Paste Component as New" option is incorrectly displayed as active despite the action being prohibited
- "TLS Allocator ALLOC_TEMP_TLS" errors are thrown when unsuccessfully importing an FBX file
cp-
Oct 15, 2020 09:16
@DrunkenMastah thanks for the pointer.
I modified the class to my needs, just throw it into an Editor folder. It will log warnings when there is something dirtying the scene <1 second after saving it:
https://gist.github.com/krisrok/eaa8b227b62e19555c5aefe86c5b6618
Nodrap
Aug 13, 2020 16:08
Also caught by this 2019.4.5 and can't get the workaround working. I now cannot use a plugin that searches for references (AssetUsageDetector - a VERY useful tool) as it requires you to save the scene before it starts - and when you do it marks it dirty and so the tool thinks I haven't.
I really hope Unity notices when a bug report is still getting comments that now are more than 2 pages. Surely a basic flag that users are not happy.
chatrat12
May 07, 2019 12:31
Can we get the reasoning for the decision not fix this? Is the fix too complicated?
DrunkenMastah
Mar 04, 2019 00:02
After searching the forums I came across this little post by
arelian11 ยท Feb 05, 2015 at 10:29 PM
https://answers.unity.com/questions/801464/get-dirty-state-from-a-scene.html
Workaround Solution:
Attach this to a game object in your scene and save the scene.
Now every time you compile and if you scene is marked dirty it will be detected by this code and logged.
Click on the logged line in console and it will point you the offending gameobject that is marking the scene dirty.
Next, check the parent of the target game object of grandparent or so on...and if you see that it has a scroll rect, fix the floating values on the scroll rect to be rounded integers instead of floating values.
This will fix the bug and the scene won't be marked dirty anymore.
My scene had 30 or so objects that had this problem fixed it in 5 mins. No more version control bloat and more problems in sharing scene file.
<code>
public class SceneDirtyFlagChecker : MonoBehaviour
{
private static bool sceneIsDirty;
static SceneDirtyFlagChecker()
{
Undo.postprocessModifications += OnPostProcessModifications;
}
private static UndoPropertyModification[] OnPostProcessModifications(UndoPropertyModification[] propertyModifications)
{
sceneIsDirty = true;
Debug.LogWarning($"Scene was marked Dirty by number of objects = {propertyModifications.Length}");
for (int i = 0; i < propertyModifications.Length; i++)
{
Debug.LogWarning($"currentValue.target = {propertyModifications[i].currentValue.target}", propertyModifications[i].currentValue.target);
}
return propertyModifications;
}
}
</code>
DrunkenMastah
Mar 03, 2019 22:38
2018.3.6f1 same issue. ScrollRect is causing it. Source control is bloated. Workflow is bad. How is this a Won't fix?
Amazi
Feb 19, 2019 23:37
Why is this a Won't Fix? It's extremely frustrating and like others have questioned, is this behavior OK?
RandomComm3nt
Feb 10, 2019 09:10
Also happening for me in 2018.3.0f2. As per BCook99's comment, this is annoying when using source control
virgiliunov
Jan 31, 2019 09:33
This is happening in 2017.2 as well. WONTFIX? Lame!
Forest3
Jan 09, 2019 14:31
A workaround for this is to identify the component that is making your scene dirty (in my case a ScrollRect), disable in the editor, and enable on Awake.
private void Awake()
{
GetComponent<ScrollRect>().enabled = true; //disabled in editor as per unity bug
}
If anyone in Unity reads this, it would be good if you care about at least giving a workaround when you mark something as a "Won't Fix", consider the person that logged the issue spent time figuring our what was going, it was thanks to that person I found that my ScrollRect was the problem.
sunyifeng
Sep 14, 2018 03:07
Same issue on 2018.2.3...