Your comments

Works in Unity 5.3.5 / SF 1.28


Thanks for the fix :) How did you troubleshoot?

Getting the same issue today in Unity 5.4.0f3 with SF 1.28


Spent all day working on a shader, closed Unity, and now when attempting to reopen shader for editing, I get this exception. Here's the code: http://pastebin.com/dNGRxcCH


From the Unity Console:


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

ShaderForge.SF_Node.GetInputData (System.String id)
ShaderForge.SFN_Lerp.IsUniformOutput ()
ShaderForge.SFN_If.IsUniformOutput ()
ShaderForge.SF_NodePreview.Combine ()
ShaderForge.SF_Node.RefreshValue (Int32 ia, Int32 ib)
ShaderForge.SF_Node_Arithmetic.RefreshValue ()
ShaderForge.SF_Node.OnUpdateNode (NodeUpdateType updType, Boolean cascade)
ShaderForge.SF_NodeConnector.SetValueType (ValueType vt)
ShaderForge.SFNCG_Arithmetic.SetOutputValueType (ValueType vt)
ShaderForge.SFNCG_Arithmetic.Refresh ()
ShaderForge.SF_NodeConnector.LinkTo (ShaderForge.SF_NodeConnector other, LinkingMethod linkMethod, Boolean registerUndo)
ShaderForge.SF_Link.Establish (ShaderForge.SF_Editor editor, LinkingMethod linkMethod)
ShaderForge.SF_Parser.LoadFromNodeData (System.String data, Single version, System.String& missingNode)
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)
ShaderForge.SF_Editor.OpenLoadDialog ()
ShaderForge.SF_Editor.<DrawPrimaryMainMenuGUI>b__32 ()
ShaderForge.SF_Editor.FlexHorizontal (System.Action func)
ShaderForge.SF_Editor.DrawPrimaryMainMenuGUI ()
ShaderForge.SF_Editor.DrawMainMenu ()
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)
In the network below, I have been testing the inputs to the Specular channel. I would like to leave all the connections in place, but temporarily disable them - to compare results before and after.

I realize that I can simply cut the connection, but if I do this and then take a break or do other work, I may forget where it was connected before. This is a minor workflow issue, complicated by the default behavior of some nodes which require all inputs to be connected (these nodes are in effect, muted until all inputs are satisfied). I am not convinced that it's feasible at this point as mute will change meaning for different nodes. 

An alternative to this might be color coding connections - to increase visibility of node chains, but this might be difficult to implement - what color is the output of a multi-input node?