Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

ContentSizeFitter makes scene dirty!?

Discussion in 'Unity UI & TextMesh Pro' started by rakkarage, Nov 30, 2014.

  1. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    682
    I guess it is because it uses [ExecuteInEditor]?
    Is there any way around this?
    Is it a bug?

    Note: To replicate, must change horizontal or vertical to something other then (than?) unconstrained.
     
    Last edited: Nov 30, 2014
  2. BMayne

    BMayne

    Joined:
    Aug 4, 2014
    Posts:
    186
    Hey There,

    Looking at the code it seems that ContentSize fitter is missing the DrivenRectTransformTracker. This class is used to stop Unity from serializing values that are driven. You could always extended the class or get the 4.6 source code and add that component.
     
    rakkarage likes this.
  3. BMayne

    BMayne

    Joined:
    Aug 4, 2014
    Posts:
    186
    After playing with it I was wrong. It does seem to have a DrivenRectTransformTracker. It's watching W Delta and H Delta.
     
  4. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,536
    Yes, it's a bug. Thanks for the bug report you submitted to our bug tracker rakkarage, we're looking into it.
     
    rakkarage likes this.
  5. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,536
    We've identified and fixed the bug. The fix will be in one of the coming patches or releases (it didn't make it for patch 1).
     
    rakkarage likes this.
  6. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    682
    this used to be fixed, for a while
    now back in 5?
    thanks
     
  7. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,536
    Using your original bug report, I can't reproduce the issue in the latest version of the codebase we have. It's possible some fixes in 4.6 patch releases didn't make it to all versions of 5.x, but the fix will make it out sooner or later anyway (if it's not out already).
     
    rakkarage likes this.
  8. gadgetking

    gadgetking

    Joined:
    Oct 6, 2016
    Posts:
    1
    I seem to have this behaviour on 2017.3.0f3 (64-bit)
     
  9. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,073
    Also, when you select something, sometimes, an action called "Driving RectTransform" makes the scene dirty too.

    2017.3.0f3
     
  10. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,073
    Any news on this?
     
  11. AlexandreT-unity

    AlexandreT-unity

    Unity Technologies

    Joined:
    Feb 1, 2018
    Posts:
    11
    There is a fix related to driven properties making the scene dirty in 2017.3.1p1.
     
    Rodolfo-Rubens likes this.
  12. Cathero

    Cathero

    Joined:
    May 3, 2018
    Posts:
    3
    In 2018.1, the issue of "Driving RectTransform" causing Scenes to me marked as dirty upon scene-load is still (or again?) present.
     
    rakkarage likes this.
  13. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    320
    I have the same or similar issue with 2018.2.5f1.

    I'm using the content size fitter on the content within a scroll view. When I perform a build or reload the assembly, the scene is marked dirty. If the content size fitter is disabled, the scene remains untouched. The issue is likely related to the Canvas Scaler, because when I remove the Canvas Scaler, the problem seems to disappear.

    Reproduction project was reported (FogBugz 1081130).
     
    Last edited: Sep 14, 2018
  14. noio

    noio

    Joined:
    Dec 17, 2013
    Posts:
    85
    Experiencing the same issue under 2018.2.8f1..

    It's quite annoying when Running Tests as well, because you have to go through an "Are you sure you want to close scene?" dialog every time you run the test.
     
    Cathero and Rodolfo-Rubens like this.
  15. NobleRobot

    NobleRobot

    Joined:
    Jan 14, 2016
    Posts:
    29
    Having the same issue in 2018.2.13. Hoping there's something I can do as a workaround as this seems to be an un-squashable bug.
     
    amcakebread likes this.
  16. asger60

    asger60

    Joined:
    Mar 27, 2013
    Posts:
    3
    and now in 2018.3.1f1
    pretty persistent bug.. almost 5 years now :-/
    it's very annoying!
     
  17. iMobCoding

    iMobCoding

    Joined:
    Feb 13, 2017
    Posts:
    24
    Yes, it comes and goes all the time. I waste hours sometimes to go around this bug so my scenes don't mess my repository
     
  18. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    320
    I faintly remember, was there some kind of workaround how to prevent the ContentSizeFitter within a ScrollView from dirtying the scene?

    This still bugs my team in every project. Having a ContentSizeFitter within a scroll rect is such a nice an easy setup for log displays etc, but it can get a little frustrating when the scene has to be either saved or discarded so often because people tend to lose track of whether they have actually made changes that need to be comitted or not.

    Edit: My workaround was to only enable to ContentSizeFitter at runtime and have the component disabled while in edit mode.
     
    Last edited: Mar 19, 2019
  19. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,536
    If you're still seeing this issue in 2018.3.9 or later, please let us know.
     
  20. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    320
    I tested with 2018.3.9f1 today and still experienced the issue. Reproduction case 1138488.
     
    runevision likes this.
  21. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,536
    Thanks for the repro. This seems unrelated to the fix in 2018.3.9 which only happens for Prefab instances. I've talked with the UI Team about how to fix this bug you reported.

    As a side note it seems to already have been fixed in upcoming 2019.2 (I didn't check 2019.1), but of course the fix should be backported.
     
    Xarbrough likes this.