Search Unity

Prefabs are reimporting every time a code change is made

Discussion in 'Editor & General Support' started by L42yB, Jul 27, 2020.

  1. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34
    Since updating to 2019.4.4 we have been having an issue where any code change results in tons of prefabs reimporting. This has slowed us down immensely as it takes a few minutes to do this.

    You can literally just add a comment to any script, save, and click back on the editor. And it will reimport hundreds of prefabs for no reason.

    I have looked into which prefabs it is reimporting and which it isn't. The only common thread I can tell is
    1. All the prefabs that reimport have several sub objects inside them with 3D geometry
    2. Prefabs that were imported directly from FBX do not reimport
    3. Prefabs that have no 3D geometry at all do not reimport.

    I've used OnPreprocessAsset in order to see what information I can get about this, but beyond getting a list of the assets being imported I can't see anything useful in there.

    This is what is in the editor log:

    [MODES] Loading mode Default (0) for mode-current-id-GameName
    Mono: successfully reloaded assembly
    - Completed reload, in 6.276 seconds
    Platform modules already initialized, skipping
    Start importing Assets/Content/Asset1.prefab using Guid(936b5ce92c8989446a91ca27a4f6cc37) Importer(-1,00000000000000000000000000000000)
    Done importing asset: 'Assets/Content/Asset1.prefab' (target hash: '98681aa5cc104a34a05a26eae22a3ee0') in 0.114920 seconds
    Start importing Assets/Content/Asset2.prefab using Guid(936b5ce92c8989446a91ca27a4f6cc37) Importer(-1,00000000000000000000000000000000)
    Done importing asset: 'Assets/Content/Asset2.prefab' (target hash: '98681aa5cc104a34a05a26eae22a3ee0') in 0.114920 seconds

    And then hundreds more similar lines for each prefab it reimports.

    What is causing this? How can I fix it? Having the team wait minutes after each code change is killing us.
     
  2. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34
    I have managed to fix this issue for now by reverting to Asset Database version 1. So whatever the problem is, going to Asset Database v2 is what caused it. As version 1 is deprecated, this isn't a great long term solution, as it may prevent us from upgrading the editor in future.
     
    lucianlpt likes this.
  3. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34
    Bumping for justice. I've seen a few other people who have this issue. Is anyone aware of a fix that will allow us to move to asset database v2 without getting the constant reimports?
     
  4. jturner221

    jturner221

    Joined:
    Aug 30, 2017
    Posts:
    17
    We are also experiencing this exact issue. It is crippling to development. Our logs look identical it just tells us the importing is happening.
     
    L42yB likes this.
  5. jturner221

    jturner221

    Joined:
    Aug 30, 2017
    Posts:
    17
    Switching to v1 asset database resolved this issue for us.
     
  6. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hi @L42yB ,

    A while ago we introduced a change which had to do with fixing a particular pain point where Scripts belonging to prefabs were not reimporting the prefabs needed, which had to do a lot with missing references:

    Forum post for Addressing issues with missing references

    However, that should only trigger Prefab re-imports when code a Prefab depends on is changed.

    Say you have Prefab A, and it has Script B as a component.
    Changing B should re-import the Prefab.
    However, changing another Script, such as Script C should NOT re-import the prefab. Is this what you're seeing? That Scripts that have nothing to do with a prefab are re-importing all the prefabs?

    If you have the Editor.Log we can have a look at it and try to reason why other Prefabs are getting imported.
     
  7. dirty-rectangle

    dirty-rectangle

    Joined:
    Apr 23, 2015
    Posts:
    78
    We have also been seeing prefab assets being continually reimported since switching to asset pipeline v2 (2019.4.4+)
    In the case of our Unity Cloud builds, some prefabs are being reimported twice during a single build each with different target hash values.

    1173: [Unity] Done importing asset: 'Assets/Lot_BU_D1_W1_CI_CityHall.prefab' (target hash: '3c1d9d6776446e0a2da805e6ed56c641') in 0.020791 seconds
    40606: [Unity] Done importing asset: 'Assets/Lot_BU_D1_W1_CI_CityHall.prefab' (target hash: 'd20d98ba8a43d4a24aa3dc056d88ce63') in 0.019573 seconds

    after switching back to asset pipeline v1 the Unity cloud builds are no longer reimporting these assets, this is the only log output for the same prefab

    792: [Unity] ----- Asset named Assets/Lot_BU_D1_W1_CI_CityHall.prefab is skipped as no actual change.
     
    rajantande likes this.
  8. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34
    Yes, literally making any code change to any script results in hundreds of prefabs being reimported every single time on Asset Database v2.

    I've attached the Editor.log file of this happening. In this test, I started the editor, made a very small code change (removing a Debug.Log()) and clicked back on the editor. And again, hundreds of assets reimported which you can see in the log. Please let me know if you have a fix for this. We are currently on 2019.4.8f1.
     

    Attached Files:

  9. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34
  10. mruiz2017

    mruiz2017

    Joined:
    Feb 22, 2017
    Posts:
    10
    This is also happening for us in 2019.4.10f1.
    Every time scripts change all prefabs are reimported in the same way as the logs above.
    Any news on this? It is a productivity killer
     
  11. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hi guys, apologies for the delayed response.

    @L42yB I can see from the log you supplied that you modify a C# script called
    Choreographer_MessageHandler.cs and then the import completes, and it looks like an Asynchronous Compilation is kicked off (I can see that because Begin MonoManager ReloadAssembly appears after the RefreshProfiler outputs its data).

    Then some log messages about switching region and network manager enabled come up, and finally the prefabs start getting imported.

    Can I just ask, can you run this snippet in your project and tell me what it outputs?

    Code (CSharp):
    1.     [MenuItem("AssetDatabase/PrintPrefabDependencies")]
    2.     public static void PrintPrefabDependencies()
    3.     {
    4.         var assetPath = "Assets/Resources/GUI/GeneratedCards/AbilityCards/Cragheart 141 - Brutal Momentum.prefab";
    5.         var dependencies = AssetDatabase.GetDependencies(assetPath);
    6.      
    7.         StringBuilder dependencyString = new StringBuilder();
    8.         dependencyString.Append($"Dependencies for {assetPath}");
    9.         dependencyString.AppendLine();
    10.      
    11.         foreach (var curDep in dependencies)
    12.         {
    13.             dependencyString.Append(curDep);
    14.             dependencyString.AppendLine();
    15.         }
    16.  
    17.         Debug.Log(dependencyString.ToString());
    18.     }
    If Choreographer_MessageHandler.cs then I would expect that the Prefab at hand does get re-imported, as it is dependent on that script.
     
  12. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34

    @Unity_Javier

    I have pasted the output below. The Choreographer_MessageHandler is definitely not a dependent script, that is our message processing script.

    Also, it doesn't matter what script I change, all those prefabs are reimported every time on any script.

    This also only happens on Asset Database V2. On Asset Database V1, there is no problem.

    Here is the output:

    Dependencies for Assets/Resources/GUI/GeneratedCards/AbilityCards/Cragheart 141 - Brutal Momentum.prefab
    Assets/Content/GUI/AbilityCardIcons/ConsumeEarth_Icon_Highlight.png
    Assets/ThirdParty/Beautify/Resources/Textures/flareNoise.png
    Assets/Content/VFX/GUI/Materials/GUI_Shine_Sphere_Add_Shd.shader
    Assets/Content/VFX/GUI/Materials/GUI_MiniCardEffect.mat
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_Background.png
    Assets/Script/VFX/MiniCardEffects.cs
    Assets/Content/GUI/AbilityCardIcons/Ice.png
    Assets/Content/GUI/AbilityCardIcons/Poison.png
    Assets/Script/GUI/Ability Card/EnhancementButton.cs
    Assets/Script/GUI/Ability Card/FullAbilityCard.cs
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_LeftDefault_Highlighted.png
    Assets/Content/GUI/AbilityCardIcons/CreateAir_Highlight.png
    Assets/Content/VFX/GUI/Materials/GUI_Shine_Sphere_Blend_Shd.shader
    Assets/Script/VFX/CardEffects.cs
    Assets/Content/GUI/AbilityCardIcons/ConsumeAir.png
    Assets/Content/GUI/Masks/UIMask.png
    Assets/Content/GUI/AbilityCardIcons/Light.png
    Assets/Content/GUI/AbilityCardIcons/ConsumeLight_Icon_Highlight.png
    Assets/Content/VFX/Common/Textures/T_Burn_Gradient.png
    Assets/Content/VFX/GUI/Materials/GUI_Consumable_Fire_Bloom_Mat.mat
    Assets/Content/GUI/AbilityCardIcons/ConsumeAir_Icon_Highlight.png
    Assets/Content/VFX/GUI/Materials/GUI_CardEffect_Underneath_Mat.mat
    Assets/Content/GUI/AbilityCardIcons/ConsumeIce_Icon_Highlight.png
    Assets/Content/GUI/AbilityCardIcons/ConsumeDark.png
    Packages/com.unity.ugui/Runtime/UI/Core/Image.cs
    Assets/Content/VFX/Common/Textures/T_flowmap_outwards.png
    Assets/Script/GUI/Additions/Raycast Filters/UIRectangularRaycastFilter.cs
    Assets/Content/GUI/AbilityCardIcons/ConsumeIce.png
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_Top_Highlighted.png
    Packages/com.unity.ugui/Runtime/UI/Core/Layout/ContentSizeFitter.cs
    Assets/Content/GUI/Ability Card Assets/Full/AC_Generic/AC_Generic_Buttons_Holder.png
    Assets/Content/GUI/Ability Card Assets/DiscardedCard_Transforming.png
    Packages/com.unity.ugui/Runtime/UI/Core/Layout/LayoutElement.cs
    Assets/Content/GUI/AbilityCardIcons/Strengthen.png
    Assets/Content/VFX/GUI/Materials/GUI_Initiative_Highlight_Sparks_Mat.mat
    Assets/Content/GUI/AbilityCardIcons/ConsumeEarth.png
    Assets/Script/GUI/Additions/UI/Tooltips/UITextTooltipTarget.cs
    Assets/Script/GUI/Ability Card/MiniAbilityCard.cs
    Assets/Content/VFX/Common/Textures/T_Noise_Spherical_Blur.png
    Assets/Resources/GUI/AbilityLayout/TMP_AbilityCardSprites.asset
    Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SubMeshUI.cs
    Assets/Content/GUI/AbilityCardIcons/Immobilize.png
    Assets/Content/VFX/GUI/Materials/AbilityCard_Add_Shd.shader
    Assets/Content/VFX/Common/Textures/T_Ring_Thick.png
    Assets/ThirdParty/KriptoFX/Realistic Effects Pack v4/Textures/PerlinNoiseAlpha.png
    Assets/Content/GUI/AbilityCardIcons/ConsumeLight.png
    Assets/Content/GUI/AbilityCardIcons/CreateEarth_Highlight.png
    Assets/Content/GUI/ElementInfusionBoard/multi.png
    Assets/Content/GUI/AbilityCardIcons/Disarm.png
    Assets/Script/GUI/Ability Card/UIElementHighlight.cs
    Assets/Content/GUI/AbilityCardIcons/Fire.png
    Assets/Content/VFX/GUI/Materials/GUI_FlexFrame_Shd.shader
    Assets/Content/GUI/AbilityCardIcons/+1Enhancement.png
    Assets/Resources/GUI/GeneratedCards/AbilityCards/Cragheart 141 - Brutal Momentum.prefab
    Assets/Script/GUI/WorldspaceUI/AttackValueBreakdown.cs
    Assets/Content/GUI/AbilityCardIcons/NoEnhancement.png
    Assets/Script/GUI/Ability Card/ConsumeElement.cs
    Assets/Content/VFX/Common/Textures/T_rect_frame_mask_card_wide.png
    Assets/Script/GUI/Ability Card/MiniAbilityCardIndicator.cs
    Assets/Content/GUI/AbilityCardIcons/ConsumeFire.png
    Assets/Resources/GUI/Icons/Jump.png
    Assets/Content/VFX/Common/Textures/T_disc_ring.png
    Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SpriteAsset.cs
    Assets/Content/GUI/AbilityCardIcons/CreateDark_Highlight.png
    Assets/Content/VFX/Common/Textures/Ring_Glow.png
    Assets/Content/VFX/GUI/Materials/GUI_Consumable_Fire_Sparks_Mat.mat
    Assets/Content/GUI/Ability Card Assets/Previews/Cragheart_ActiveAbility.png
    Assets/Script/VFX/UIFX_MaterialFX_Control.cs
    Assets/Script/GUI/GUIAnimation/LeanTween/LeanTweenGUIAnimator.cs
    Assets/Script/GUI/Ability Card/InfuseElement.cs
    Assets/Script/VFX/UIFX_Image_RectFormat.cs
    Assets/Content/VFX/GUI/Materials/GUI_Consumable_Earth_Wave_Mat.mat
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_LeftDefault.png
    Assets/Content/VFX/GUI/Materials/GUI_Bloomy_Sphere_Add_Shd.shader
    Assets/Content/GUI/AbilityCardIcons/CreateLight_Highlight.png
    Assets/Script/GUI/Ability Card/AbilityCardUI.cs
    Assets/Content/VFX/Common/Textures/T_flowmap_outwards_spotty.png
    Assets/Content/GUI/Ability Card Assets/Previews/AbilityCard_Mask.png
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_Top_Selected.png
    Assets/Content/GUI/Panel Assets/Panel_Arrow.png
    Assets/Content/GUI/Ability Card Assets/Previews/Elementalist_ActiveAbility_Highlighted.png
    Assets/Content/GUI/AbilityCardIcons/Air.png
    Assets/Content/VFX/Common/Shaders/GUI_Smoke_Shd.shader
    Assets/Content/GUI/AbilityCardIcons/Lost.png
    Assets/Content/VFX/GUI/Materials/GUI_Consumable_Earth_Sparks_Mat.mat
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_Top_Unavailable.png
    Assets/Script/VFX/UIParticleSystem.cs
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_Bottom_Highlighted.png
    Assets/Content/VFX/GUI/Materials/GUI_Initiative_Highlight_Wave_Mat.mat
    Assets/Resources/Fonts & Materials/MarcellusSC-Regular SDF.asset
    Packages/com.unity.textmeshpro/Editor Resources/Gizmos/TMP - Font Asset Icon.psd
    Packages/com.unity.ugui/Runtime/UI/Core/Button.cs
    Packages/com.unity.ugui/Runtime/UI/Core/RawImage.cs
    Assets/Content/VFX/Common/Textures/T_sphere_norm.png
    Assets/Script/GUI/Buttons/TrackedButton.cs
    Assets/Content/GUI/AbilityCardIcons/Round.png
    Packages/com.unity.ugui/Runtime/UI/Core/Layout/VerticalLayoutGroup.cs
    Assets/Content/GUI/Enchantment/AbilityCard_Glow.png
    Assets/Resources/Fonts & Materials/Sarala-Regular SDF.asset
    Assets/Content/VFX/GUI/Materials/GUI_CardEffect_Overlay_Mat.mat
    Assets/Content/VFX/GUI/Materials/GUI_ConsumeButton_Frame_Highlight.mat
    Assets/Content/GUI/AbilityCardIcons/PermanentlyLost.png
    Assets/Content/GUI/AbilityCardIcons/Any.png
    Assets/Content/GUI/AbilityCardIcons/Muddle.png
    Assets/Script/GUI/Ability Card/FullAbilityCardAction.cs
    Packages/com.unity.ugui/Runtime/UI/Core/Layout/HorizontalLayoutGroup.cs
    Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_FontAsset.cs
    Assets/ThirdParty/KriptoFX/Realistic Effects Pack v4/Textures/TornadoNoise.jpg
    Assets/Content/GUI/Ability Card Assets/Previews/Cragheart_Normal_Highlighted.png
    Assets/Content/GUI/AbilityCardIcons/Move.png
    Assets/Script/GUI/Ability Card/CardActionHighlight.cs
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_Top.png
    Assets/Content/GUI/AbilityCardIcons/CreateIce_Ice.png
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_RightDefault_Unavailable.png
    Assets/Script/GUI/Buttons/ExtendedButton.cs
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_LeftDefault_Unavailable.png
    Assets/Content/VFX/Common/Textures/T_rect_frame_mask_card_noisy.png
    Assets/Content/VFX/Common/Textures/T_Gradient_Glow_Fire.png
    Assets/Script/GUI/Ability Card/ConsumeButton.cs
    Assets/Content/VFX/GUI/Materials/GUI_ElementGlow.mat
    Assets/Content/GUI/AbilityCardIcons/AA_Add_Damage.png
    Assets/Content/GUI/AbilityCardIcons/Bless.png
    Assets/Config GUI/Audio/AbilityCard SFX Profile.asset
    Packages/com.unity.textmeshpro/Scripts/Runtime/TextMeshProUGUI.cs
    Assets/Content/VFX/GUI/Materials/GUI_MiniCard_Border_Bloom.mat
    Assets/Script/GUI/Configuration/AudioButtonProfile.cs
    Assets/Content/VFX/GUI/Materials/GUI_Card_Border_Bloom_Mat.mat
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_RightDefault_Highlighted.png
    Assets/Content/GUI/AbilityCardIcons/Curse.png
    Assets/Content/VFX/Common/Textures/T_Gradient_WhiteTransparent.png
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_Bottom_Unavailable.png
    Assets/Content/GUI/AbilityCardIcons/Dark.png
    Assets/Content/VFX/GUI/Materials/GUI_Initiative_Highlight_Bloom_Mat.mat
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_RightDefault.png
    Assets/Content/VFX/Common/Textures/T_Noise_Spherical.png
    Assets/Content/VFX/GUI/Materials/GUI_GreySmoke_Mat.mat
    Assets/Content/VFX/Common/Textures/T_flowmap_outwards_02.tga
    Packages/com.unity.textmeshpro/Editor Resources/Gizmos/TMP - Sprite Asset Icon.psd
    Assets/Content/VFX/GUI/Materials/GUI_FlexFrame_Mat.mat
    Assets/Content/VFX/GUI/Materials/GUI_Consumable_Fire_Wave_Mat.mat
    Assets/Content/VFX/Common/Textures/T_Noise_Spherical_Sparks.png
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_Bottom.png
    Assets/Content/GUI/AbilityCardIcons/ConsumeAny.png
    Assets/Content/VFX/GUI/Materials/GUI_GreySmoke_Blend_Mat.mat
    Assets/Content/GUI/Ability Card Assets/Full/Cragheart - Card Assets/AC_Cragheart_Bottom_Selected.png
    Assets/Content/GUI/AbilityCardIcons/ConsumeFire_Icon_Highlight.png
    Assets/Content/GUI/AbilityCardIcons/Damage.png
    Assets/Content/VFX/GUI/Materials/GUI_Mod_Bloom_Mat.mat
    Assets/TextMesh Pro/Resources/Shaders/TMP_SDF.shader
    Assets/Content/GUI/AbilityCardIcons/Wound.png
    Assets/Content/GUI/AbilityCardIcons/Earth.png
    Assets/Content/VFX/Common/Textures/noise_01.png
    Assets/Content/VFX/Common/Textures/T_rect_frame_mask_noisy_thin.png
    Packages/com.unity.ugui/Runtime/EventSystem/EventTrigger.cs
    Assets/Content/GUI/AbilityCardIcons/ConsumeDark_Icon_Highlight.png
    Packages/com.unity.textmeshpro/Editor Resources/Gizmos/TMP - Text Component Icon.psd
    Assets/TextMesh Pro/Resources/Shaders/TMP_Sprite.shader
    Assets/NatureManufacture Assets/NatureManufacture Wind/3DNoise.psd
    Assets/Content/GUI/AbilityCardIcons/ConsumeAny_Icon_Highlight.png
    Assets/Content/VFX/GUI/Materials/AbilityCard_Shd.shader
    Assets/Content/GUI/Ability Card Assets/ConsumeHighlight.png
    Assets/Content/GUI/AbilityCardIcons/Atlas/AbilityCardSpriteAtlas.png
    Assets/Content/VFX/Common/Textures/T_noise_shards.png
    Assets/Content/VFX/GUI/Materials/GUI_CardEffect_Mat.mat
    Assets/Content/VFX/GUI/Materials/GUI_Consumable_Earth_Bloom_Mat.mat
    Assets/Content/GUI/AbilityCardIcons/CreateFire_Highlight.png
    UnityEngine.Debug:Log(Object)
    CreateCards:printPrefabDependencies() (at Assets/Editor/CreateCards.cs:33)
     
  13. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Thanks for running the script.

    Ok, so since the Script Type hashes are registered as custom dependency (and we have no API to show that off yet) then I think we could do the following:
    I could ask for a copy of your project (in a DM or in a Fogbugz case) and I can debug and look at why it thinks assets need to be reimported.

    If that's all ok, then I can probably get back to you soon and see if there's something that can be done as a work around, while we figure out how to fix it.

    What do you think?
     
  14. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34
    Unfortunately as our project is proprietary I can't give access to all the code (it's a huge project too).

    I have not been able to repro the issue on a new project either. But maybe one of the other people in this thread are able to share the project.
     
  15. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34
    I am also happy to try anything on my side if you think of something that may help diagnose it.
     
  16. mruiz2017

    mruiz2017

    Joined:
    Feb 22, 2017
    Posts:
    10
    Anything else we could try? We are also not able to share the project and I cannot reproduce in a new project.
     
  17. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    @L42yB & and @mruiz2017 cool, I have a few questions then:
    1. Are you on the same project?
    2. If you're not on the same project, can you share part of your manifest.json file here (or in a DM)?
    3. Do you have any calls to DependsOnCustomDependency in your codebase?
    4. Are you using any asset store packages (and if there's an overlap that might be interesting).
    5. Would you be willing to share the SourceAssetDB and ArtifactDB files in your Library folder (in a DM)?

    I think if we can go through those 5 questions we might be able to surface some issues.
     
  18. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34
    We are not on the same project. I have no calls to DependsOnCustomDependency.

    Here is a list of the asset store packages being used:
    3DForge
    AmplifyShaderEditor
    Amplitude
    AraTrail
    Beautify
    Best HTTP Pro
    Decalicious
    DecalSystem
    I2 Localization
    KriptoFX
    OutlineEffect
    VolumetricFog
    WiseSVN

    There are no SourceAssetDB and ArtifactDB files in my library. Are those files only created when going to AssetDB 2? We have reverted to version 1 to avoid this issue.

    Here is the manifest.json

    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.unity.2d.sprite": "1.0.0",
    4.     "com.unity.2d.tilemap": "1.0.0",
    5.     "com.unity.analytics": "3.3.5",
    6.     "com.unity.cinemachine": "2.6.0",
    7.     "com.unity.collab-proxy": "1.2.16",
    8.     "com.unity.ext.nunit": "1.0.0",
    9.     "com.unity.formats.fbx": "3.2.0-preview.2",
    10.     "com.unity.ide.rider": "2.0.5",
    11.     "com.unity.ide.vscode": "1.2.1",
    12.     "com.unity.multiplayer-hlapi": "1.0.6",
    13.     "com.unity.postprocessing": "2.3.0",
    14.     "com.unity.render-pipelines.core": "7.3.1",
    15.     "com.unity.render-pipelines.lightweight": "7.4.1",
    16.     "com.unity.shadergraph": "7.3.1",
    17.     "com.unity.test-framework": "1.1.16",
    18.     "com.unity.test-framework.performance": "2.3.1-preview",
    19.     "com.unity.textmeshpro": "2.1.1",
    20.     "com.unity.timeline": "1.2.15",
    21.     "com.unity.ugui": "1.0.0",
    22.     "com.unity.xr.legacyinputhelpers": "2.1.4",
    23.     "com.unity.modules.ai": "1.0.0",
    24.     "com.unity.modules.androidjni": "1.0.0",
    25.     "com.unity.modules.animation": "1.0.0",
    26.     "com.unity.modules.assetbundle": "1.0.0",
    27.     "com.unity.modules.audio": "1.0.0",
    28.     "com.unity.modules.cloth": "1.0.0",
    29.     "com.unity.modules.director": "1.0.0",
    30.     "com.unity.modules.imageconversion": "1.0.0",
    31.     "com.unity.modules.imgui": "1.0.0",
    32.     "com.unity.modules.jsonserialize": "1.0.0",
    33.     "com.unity.modules.particlesystem": "1.0.0",
    34.     "com.unity.modules.physics": "1.0.0",
    35.     "com.unity.modules.physics2d": "1.0.0",
    36.     "com.unity.modules.screencapture": "1.0.0",
    37.     "com.unity.modules.terrain": "1.0.0",
    38.     "com.unity.modules.terrainphysics": "1.0.0",
    39.     "com.unity.modules.tilemap": "1.0.0",
    40.     "com.unity.modules.ui": "1.0.0",
    41.     "com.unity.modules.uielements": "1.0.0",
    42.     "com.unity.modules.umbra": "1.0.0",
    43.     "com.unity.modules.unityanalytics": "1.0.0",
    44.     "com.unity.modules.unitywebrequest": "1.0.0",
    45.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    46.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    47.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    48.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    49.     "com.unity.modules.vehicles": "1.0.0",
    50.     "com.unity.modules.video": "1.0.0",
    51.     "com.unity.modules.vr": "1.0.0",
    52.     "com.unity.modules.wind": "1.0.0",
    53.     "com.unity.modules.xr": "1.0.0"
    54.   }
    55. }
     
  19. mruiz2017

    mruiz2017

    Joined:
    Feb 22, 2017
    Posts:
    10
    Hi @Unity_Javier

    1. Different projects

    2. manifest.json file:

    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.google.external-dependency-manager": "1.2.161",
    4.     "com.google.firebase.analytics": "6.16.1",
    5.     "com.google.firebase.crashlytics": "6.16.1",
    6.     "com.unity.2d.animation": "3.2.3",
    7.     "com.unity.2d.sprite": "1.0.0",
    8.     "com.unity.2d.tilemap": "1.0.0",
    9.     "com.unity.device-simulator": "2.2.2-preview",
    10.     "com.unity.ext.nunit": "1.0.0",
    11.     "com.unity.formats.fbx": "3.2.0-preview.2",
    12.     "com.unity.ide.rider": "2.0.7",
    13.     "com.unity.ide.vscode": "1.2.1",
    14.     "com.unity.memoryprofiler": "0.2.5-preview.1",
    15.     "com.unity.purchasing": "2.0.6",
    16.     "com.unity.quicksearch": "1.5.3",
    17.     "com.unity.recorder": "2.1.0-preview.1",
    18.     "com.unity.test-framework": "1.1.14",
    19.     "com.unity.textmeshpro": "2.1.3",
    20.     "com.unity.timeline": "1.2.14",
    21.     "com.unity.ugui": "1.0.0",
    22.     "com.unity.ui.builder": "1.0.0-preview.1",
    23.     "com.unity.modules.androidjni": "1.0.0",
    24.     "com.unity.modules.animation": "1.0.0",
    25.     "com.unity.modules.assetbundle": "1.0.0",
    26.     "com.unity.modules.audio": "1.0.0",
    27.     "com.unity.modules.director": "1.0.0",
    28.     "com.unity.modules.imageconversion": "1.0.0",
    29.     "com.unity.modules.imgui": "1.0.0",
    30.     "com.unity.modules.jsonserialize": "1.0.0",
    31.     "com.unity.modules.particlesystem": "1.0.0",
    32.     "com.unity.modules.physics": "1.0.0",
    33.     "com.unity.modules.physics2d": "1.0.0",
    34.     "com.unity.modules.ui": "1.0.0",
    35.     "com.unity.modules.uielements": "1.0.0",
    36.     "com.unity.modules.unitywebrequest": "1.0.0",
    37.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    38.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    39.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    40.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    41.     "com.unity.modules.video": "1.0.0"
    42.   },
    43.   "scopedRegistries": [
    44.     {
    45.       "name": "Game Package Registry by Google",
    46.       "url": "https://unityregistry-pa.googleapis.com",
    47.       "scopes": [
    48.         "com.google"
    49.       ]
    50.     }
    51.   ]
    52. }
    53.  
    3. No calls to that method

    4. Main Packages:
    Sirenix Odin Inspector
    Lunar Console
    Best HTTP Pro
    I2 Localization

    5. I will send them in a DM, since they are quite large
     
  20. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Thanks for the info so far!

    Seeing how you both have I2 Localization and Best HTTP Pro in your projects, could you try removing them and see if the problem goes away (if possible, it might not be easy of course)?
     
  21. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34
    These are the files in my library, definitely no SourceAssetDB and ArtifactDB files. I did a search for them too and didn't find them in any subfolders.

    Code (CSharp):
    1.  Directory of D:\Game\Trunk\Library
    2.  
    3. 11/11/2020  17:58    <DIR>          .
    4. 11/11/2020  17:58    <DIR>          ..
    5. 07/10/2020  13:02             4,116 AnnotationManager
    6. 07/10/2020  13:18    <DIR>          APIUpdater
    7. 11/11/2020  17:58        43,465,364 assetDatabase3
    8. 07/10/2020  15:12                10 AssetImportState
    9. 07/10/2020  15:48    <DIR>          AtlasCache
    10. 07/10/2020  13:02                 0 BuildPlayer.prefs
    11. 07/10/2020  13:02             4,152 BuildSettings.asset
    12. 04/11/2020  12:28            24,476 CurrentLayout-default.dwlt
    13. 11/11/2020  15:10               214 EditorInstance.json
    14. 11/10/2020  21:03             1,230 EditorOnlyScriptingSettings.json
    15. 04/11/2020  12:28               546 EditorSnapSettings.asset
    16. 11/10/2020  21:08             5,900 EditorUserBuildSettings.asset
    17. 07/10/2020  13:02               420 EditorUserSettings.asset
    18. 29/10/2020  19:51             4,212 expandedItems
    19. 20/10/2020  02:09             4,236 InspectorExpandedItems.asset
    20. 11/10/2020  15:57        63,800,708 LastBuild.buildreport
    21. 04/11/2020  12:28               462 LastSceneManagerSetup.txt
    22. 07/10/2020  13:02                65 LibraryFormatVersion.txt
    23. 07/10/2020  13:02    <DIR>          metadata
    24. 07/10/2020  13:02             4,100 MonoManager.asset
    25. 20/10/2020  14:52    <DIR>          PackageCache
    26. 11/10/2020  15:41    <DIR>          PlayerDataCache
    27. 11/10/2020  15:57            20,347 ProjectSettings.asset
    28. 11/11/2020  15:19             5,080 SceneVisibilityState.asset
    29. 11/11/2020  15:10    <DIR>          ScriptAssemblies
    30. 11/11/2020  15:06            48,845 ScriptMapper
    31. 11/11/2020  15:11    <DIR>          ShaderCache
    32. 11/10/2020  13:48            51,200 ShaderCache.db
    33. 11/11/2020  15:10                 0 shadercompiler-UnityShaderCompiler.exe0.log
    34. 20/10/2020  14:52               210 shadercompiler-UnityShaderCompiler.exe1.log
    35. 20/10/2020  14:52               210 shadercompiler-UnityShaderCompiler.exe2.log
    36. 20/10/2020  14:52               210 shadercompiler-UnityShaderCompiler.exe3.log
    37. 20/10/2020  14:52               210 shadercompiler-UnityShaderCompiler.exe4.log
    38. 20/10/2020  14:52               210 shadercompiler-UnityShaderCompiler.exe5.log
    39. 12/10/2020  14:06               185 shadercompiler-UnityShaderCompiler.exe6.log
    40. 12/10/2020  14:06               185 shadercompiler-UnityShaderCompiler.exe7.log
    41. 17/10/2020  11:44            32,992 SpriteAtlasDatabase.asset
    42. 07/10/2020  15:38    <DIR>          StateCache
    43. 07/10/2020  15:12           196,901 Style.catalog
    44. 20/10/2020  14:48    <DIR>          UIElements
     
  22. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34
    I will have a go at going back to Assset DB v2 and removing those packages on the weekend on a separate branch, but it will likely be quite hard to remove them as so much other code uses them.
     
  23. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    @L42yB the ArtifactDB and SourceAssetDB are generated by ABDV2. Sorry for not mentioning that earlier.

    With regard to removing those packages, maybe it would be good to look for code in them implementing calls for the AssetPostprocessor class, and if you do find any you could just early out and see if that helps narrow the issue.


    Out of curiosity, when you say any code change, is it literally adding a space to a C# script and that triggers a reimport, or is it more towards adding a new public variable and that triggers the reimport? Both?
     
  24. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34
    Yes. Literally any code change that triggers unity to recompile that script (in any script) triggers it.
     
    Unity_Javier likes this.
  25. L42yB

    L42yB

    Joined:
    Dec 20, 2012
    Posts:
    34
    In the example I put above, I added a Debug.Log call, which triggered it.
     
    Unity_Javier likes this.
  26. mruiz2017

    mruiz2017

    Joined:
    Feb 22, 2017
    Posts:
    10
    I tried a few more things today:

    - Removing Best HTTP did not solve the issue.

    - I tried but could not fully remove I2 since it is used in a lot of scripts and prefabs.

    - Removing all AssetPostprocessor classes did not make any difference either.

    Out of curiosity, when you say any code change, is it literally adding a space to a C# script and that triggers a reimport, or is it more towards adding a new public variable and that triggers the reimport? Both?

    - It is literally any code, adding a space or changing just a number in code triggered all the reimports.

    I don't know the internals of Unity's asset dependencies system but right now I am assuming is related to I2 Localization. It is used in so many places that if for some reason the change of a script is picked up as a potential dependency of I2 then it could be propagated to all prefabs. That is just my best guess from all the discussion here and the fact that both projects have it.
     
    futurlab_xbox likes this.
  27. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    OK, I'm digging through the I2 Localization code to see if there's something that stands out (and I've made a project with it, but need to see their docs on how to setup a simple project that uses it).

    I have another script that might help. This will enable full stack tracing and if some assets get imported it will show the stack trace from where the import began. If we're lucky then I2 Localization will be on the call stack.

    Once you have this script, if you go to
    AssetDatabase -> ActivateListener

    Then look for the debug entry that says
    "OnPostProcessAllAssets called, check stack trace for potential callsites"

    And paste that stack trace here it could help to figure out where the reimports came from.
     

    Attached Files:

    SergioPrada likes this.
  28. mruiz2017

    mruiz2017

    Joined:
    Feb 22, 2017
    Posts:
    10
    This is the stack trace I got:

    OnPostProcessAllAssets called, check stack trace for potential callsites
    #0 GetStacktrace(int)
    #1 DebugStringToFile(DebugStringToFileData const&)
    #2 DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*)
    #3 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
    #4 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    #5 mono_jit_runtime_invoke
    #6 do_runtime_invoke
    #7 mono_runtime_try_invoke_array
    #8 ves_icall_InternalInvoke
    #9 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    #10 (Mono JIT Code) System.Reflection.MethodBase:Invoke (object,object[])
     
  29. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Ok, that doesn’t say much :(

    Can you verify that FullStackTrace logging is enabled?

    upload_2020-11-12_21-22-22.png
     
  30. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    524
    @Unity_Javier just chiming in that we're using 2019.4.7 and AssetDatabase v2 and getting a tonne of prefab imports all the time as well which slows down workflow. We also happen to be using Amplify Shader and I2 Localisation plugins. I2 Localisation runs stuff at Editor time which may explain why we often see a bunch of reimports happening when playmode is stopped as well, if it is indeed the dependency you're looking for above.

    FYI we were using the QuickSearch package for a while but had to remove it because it added 3-5 minutes stall while opening Unity for some project scan or other... The only useful lines in the Editor.log were related to the timing for asset postprocessing confirming that something was happening but not explaining anything. After removing QuickSearch the open time went back to ~20s.
     
    Unity_Javier likes this.
  31. mruiz2017

    mruiz2017

    Joined:
    Feb 22, 2017
    Posts:
    10
    Yes, I had it enabled :/

    I also put a breakpoint and checked from the IDE, but it does not say much
    Screenshot 2020-11-12 at 21.30.45.png Screenshot 2020-11-12 at 21.34.24.png
     
  32. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    That's odd.
    I made a new project and added that script plus something to trigger a reimport, and I was able to see the callstack that I was expecting. I'm testing on 2019.4.10f1 btw
     

    Attached Files:

  33. mruiz2017

    mruiz2017

    Joined:
    Feb 22, 2017
    Posts:
    10
    I will make some more tests to see if I can get that callstack.
    In case environment could have any influence for this: I am on Mac with iOS as the current Platform. Also using 2019.4.10f1
     
  34. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    In case it helps anyone looking at this issue, you can add this piece of code to debug what's going on.

    This will report to the Log which Prefabs are NOT being reimported, and then you can see the difference between those that are and those that are not. So far @mruiz2017 found something, but it would be good to get more data points:

    Code (CSharp):
    1. private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
    2.    {
    3.         var allAssets = AssetDatabase.GetAllAssetPaths();
    4.         var allImportedAssets = new HashSet<string>(importedAssets);
    5.         var allPrefabs = new HashSet<string>();
    6.         for (int i = 0; i < allAssets.Length; ++i)
    7.         {
    8.             if(allAssets[i].EndsWith(".prefab"))
    9.                 allPrefabs.Add(allAssets[i]);
    10.         }
    11.         StringBuilder notImportedPrefabs = new StringBuilder();
    12.         foreach (var curPrefabPath in allPrefabs)
    13.         {
    14.             if (!allImportedAssets.Contains(curPrefabPath))
    15.                 notImportedPrefabs.Append($"Did not import {curPrefabPath}\n");
    16.         }
    17.    
    18.         Debug.Log(notImportedPrefabs.ToString());
    19.     }
     
    Last edited: Nov 12, 2020
  35. dirty-rectangle

    dirty-rectangle

    Joined:
    Apr 23, 2015
    Posts:
    78
    I've been looking for patterns in the sets of prefabs which we see are being always reimported with Asset Pipeline v2.
    One correlation looks to be for prefabs with components which have the [SerializeField] attribute applied to a type which inherits from MonoBehaviour.
    Commenting out the [SerializeField] attribute for this member variable stops those prefabs from being reimported each time that a .cs file is imported.
    There are other [SerializeField] member variables in the class which don't have this affect but they are not for MonoBehaviour derived member variables.

    Code (CSharp):
    1.     public class VisualUpgradeData : MonoBehaviour
    2.     {
    3.         [SerializeField]
    4.         private BuildingRenderData renderData;
    5.                 ...
    6.            
    7. where     ...
    8.     public class BuildingRenderData : MonoBehaviour
     
    Last edited: Nov 18, 2020
    Unity_Javier likes this.
  36. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hey, I tried this on a standalone project but didn't manage to repro it.

    What I did was:
    Code (CSharp):
    1. public class ScriptA : MonoBehaviour
    2. {
    3.   [SerializeField] private ScriptB scriptReference;
    4. }
    Code (CSharp):
    1. public class ScriptB : MonoBehaviour
    2. {
    3. }
    Code (CSharp):
    1. public class UnrelatedScript : MonoBehaviour
    2. {
    3.  
    4. }
    Then what I do is I add both ScriptA and ScriptB as components to a Prefab, and have ScriptA reference ScriptB.

    Then I modifiy UnrealatedScript and check out the Editor log to see if the prefab is reimporting but can't get it to reimport.

    Did I miss a step perhaps?
     
  37. dirty-rectangle

    dirty-rectangle

    Joined:
    Apr 23, 2015
    Posts:
    78
    @Unity_Javier
    I've now repro'ed this in a new project.
    Unity 2019.4.9f1
    PC Platform, Target Platform Windows.
    I added the following three cs scripts and created a game object with ScriptA assigned to it.
    The test case was to add a new line to AssemblyStaticInfo.cs and then look at the generated editor log output.
    Each time I see the following lines in the editor log, except that the target hash value is new each time.

    Start importing Assets/Test/GameObject.prefab using Guid(1312fb77693731047a26ece5b480d7f5) Importer(-1,00000000000000000000000000000000)
    Done importing asset: 'Assets/Test/GameObject.prefab' (target hash: '2abd894e40c706678a9591161f901a5c') in 0.017171 seconds

    Then remove the [SerializeField] in ScriptA and repeat the test, the result seen then is that no import of the prefab appears in the editor log.
     

    Attached Files:

    rajantande and Unity_Javier like this.
  38. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Yes!

    I can repro it aswell.

    Let me see how we can fix this. Thanks for the info @dirty-rectangle !
     
    rajantande and dirty-rectangle like this.
  39. mruiz2017

    mruiz2017

    Joined:
    Feb 22, 2017
    Posts:
    10
    OMG, it is fixed now in our project! Finally!
    I deleted this line for versioning that I had in some class and everything was fine afterwards:
    [assembly: AssemblyVersion("1.0.*")]

    Thank you so much @dirty-rectangle for finding a way to reproduce and @Unity_Javier for all the direct support.
    I still can't believe it was just that, I hope it gets resolved also for all of you :)
     
  40. dirty-rectangle

    dirty-rectangle

    Joined:
    Apr 23, 2015
    Posts:
    78
    It would be great to hear if anyone has an explanation of what was going on here and whether there are other issues that this use of the AssemblyVersion could have been causing?
     
  41. mruiz2017

    mruiz2017

    Joined:
    Feb 22, 2017
    Posts:
    10
    This is what I know so far (all of this needs verification):

    Every time there is any script change the wildcard in the AssemblyVersion forces the compiler to assign a new version to the assembly. The version is part of the fully qualified name of a class:
    My.Namespace.TestClass, Assembly-CSharp, Version=1.0.7628.39288, Culture=neutral, PublicKeyToken=null
    The current assumption (pending confirmation from the Unity team) is that asset database v2 uses that name to identify classes, and thus marks them as new or modified each time.
    This then propagates to prefabs that are using any of these scripts, requiring a reimport and also changing their hash.
    Since the hash of the asset changes, very likely other systems might be affected like asset bundles.
    We are having the issue that a lot of asset bundle hashes were changing per build, and I am trying to confirm now after this fix if that still happens or not.
     
  42. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    I've created a bug that you can track for the situation the @dirty-rectangle discovered: https://issuetracker.unity3d.com/issues/prefabs-are-reimporting-every-time-a-code-change-is-made

    From what we can see, compiling with deterministic and having a wildcard in the assembly version seems to be causing some headaches in general:
    Visual studio. AssemblyVersion with * don't work

    For general workflows, I think having auto-versioning (with the wildcard) should not result in reimporting Prefabs, so that's something we'll consider for this fix as well :)
     
    dirty-rectangle likes this.
  43. SideSwipe9th

    SideSwipe9th

    Joined:
    Jan 10, 2019
    Posts:
    46
    Seeing as a fix for this is still in planning/review, what is the current workaround? If it just a case of using a fixed version number, where is this set? Do I just need to create an AssemblyInfo.cs file for each defined assembly in my projects?
     
  44. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hi @SideSwipe9th

    The current work around is to make sure there's no code in your project that's doing assembly auto-versioning, so anything that looks like:
    [assembly: AssemblyVersion("0.0.*")] or more specifically, this:

    Code (CSharp):
    1. [assembly: AssemblyVersion(...)]

    And making sure there's no wildcard for the version should be enough.

    However, if you don't have anything like that then it could be another issue that's happening.
     
    Last edited: Dec 10, 2020
    futurlab_xbox and SideSwipe9th like this.
  45. SideSwipe9th

    SideSwipe9th

    Joined:
    Jan 10, 2019
    Posts:
    46
    Thanks @Unity_Javier

    We didn't have any instances of that in our code, and I didn't see any instances of it in asset store assets we have imported. I did roll out manual AssemblyInfo.cs for all of the assemblies in one of our projects last night. I'm waiting on feedback from the other devs to hear if it was successful or not.

    If it's not, I'll try and use some of the info gleaned earlier in this thread, along with some of the useful scripts you and others have posted to see if I can find any further info before filing a new bug report :)

    Out of curiosity, if I do have to do more troubleshooting, is there any API calls in the asset import pipeline that can tell you why an asset is being re-imported? I've been looking through the documentation, but so far have only seen helpers for when an asset is being imported, not why.
     
    Last edited: Dec 10, 2020
    Unity_Javier likes this.
  46. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hi @SideSwipe9th,


    This is something we're working on currently when we have a small break from bugs, but right now there's no API available.

    I hope to be able to share more on it soon, but the plan is to have some helpful messages that can help you figure out why something imported.

    For example, you could have a Prefab (PrefabA) that has PrefabB nested inside of it.
    If you modify and import PrefabB, then PrefabA will also import. The message we would like to give for that is something along the lines of "PrefabA reimported because PrefabB, which is a dependency of PrefabA, was modified"
     
    futurlab_xbox likes this.
  47. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hi @SideSwipe9th,
    Have you had any luck tracking down what is causing the re-imports? Or narrowing down the issue at least?
     
  48. SideSwipe9th

    SideSwipe9th

    Joined:
    Jan 10, 2019
    Posts:
    46
    Hey @Unity_Javier , not as such yet. We were closed for Christmas there and only just started back this week. Currently I'm working on upgrading our projects from 2019.4 to 2020.2, so I've not had a chance to investigate further since returning from holiday. Will update the thread again when I get a chance to look into this problem again.
     
  49. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Alright :)
    In the meantime I've made two scripts which might help out in case of an auto-versioning wildcard for the AssemblyVersion.

    The instructions to use it are:
    1. Add both scripts to the project
    2. Wait for them to be imported
    3. Modify another script
    4. Look at the output for the Dialog that comes up as part of these scripts and report back.
    If all goes "well", then the Dialog in the attached image should pop up :)
     

    Attached Files:

    SideSwipe9th likes this.
  50. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Hi!
    I'm experiencing the exact same bug identified in this thread; I'm quite reluctant in removing the auto-versioning wildcard for the AssemblyVersion.

    I can see on Issue Tracket that the bug is fixed and its release is planned for 2019.4: is there any estimate release date?
    Thanks