0
Fixed

NullReferenceException when creating a new shader using "Replace with Shader Forge" v1.02 Unity 4.6.1f1

Burton Posey 9 years ago updated by Freya Holmér (Developer) 9 years ago 4
Shader Forge version: 1.02
Unity version: 4.6.1f1

First off, I just updated Shader Forge from a pretty old version today. I did this by deleting all of my ShaderForge files and clean imported ShaderForge from the Asset Store download.

After this, I did my normal workflow, which is to create a new Shader in Unity by right clicking in the Project->Create->Shader. When I select this new Shader and click "Replace with Shader Forge shader" and press "Yes" on the "Delete Existing Shader?" dialog, I get the following error spam in the console:

NullReferenceException: Object reference not set to an instance of an object
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-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)


I get this spam as long as the Shader Forge window has focus. I cannot close this window, and it doesn't replace the shader. I can continue to use Unity, so long as I do not need to interact with Shader Forge window. I can repeat this without fail every time.

I do not have any problem creating a shader through Shader Forge or loading a shader that was previously made or converted with Shader Forge.

Thanks,
Burton
+1
Fixed
This has already been fixed in the coming 1.03 version :)

http://acegikmo.com/shaderforge/changelog/

Thanks for the detailed report anyhow!
Thanks for all of your hard work! Take care :)