Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Can anyone direct me to how to use -diag-job-temp-memory-leak-validation ?

Discussion in 'Editor & General Support' started by lordumbilical, Dec 30, 2022.

  1. lordumbilical

    lordumbilical

    Joined:
    May 24, 2020
    Posts:
    38
    At some stage, I started getting a message in the editor about a memory leak that could impact performance, and the message advised me to run unity with -diag-job-temp-memory-leak-validation at the command line. I do this... now what? It advises me that diagnostic switches are now active, but I cant see anything telling me that it found an error, or how I should proceed from here. Ive searched google for the error message and similar phrases, but can't find anything related at all. Can anyone kindly point me to the relevant docs? I've had a look at the memory profiler, but that's way beyond me at this stage. Im hoping for the computer to kindly underline whatever is Im doing wrong, perhaps over-optimistically. Im not using any natural arrays or data types that Im aware need manual freeing of memory. So Im guessing there must be other ways to somehow stuff up memory with whatever I am doing.
     
  2. lordumbilical

    lordumbilical

    Joined:
    May 24, 2020
    Posts:
    38
    Posted during holidays, so probably not great for visibility. Bump, anyone?
     
  3. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    505
    Hi @lordumbilical !

    I've asked on internal slack if we have public docs for the feature.
     
  4. G_Wojo

    G_Wojo

    Unity Technologies

    Joined:
    Feb 8, 2017
    Posts:
    38
    Hi, Sadly we do not have public docs about it. Originally this feature was internal use only, mostly because it was asking to enable macro in C++ code. This was always problematic as it required recompiling unity after change and only people having source code could really do it.

    This is where -diag-job-temp-memory-leak-validation come. When app is started with this command line argument (or in case of editor we just enable it in diagnostic switches) we swaps some of our allocators on heavier, debug versions. It collect additional informations like callstack and log leaked memory whenever issue occurs to console or log file.

    Could you also share version of Unity that you are using? In past, while doing some other changes we sadly introduce small issue to this system which in my knowledge should has been fixed, but I would double check it.
     
  5. lordumbilical

    lordumbilical

    Joined:
    May 24, 2020
    Posts:
    38
    It's 2022.2.1f1. The error message did only begin about the time I updated to this version. Would there be a guide to allocating memory properly? Maybe I am doing something wrong. The project is very simple, and I am just passing primitive data types, but maybe I am doing it wrong. I don't know.
     
  6. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    713
    If you aren't directly touching unmanaged code -- NativeArrays, bursted jobs, etc. -- this probably isn't something you're causing.

    I see these warnings now and then in 2022.2.1f1 on my Silicon mac. I did turn on the diagnostic switch, and it is providing some more details about the leaked allocations. IIRC they're somewhere in the graphics system -- something about command buffers?
     
  7. lordumbilical

    lordumbilical

    Joined:
    May 24, 2020
    Posts:
    38
    Ah, ok that's good to know. So I will just ignore the issue if there is nothing I can do.
     
  8. G_Wojo

    G_Wojo

    Unity Technologies

    Joined:
    Feb 8, 2017
    Posts:
    38
    Just like @chemicalcrux I do not think this would be your fault and I suspect that there may be issue inside unity codebase. Could you guys share this additional details with us? I would look into it so we could resolve this issue.
     
    koyodi and MartinTilo like this.
  9. koyodi

    koyodi

    Joined:
    Oct 9, 2020
    Posts:
    3
    I'm also experiencing this issue in both 2022.2.1f1 and 2022.2.0b12. In my case, it seems to be triggered by the third party Corgi Engine asset after import, which overrides a bunch of project settings and has Package Manager dependencies (not sure if this could cause the issue), hence why I didn't post here. I can't find anything in the Corgi forums about it either, though. Haven't tested for this warning getting triggered by other assets.

    When I start with a fresh project (2D URP) in 2022.2.1f1 and click on items in the Project window, no warnings appear. Then, I import Corgi Engine... Allow it to override Project Settings... It says some of its source files refer to API that has changed, asks if I want these files updated... I've tested with both saying yes and no, same end result.

    After the asset is imported and I click on random items in both the Asset folder and Packages folder, Unity gives these warnings, also seemingly at random:


    [Worker0] Internal: There are remaining Allocations on the JobTempAlloc. This is a leak, and will impact performance
    [Worker0] To Debug, run app with -diag-job-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations.
    [Worker1] Internal: There are remaining Allocations on the JobTempAlloc. This is a leak, and will impact performance
    [Worker1] Internal: JobTempAlloc has allocations that are more than the maximum lifespan of 4 frames old - this is not allowed and likely a leak


    I'm relatively new to Unity and this is way over my head, so I started a new project in 2021 LTS and haven't received any of these warnings (as well as others I was getting in 2022 with Corgi and URP). Just wanted to relate my experience with them and how they seemed to be triggered by an asset.
     
  10. lordumbilical

    lordumbilical

    Joined:
    May 24, 2020
    Posts:
    38
    I get the same error message, except the one mentioning "maximum lifespan of 4 frames". Mine started about the same time i moved from default (2D) to the Universal Render Pipeline, but that's just a guess. Please let me know what specific information you might want.
     
  11. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    713
    Have you turned on the diagnostic flag? It'll spit stuff out into the logs (as info, not as warnings) when these warnings would otherwise be reported.

    Check the user settings menu (not project settings) -- it's in the Diagnostics section.

    upload_2023-1-6_22-18-26.png
     
    MartinTilo likes this.
  12. koyodi

    koyodi

    Joined:
    Oct 9, 2020
    Posts:
    3
    I tried clicking on folders and assets in the Project window with JobTempMemoryLeakValidation turned on in 2022.2.1f1 and it started giving some new information in the console. This is what it logged when I randomly clicked on the Custom NUnit folder under Packages in the Project window (copied from Editor Log):

    Warnings:

    [Worker0] Number of updated assets reloaded before import = 0
    [Worker0] Start importing Packages/com.unity.ext.nunit using Guid(25a477c2f24db8778a4179421a32cc21) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
    [Worker0] -> (artifact id: '084dec501e1f4c6611a6b594e6838766') in 0.004419 seconds
    [Worker0] Internal: There are remaining Allocations on the JobTempAlloc. This is a leak, and will impact performance
    [Worker0] To Debug, run app with -diag-job-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations.


    Logs:

    [Worker0] Allocation of 32 bytes at c001e920 in block 0 (frameIndex=4, lifetime=4, age=2, state=OK)
    [Worker0] 00 00 00 00 00 00 00 00 60 1a 72 91 c2 01 00 00 ........`.r.....
    [Worker0] 00 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00 ................
    [Worker0] 20 e9 01 c0 c3 01 00 00 60 1a 72 91 c2 01 00 00 .......`.r.....
    [Worker0] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................


    Then I tried turning off JobTempMemoryLeakValidation and, after restarting, all the warning and logs stopped appearing. So I'm wondering if Unity had JobTempMemoryLeakValidation turned on by default before somehow? I even searched the Editor Log and couldn't find any of the previous warnings.

    So turning it on/off and restarting each time fixed the problem for me so far, thanks!
     
  13. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    713
    Shouldn't that also be spiting out the callstack (the sequence of functions that were called to get you to a specific place)? That's going to be the more useful bit of information: where the leaked memory was allocated.

    It might be in a separate log message.
     
  14. koyodi

    koyodi

    Joined:
    Oct 9, 2020
    Posts:
    3
    Nevermind, the memory leak warnings came back after a while. Sorry, I don't know how to find the callstack and had trouble running the app with -diag-job-temp-memory-leak-validation in the cmd line argument.... Here's a section of the log if it helps, though:

    Code (CSharp):
    1. .Worker ready: AssetImportWorker1 1
    2. Worker ready: AssetImportWorker0 0
    3. [Worker0] Number of updated assets reloaded before import = 0
    4. [Worker0] Start importing Assets/CorgiEngine/Demos/Retro/Prefabs/PlayableCharacters/RetroCorgi.prefab using Guid(460a0ee26c86f4e5ab4b2678c9712069) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
    5. [Worker0]  -> (artifact id: 'cab1bd7eaecdf23fb53fe09ecb27bd98') in 0.297716 seconds
    6. [Worker0] Internal: There are remaining Allocations on the JobTempAlloc. This is a leak, and will impact performance
    7. [Worker0] To Debug, run app with -diag-job-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations.
    8. [Worker0] Allocation of 32 bytes at c0026a40 in block 0 (frameIndex=0, lifetime=4, age=1, state=OK)
    9. 0x00007ff709a2ef8b (Unity) PlayableGraph::DestroyPlayableDeferred
    10. 0x00007ff709e9bd91 (Unity) Animator::ClearInternalControllerPlayable
    11. 0x00007ff709e9bfa9 (Unity) Animator::ClearObject
    12. 0x00007ff709e9d02f (Unity) Animator::Deactivate
    13. 0x00007ff709401995 (Unity) GameObject::ActivateAwakeRecursivelyInternal
    14. 0x00007ff7094017d4 (Unity) GameObject::ActivateAwakeRecursivelyInternal
    15. 0x00007ff7094017d4 (Unity) GameObject::ActivateAwakeRecursivelyInternal
    16. 0x00007ff7094017d4 (Unity) GameObject::ActivateAwakeRecursivelyInternal
    17. 0x00007ff709401559 (Unity) GameObject::ActivateAwakeRecursively
    18. 0x00007ff7094044f9 (Unity) GameObject::Deactivate
    19. 0x00007ff7097ab030 (Unity) UnityScene::OnGameObjectChangedScene
    20. 0x00007ff7099b0c6d (Unity) SceneManagerBindings::MoveGameObjectToScene
    21. 0x00007ff708bd4071 (Unity) SceneManager_CUSTOM_MoveGameObjectToScene_Injected
    22. 0x000001d681424a15 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.SceneManagement.SceneManager:MoveGameObjectToScene_Injected (UnityEngine.GameObject,UnityEngine.SceneManagement.Scene&)
    23. 0x000001d68142493b (Mono JIT Code) UnityEngine.SceneManagement.SceneManager:MoveGameObjectToScene (UnityEngine.GameObject,UnityEngine.SceneManagement.Scene)
    24. 0x000001d6814296e3 (Mono JIT Code) UnityEditor.PreviewScene:AddManagedGO (UnityEngine.GameObject)
    25. 0x000001d681429663 (Mono JIT Code) UnityEditor.PreviewRenderUtility:AddManagedGO (UnityEngine.GameObject)
    26. 0x000001d681426f23 (Mono JIT Code) UnityEditor.GameObjectInspector/PreviewData:UpdateGameObject (UnityEngine.Object)
    27. 0x000001d68142313b (Mono JIT Code) UnityEditor.GameObjectInspector/PreviewData:.ctor (UnityEngine.Object,bool)
    28. [Worker0] 00 00 00 00 00 00 00 00 f0 47 43 91 d4 01 00 00  .........GC.....
    29. [Worker0] 00 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00  ................
    30. [Worker0] Allocation of 32 bytes at c006fe30 in block 0 (frameIndex=0, lifetime=4, age=1, state=OK)
    31. 0x00007ff709a33aa3 (Unity) DirectorManager::ScheduleGraphDestroy
    32. 0x00007ff709e9be3b (Unity) Animator::ClearInternalControllerPlayableGraph
    33. 0x00007ff709ea273f (Unity) Animator::MainThreadCleanup
    34. 0x00007ff7093f7e0c (Unity) delete_object_internal_step1
    35. 0x00007ff70973df42 (Unity) CommitBatchDelete
    36. 0x00007ff70972727d (Unity) DestroyObjectHighLevel_Internal
    37. 0x00007ff709726e24 (Unity) DestroyObjectHighLevel
    38. 0x00007ff7097ac773 (Unity) RuntimeSceneManager::UnloadSceneInternal
    39. 0x00007ff70a9d0485 (Unity) EditorSceneManager::ClosePreviewScene
    40. 0x00007ff70916decf (Unity) EditorSceneManager_CUSTOM_ClosePreviewScene_Injected
    41. 0x000001d681445b0a (Mono JIT Code) (wrapper managed-to-native) UnityEditor.SceneManagement.EditorSceneManager:ClosePreviewScene_Injected (UnityEngine.SceneManagement.Scene&)
    42. 0x000001d681445a33 (Mono JIT Code) UnityEditor.SceneManagement.EditorSceneManager:ClosePreviewScene (UnityEngine.SceneManagement.Scene)
    43. 0x000001d681445873 (Mono JIT Code) UnityEditor.PreviewScene:Dispose ()
    44. 0x000001d6814457a3 (Mono JIT Code) UnityEditor.PreviewRenderUtility:Cleanup ()
    45. 0x000001d68144564b (Mono JIT Code) UnityEditor.GameObjectInspector/PreviewData:Dispose ()
    46. 0x000001d681444f53 (Mono JIT Code) UnityEditor.GameObjectInspector:OnDisable ()
    47. 0x000001d68013c508 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    48. 0x00007ffe469f0394 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
    49. 0x00007ffe4692eb44 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
    50. [Worker0] 40 6a 02 c0 d5 01 00 00 f0 47 43 91 d4 01 00 00  @j.......GC.....
    51. [Worker0] 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00  ................
    52. TrimDiskCacheJob: Current cache size 4mb
    53. Asset Pipeline Refresh (id=9cfd2babd7c14524a9758d20d38f20f0): Total: 0.104 seconds - Initiated by RefreshV2(AllowForceSynchronousImport)
     
    nytcj likes this.
  15. G_Wojo

    G_Wojo

    Unity Technologies

    Joined:
    Feb 8, 2017
    Posts:
    38
    Thanks a lot for this info is supper useful. I check our code and contacted team who work on this code so they investigate it further.
     
    koyodi likes this.
  16. G_Wojo

    G_Wojo

    Unity Technologies

    Joined:
    Feb 8, 2017
    Posts:
    38
    Small follow up. Thanks to information you provided our devs found reproduction of this issue and will be looking into resolving it :]
     
    koyodi and MartinTilo like this.
  17. SwingWren

    SwingWren

    Joined:
    Mar 1, 2014
    Posts:
    30
    I'm using unity 2022.2.5f1 the same/similar problem keeps popping up

    Code (CSharp):
    1. Received Import Request.
    2.   Time since last request: 0.000016 seconds.
    3.   path: Assets/Game/Global/GameplayUI/Sprites/Weapon_Icon.png
    4.   artifactKey: Guid(bf05ab72c260c7444b5c4d2e719376fc) Importer(2089858483,0ecaa5967403d082aa24f35e1b516d23)
    5. Start importing Assets/Game/Global/GameplayUI/Sprites/Weapon_Icon.png using Guid(bf05ab72c260c7444b5c4d2e719376fc) Importer(2089858483,0ecaa5967403d082aa24f35e1b516d23) Generated GUIDs only implemented for interfaces!
    6. -> (artifact id: 'b3343daf6c5b36cc7c3c1311e152cae2') in 0.010873 seconds
    7. Internal: There are remaining Allocations on the JobTempAlloc. This is a leak, and will impact performance
    8. To Debug, run app with -diag-job-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations.
    9. Allocation of 32 bytes at 401d10a0 in block 0 (frameIndex=4, lifetime=4, age=0, state=OK)
    10. 0x00007ff701a232eb (Unity) PlayableGraph::DestroyPlayableDeferred
    11. 0x00007ff701e90e31 (Unity) Animator::ClearInternalControllerPlayable
    12. 0x00007ff701e91049 (Unity) Animator::ClearObject
    13. 0x00007ff701e920cf (Unity) Animator::Deactivate
    14. 0x00007ff7013e7c35 (Unity) GameObject::ActivateAwakeRecursivelyInternal
    15. 0x00007ff7013e7a74 (Unity) GameObject::ActivateAwakeRecursivelyInternal
    16. 0x00007ff7013e7a74 (Unity) GameObject::ActivateAwakeRecursivelyInternal
    17. 0x00007ff7013e77f9 (Unity) GameObject::ActivateAwakeRecursively
    18. 0x00007ff7013eaa29 (Unity) GameObject::Deactivate
    19. 0x00007ff701794660 (Unity) UnityScene::OnGameObjectChangedScene
    20. 0x00007ff7019a4d8d (Unity) SceneManagerBindings::MoveGameObjectToScene
    21. 0x00007ff700c2d111 (Unity) SceneManager_CUSTOM_MoveGameObjectToScene_Injected
    22. 0x000002393468c705 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.SceneManagement.SceneManager:MoveGameObjectToScene_Injected (UnityEngine.GameObject,UnityEngine.SceneManagement.Scene&)
    23. 0x000002393468c62b (Mono JIT Code) UnityEngine.SceneManagement.SceneManager:MoveGameObjectToScene (UnityEngine.GameObject,UnityEngine.SceneManagement.Scene)
    24. 0x0000023934690b33 (Mono JIT Code) UnityEditor.PreviewScene:AddManagedGO (UnityEngine.GameObject)
    25. 0x0000023934690ab3 (Mono JIT Code) UnityEditor.PreviewRenderUtility:AddManagedGO (UnityEngine.GameObject)
    26. 0x000002393468e943 (Mono JIT Code) UnityEditor.GameObjectInspector/PreviewData:UpdateGameObject (UnityEngine.Object)
    27. 0x000002393468ad5b (Mono JIT Code) UnityEditor.GameObjectInspector/PreviewData:.ctor (UnityEngine.Object,bool)
    28. 0x000002393468a583 (Mono JIT Code) UnityEditor.GameObjectInspector:GetPreviewData (bool)
    29. 00 00 00 00 00 00 00 00 80 dd 35 11 37 02 00 00  ..........5.7...
    30. 00 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00  ................
    31. Allocation of 32 bytes at 4033fbe0 in block 1 (frameIndex=4, lifetime=4, age=0, state=OK)
    32. 0x00007ff701a27e03 (Unity) DirectorManager::ScheduleGraphDestroy
    33. 0x00007ff701e90edb (Unity) Animator::ClearInternalControllerPlayableGraph
    34. 0x00007ff701e977df (Unity) Animator::MainThreadCleanup
    35. 0x00007ff7013dde8c (Unity) delete_object_internal_step1
    36. 0x00007ff701727372 (Unity) CommitBatchDelete
    37. 0x00007ff70171041d (Unity) DestroyObjectHighLevel_Internal
    38. 0x00007ff70170ffc4 (Unity) DestroyObjectHighLevel
    39. 0x00007ff701795da3 (Unity) RuntimeSceneManager::UnloadSceneInternal
    40. 0x00007ff7029c1e65 (Unity) EditorSceneManager::ClosePreviewScene
    41. 0x00007ff70118e52f (Unity) EditorSceneManager_CUSTOM_ClosePreviewScene_Injected
    42. 0x0000023934751efa (Mono JIT Code) (wrapper managed-to-native) UnityEditor.SceneManagement.EditorSceneManager:ClosePreviewScene_Injected (UnityEngine.SceneManagement.Scene&)
    43. 0x0000023934751e23 (Mono JIT Code) UnityEditor.SceneManagement.EditorSceneManager:ClosePreviewScene (UnityEngine.SceneManagement.Scene)
    44. 0x0000023934751c63 (Mono JIT Code) UnityEditor.PreviewScene:Dispose ()
    45. 0x0000023934751b93 (Mono JIT Code) UnityEditor.PreviewRenderUtility:Cleanup ()
    46. 0x0000023934751a1b (Mono JIT Code) UnityEditor.GameObjectInspector/PreviewData:Dispose ()
    47. 0x0000023934751253 (Mono JIT Code) UnityEditor.GameObjectInspector:OnDisable ()
    48. 0x00000238f1f9f4a8 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    49. 0x00007ffa6c040394 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
    50. 0x00007ffa6bf7eb44 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
    51. a0 10 1d 40 38 02 00 00 80 dd 35 11 37 02 00 00  ...@8.....5.7...
    52. 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00  ................
    53. Number of updated asset objects reloaded before import = 0
    54. Number of asset objects unloaded after import = 10
    It seems its popping up from multiple different type of asset, at least +900
    I can provide more info if needed, one weird thing is that the warning "-diag-job-temp-memory-leak-validation" keeps popping up even when using the argument and having JobTempMemoryLeak activated.
     
    nytcj likes this.
  18. G_Wojo

    G_Wojo

    Unity Technologies

    Joined:
    Feb 8, 2017
    Posts:
    38
    Hi, @SwingWren

    > I can provide more info if needed,

    It is ok. From what I can see that this callstack is similar to the one that we seen previously.

    > one weird thing is that the warning "-diag-job-temp-memory-leak-validation" keeps popping up even when using the argument and having JobTempMemoryLeak activated.

    We corrected this behaviour in 2023.2.0a1. In this version it should no longer log about command line when running with it.
     
    koyodi, SwingWren and MartinTilo like this.
  19. therobby3

    therobby3

    Joined:
    Jan 30, 2019
    Posts:
    130
    Any word on this still? I'm getting frequently blasted with these errors after upgrading from 2021 to 2022. Often, simply navigating the folders will throw these errors. I don't use any of those low level jobs or memory access things, so this shouldn't be anything on my end. I'm using Unity 2022.2.12.
     
    moatdd and nytcj like this.
  20. moatdd

    moatdd

    Joined:
    Jan 13, 2013
    Posts:
    150
    I'm having difficulty interpreting this phrase.

    Does this mean that the root cause of the memory leaks has been fixed (in the beta version?), or does it mean that the error message has been suppressed?
     
  21. G_Wojo

    G_Wojo

    Unity Technologies

    Joined:
    Feb 8, 2017
    Posts:
    38
    This just means that's when running normally Unity will show message :

    [Worker0] Internal: There are remaining Allocations on the JobTempAlloc. This is a leak, and will impact performance
    [Worker0] To Debug, run app with -diag-job-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations.


    but when run with "-diag-job-temp-memory-leak-validation" output will be only:

    [Worker0] Internal: There are remaining Allocations on the JobTempAlloc. This is a leak, and will impact performance.


    This way we removed the confusion if command line worked or not. Regards the leak in my knowledge team which resolving underlying issue is still working on the fix.
     
    mi3ke and moatdd like this.
  22. TwoBitMachines

    TwoBitMachines

    Joined:
    Oct 5, 2016
    Posts:
    43
    I'm in 2022.2.19, and I'm also getting these errors and messages. Might have to downgrade to 2021...
     
    moatdd likes this.
  23. moatdd

    moatdd

    Joined:
    Jan 13, 2013
    Posts:
    150
    No! I must have the shiny!
     
  24. TomazMB

    TomazMB

    Joined:
    Oct 11, 2020
    Posts:
    33
  25. valter-home

    valter-home

    Joined:
    Sep 22, 2015
    Posts:
    73
    Unity version 2023.1.9f1.
    I collect the paths of prefabs in the scene in a list and with
    AssetDatabase.ExportPackage(exportedPackageAssetList.ToArray(), "myExport.unitypackage", ExportPackageOptions.Interactive | ExportPackageOptions.Recurse | ExportPackageOptions.IncludeDependencies); 

    I export the package. Importing this package into a new project I don't get any warnings.
    However, if I edit some prefabs via code in my editor, save them in a folder, and export the package, when I import it into a new project I still get no warning. But when I select them in the project window the message appears, but only once each. If I return to them later the warning is no longer generated.
    So in summary, if I export the prefabs in a package without making any changes to them, there is no warning, if I modify them, the warning appears.
    The problem occurs both for 3D objects and for sprites saved as prefab (but only if modified, for 3D objects for example if I change the Controller, for sprites if I assign SpriteRenderer, before saving them with
    PrefabUtility.SaveAsPrefabAsset).
     
    Last edited: Oct 6, 2023 at 10:12 PM