Good afternoon, I noticed that when importing a library from scratch the log is full of errors that presumably stretch the import time from 2 hours to 8-10! Please help as I can’t understand what the problem is.
I noticed that if the project has packages ShaderGraph & VisualEffect graph, then apparently visualEffect graph can not think of something because probably has not yet imported part of the shader graph?
Here I show one of the examples where import of one asset takes about one minute! Where there are such errors, everywhere the import of an asset was idle for a long time
What does that mean exactly? First import of an asset?
Try importing the asset in an empty project. If that works fine it’s a project-specific issue. There may be custom importers and asset postprocessor and other editor scripts in the project that act on asset imports/changes. Run the profiler in editor mode and with deep profiling to see what happens during the import.
You should also use the Asset Import Activity window to see more details, it’s not necessary to sift through long logs for issues like this.
PS: please post text as text, not screenshots. And paste screenshots into the post, rather than uploading them somewhere.
AssetDatabase.Load returns always null in a couple known cases, like within a static ctor and InitializeOnLoadMethod or within Start/StopAssetEditing if the loaded asset was modified. So it may depend on where you’re calling this method.
The speed of these operations may depend largely on whether you use Start/StopAssetEditing. This can make a huge difference.
In general, it’s not about my importer or importing any of my assets. It is about the fact that probably ShaderGraph is imported later than VisualEffectGraph tries to get an asset with shader graph dependency.
These errors also appear in an empty project to which we added ShaderGraph and VisualEffectGraph
These errors appear only when we calculate the library for the first time! You need to delete the library in a new or existing project where ShaderGraph and VisualEffectGraph are present and thereafter open project and look at the logs along the path AppData\Local\Unity\Editor
Here are the logs of the editor, slightly extended by my code to log the time between the import of ImportCustomStampMark assemblies
Mistakes I care about:
Shader ‘Shader Graphs/DefaultVFXSG’: fallback shader ‘Hidden/Shader Graph/FallbackError’ not found
WARNING: Shader Unsupported: ‘Shader Graphs/DefaultVFXSG’ - All subshaders removed
Start importing Packages/com.unity.visualeffectgraph/Shaders/DefaultVFXSG.shadergraph using Guid(9d119ea62212af645b58c51d9b0f8276) Importer(-1,00000000000000000000000000000000) Import asset CustomStampMark: 24.06.2024 1:11:11
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
Owlcat.Editor.Import.AssetImportPostprocessor:OnPreprocessAsset () (at Assets/Code/Owlcat/Editor/Import/AssetImportPostprocessor.cs:133)
System.Reflection.RuntimeMethodInfo:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
System.Reflection.MethodBase:Invoke (object,object[])
UnityEditor.AssetPostprocessingInternal:InvokeMethodIfAvailable (object,string,object[])
UnityEditor.AssetPostprocessingInternal:PreprocessAsset ()
(Filename: Assets/Code/Owlcat/Editor/Import/AssetImportPostprocessor.cs Line: 133)
WARNING: Shader Unsupported: 'Shader Graphs/DefaultVFXSG' - All subshaders removed
WARNING: Shader Did you use #pragma only_renderers and omit this platform?
WARNING: Shader If subshaders removal was intentional, you may have forgotten turning Fallback off?
WARNING: Shader Unsupported: 'Shader Graphs/DefaultVFXSG' - All subshaders removed
WARNING: Shader Did you use #pragma only_renderers and omit this platform?
WARNING: Shader If subshaders removal was intentional, you may have forgotten turning Fallback off?
WARNING: Shader Unsupported: 'Shader Graphs/DefaultVFXSG' - All subshaders removed
WARNING: Shader Did you use #pragma only_renderers and omit this platform?
WARNING: Shader If subshaders removal was intentional, you may have forgotten turning Fallback off?
WARNING: Shader Unsupported: 'Shader Graphs/DefaultVFXSG' - All subshaders removed
WARNING: Shader Did you use #pragma only_renderers and omit this platform?
WARNING: Shader If subshaders removal was intentional, you may have forgotten turning Fallback off?
-> (artifact id: 'fbeb7d2e51eee9e93c660fe51f0c6943') in 0.013170 seconds
Start importing Assets/Art/Characters/CharacterCustomisation/Bundles/WeaponMeshes/Materials/M_HeavyFlamer1.mat using Guid(1ff74f5af11eff846b9ccb32beef0270) Importer(-1,00000000000000000000000000000000) Import asset CustomStampMark: 24.06.2024 1:16:58
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
Owlcat.Editor.Import.AssetImportPostprocessor:OnPreprocessAsset () (at Assets/Code/Owlcat/Editor/Import/AssetImportPostprocessor.cs:133)
System.Reflection.RuntimeMethodInfo:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
System.Reflection.MethodBase:Invoke (object,object[])
UnityEditor.AssetPostprocessingInternal:InvokeMethodIfAvailable (object,string,object[])
UnityEditor.AssetPostprocessingInternal:PreprocessAsset ()
(Filename: Assets/Code/Owlcat/Editor/Import/AssetImportPostprocessor.cs Line: 133)
-> (artifact id: '6648c0f35ba8d89a962d89a6abe9b6be') in 0.002510 seconds
-> (artifact id: '80268a533df62a89dfa4999681ebecf4') in 0.235048 seconds
Shader 'Shader Graphs/DefaultVFXSG': fallback shader 'Hidden/Shader Graph/FallbackError' not found
WARNING: Shader Unsupported: 'Shader Graphs/DefaultVFXSG' - All subshaders removed
WARNING: Shader Did you use #pragma only_renderers and omit this platform?
WARNING: Shader If subshaders removal was intentional, you may have forgotten turning Fallback off?
WARNING: Shader Unsupported: 'Shader Graphs/DefaultVFXSG' - All subshaders removed
WARNING: Shader Did you use #pragma only_renderers and omit this platform?
WARNING: Shader If subshaders removal was intentional, you may have forgotten turning Fallback off?
Start importing Assets/Art/Characters/CharacterCustomisation/Bundles/WeaponMeshes/Materials/M_HeavyFlamer1.mat using Guid(a75e2c188b451994e85483862baafa91) Importer(-1,00000000000000000000000000000000) ImportCustomStampMark: import began at 01.07.2024 18:07:03
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
Owlcat.Editor.Import.AssetImportPostprocessor:OnPreprocessAsset () (at Assets/Code/Owlcat/Editor/Import/AssetImportPostprocessor.cs:133)
System.Reflection.RuntimeMethodInfo:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
System.Reflection.MethodBase:Invoke (object,object[])
UnityEditor.AssetPostprocessingInternal:InvokeMethodIfAvailable (object,string,object[])
UnityEditor.AssetPostprocessingInternal:PreprocessAsset ()
(Filename: Assets/Code/Owlcat/Editor/Import/AssetImportPostprocessor.cs Line: 133)
-> (artifact id: '0f0b464e3018abd2ea95035f8c54f472') in 0.002205 seconds
-> (artifact id: 'cdbd5ff722a2a4a7e37c1e27656226e2') in 0.249744 seconds
Shader 'Shader Graphs/DefaultVFXSG': fallback shader 'Hidden/Shader Graph/FallbackError' not found
In our rather large project where the repo and library take up about 1TB, when cloning a repository this error has catastrophic consequences. Each error on material import is processed up to one minute! According to my calculations, what we have now is imported in 8-9 hours should be imported in 2 hours!
I’m logging into the editor’s logs with:
Yesterday I checked everything in different versions and formed an opinion:
In versions 2022.3.7f1, 2022.3.36f1, 2023.1.20f1, 2023.2.20f1 if you install ShaderGraph and VisualEffectGraph in a project and remove the library or clone such a repository where there are these pkeges, the first opening will be with errors:
WARNING: Shader Unsupported: ‘Shader Graphs/DefaultVFXSG’ - All subshaders removed
Shader ‘Shader Graphs/DefaultVFXSG’: fallback shader ‘Hidden/Shader Graph/FallbackError’ not found
in the logs under AppData/Local/Unity/Editor.
This is due to the fact that at some point DefaultVFXSG.shadergraph graph from VisualEffectGraph, tries to compile, but the shader on the basis of which this graph is built is not yet there, as it is in the ShaderGraph assembly, which is not imported yet.
First of all, the peckedges themselves are imported in the wrong order, first VisualEffectGraph then ShaderGraph, and their assemblies are scattered over the time and place of import so much that it is not clear at all.
In version 6000.0.7f1 this moment is either fixed intentionally or a consequence of refact, there is not even DefaultVFXSG.shadergraph asset.
It would be nice to fix it in versions up to 6k. And perhaps someone can tell me why it generally tries to compile when importing materials, I looked at the materials with importing which pops up this error they are in no way related to either ShaderGraph or VisualEffectGraph they are on our HLSL Lit shader.