0
Fixed

index error

Michael Howell 11 років тому оновлено Luca Eberhart 10 років тому 9
Every time I load this particular shader I get this error. It runs in unity, but opening it in shaderforge causes this error.

Shader editor doesn't fully load.
Closing editor causes every link to break and the shader goes black in scene.

IndexOutOfRangeException: Array index is out of range.
ShaderForge.SF_Parser+SF_Link..ctor (Int32 sNode, System.String linkData)
ShaderForge.SF_Parser.DeserializeNode (System.String row, System.Collections.Generic.List`1& linkList)
ShaderForge.SF_Parser.LoadFromNodeData (System.String data, 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__28 ()
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/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

here's a paste of the shader

http://pastebin.com/has6gTXD
Under review
It's because you were using vertical | pipe | characters | in your property name, which breaks the serialization. I removed them in the shader here:

http://pastebin.com/GGJYCX85
Could you help me to fix the problem? :)
Replace the SF_DATA lines with this, and it might work:

/*SF_DATA;ver:1.04;sub:START;pass:START;ps:flbk:,lico:1,lgpr:1,nrmq:1,limd:1,uamb:True,mssp:True,lmpd:False,lprd:True,rprd:False,enco:False,frtr:True,vitr:True,dbil:True,rmgx:True,rpth:0,hqsc:True,hqlp:False,tesm:0,blpr:0,bsrc:0,bdst:1,culm:0,dpts:2,wrdp:True,dith:2,ufog:True,aust:True,igpj:False,qofs:0,qpre:1,rntp:1,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,ofsf:0,ofsu:0,f2p0:False;
n:type:ShaderForge.SFN_Final,id:5453,x:32829,y:32702,varname:node_5453,prsc:2|diff-6419-RGB,spec-9615-OUT,gloss-6792-OUT,normal-3107-RGB,amspl-7347-OUT;
n:type:ShaderForge.SFN_Tex2d,id:6419,x:31849,y:32445,ptovrint:False,ptlb:Diffuse,ptin:_Diffuse,varname:node_6419,prsc:2,tex:e6704f29740c84647b8dd17cd40bb4bb,ntxv:0,isnm:False;
n:type:ShaderForge.SFN_Tex2d,id:3107,x:32424,y:32933,ptovrint:False,ptlb:Normal,ptin:_Normal,varname:node_3107,prsc:2,tex:6af146ab2f1d1eb47b028c88a7e47214,ntxv:3,isnm:True;
n:type:ShaderForge.SFN_Fresnel,id:7347,x:32412,y:33135,varname:node_7347,prsc:2|EXP-4566-OUT;
n:type:ShaderForge.SFN_ValueProperty,id:6792,x:32436,y:32841,ptovrint:False,ptlb:Glossiness,ptin:_Glossiness,varname:node_6792,prsc:2,glob:False,v1:0.5;
n:type:ShaderForge.SFN_Multiply,id:6757,x:32140,y:32563,varname:node_6757,prsc:2|A-6419-RGB,B-6419-A;
n:type:ShaderForge.SFN_Add,id:9615,x:32436,y:32692,varname:node_9615,prsc:2|A-6757-OUT,B-6757-OUT;
n:type:ShaderForge.SFN_Vector1,id:4566,x:32079,y:33191,varname:node_4566,prsc:2,v1:4;proporder:6792-6419-3107;pass:END;sub:END;*/
It returns these errors:

FormatException: Value is not equivalent to either TrueString or FalseString.
System.Boolean.Parse (System.String value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Boolean.cs:186)
ShaderForge.SFPSC_Experimental.Deserialize (System.String key, System.String value)
ShaderForge.SF_PassSettings.Deserialize (System.String key, System.String value)
ShaderForge.SF_PassSettings.Deserialize (System.String s)
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)
ShaderForgeMaterialInspector.OnInspectorGUI ()
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/Inspector/InspectorWindow.cs:1093)
UnityEditor.DockArea:OnGUI()
Might have included too many line breaks in there, try removing them