0

Errors opening a shader built into an Asset Bundle

MattConroy 8 aastat tagasi uuendatud 8 aastat tagasi 1

On pressing the "Open shader in Shader Forge" button on a Material that has been loaded from an Asset Bundle, the Shader Forge window will open, lock up, churn out errors to the Console.


The errors start with:

ArgumentException: Empty path not allowed

System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:159)
System.IO.StreamReader..ctor (System.String path)
(wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string)
System.IO.File.OpenText (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:368)
System.IO.File.ReadAllLines (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:560)
ShaderForge.SF_Parser.ExtractShaderForgeData (UnityEngine.Shader s, System.Single& version, Boolean setPath, Boolean findRenderers, Boolean findLOD)
ShaderForge.SF_Parser.ParseNodeDataFromShader (ShaderForge.SF_Editor editor, UnityEngine.Shader s)
ShaderForge.SF_Editor.InitializeInstance (UnityEngine.Shader initShader)
ShaderForge.SF_Editor.Init (UnityEngine.Shader initShader)
ShaderForgeMaterialInspector.OnInspectorGUI () (at Assets/ShaderForge/Editor/InternalResources/Inspectors/ShaderForgeMaterialInspector.cs:85)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1227)
UnityEditor.DockArea:OnGUI()


And then repeatedly:


NullReferenceException: Object reference not set to an instance of an object

ShaderForge.SFPSC_Meta.DrawInner (UnityEngine.Rect& r)
ShaderForge.SFPS_Category.Draw (Single yOffset)
ShaderForge.SF_PassSettings.OnLocalGUI (Int32 yOffset, Int32 in_maxWidth)
ShaderForge.SF_Editor.DrawPreviewPanel (Rect r)
ShaderForge.SF_Editor.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)


A similar thing happens when you try and open a built-in shader using the same button.