Opened in Unity 2020.2.1f1, with URP/Shadergraph 10.2.2 and keep getting an error in the CharacterToonV2 shadergraph whenever I try to edit, or just move, a node:
“ArgumentNullException: Value cannot be null.
Parameter name: identifier” (full error below)
When this happens I can’t edit anything in the graph.
I’ve tried solutions I found to similar problems people have had on the forums like, restarting unity, rebuilding library folder, resizing the material preview window, reloading UI, but the error persists.
The shader works fine in the viewport, and the other shadergraphs in the project can be edited.
I’ve recently filed a bug report describing pretty much this. In my case, it felt like it was somehow related to graph complexity and having too many keyword properties in the graph + nested sub graphs.
I’m having the same issue but on SubGraph objects. Every time I open a subgraph (new or otherwise) and try editing anything I get the same error message as OP’s. Trying to save the graph with the save asset button does nothing but shows (nothing loaded) next to the asset’s name in the name tab.
Currently on Unity 2021.1.0f1 and URP 11.0.0. I’ve tried removing and reinstalling the URP package as well as deleting the Library folder. Nothing worked so far.
I’m consistently getting this error even when starting a new project from scratch. Steps to reproduce
Create a new URP project
Create a SubGraph and open it to edit
Create a new property and name it
Error shows up as soon as I click the property to drag it into the graph
Notes
I’m able to create and connect nodes normally, as well as save the graph as long as I don’t define any custom properties
Non subgraph shadergraphs work normally
May or may not be related, but my editor view is really laggy when using vertex displacement in my shaders, but it runs smoothly when I move the editor camera and keep a mouse button or key pressed after moving.
Full error message
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers.ShaderInputPropertyDrawer.UpdateEnableState () (at Library/PackageCache/com.unity.shadergraph@11.0.0/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs:142)
UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers.ShaderInputPropertyDrawer.DrawProperty (System.Reflection.PropertyInfo propertyInfo, System.Object actualObject, UnityEditor.ShaderGraph.Drawing.InspectableAttribute attribute) (at Library/PackageCache/com.unity.shadergraph@11.0.0/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs:108)
UnityEditor.ShaderGraph.Drawing.Inspector.InspectorUtils.GatherInspectorContent (System.Collections.Generic.List`1[T] propertyDrawerList, UnityEngine.UIElements.VisualElement outputVisualElement, UnityEditor.ShaderGraph.Drawing.IInspectable inspectable, System.Action propertyChangeCallback, UnityEditor.ShaderGraph.Drawing.IPropertyDrawer propertyDrawerToUse) (at Library/PackageCache/com.unity.shadergraph@11.0.0/Editor/Drawing/Inspector/InspectorView.cs:195)
UnityEditor.ShaderGraph.Drawing.Inspector.InspectorView.DrawInspectable (UnityEngine.UIElements.VisualElement outputVisualElement, UnityEditor.ShaderGraph.Drawing.IInspectable inspectable, UnityEditor.ShaderGraph.Drawing.IPropertyDrawer propertyDrawerToUse) (at Library/PackageCache/com.unity.shadergraph@11.0.0/Editor/Drawing/Inspector/InspectorView.cs:140)
UnityEditor.ShaderGraph.Drawing.Inspector.InspectorView.Update () (at Library/PackageCache/com.unity.shadergraph@11.0.0/Editor/Drawing/Inspector/InspectorView.cs:126)
UnityEditor.ShaderGraph.Drawing.GraphEditorView.HandleGraphChanges (System.Boolean wasUndoRedoPerformed) (at Library/PackageCache/com.unity.shadergraph@11.0.0/Editor/Drawing/Views/GraphEditorView.cs:654)
UnityEditor.ShaderGraph.Drawing.MaterialGraphEditWindow.Update () (at Library/PackageCache/com.unity.shadergraph@11.0.0/Editor/Drawing/MaterialGraphEditWindow.cs:330)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
I’ve got a fresh install on a different machine behaving exactly the same way. Both on windows 10.
Both URP and HDRP projects show exact the same issue (tested with fresh HDRP template project).
I’ve been able to somewhat work around the issue by never clicking on any property node. For now, I can create a new property on subgraphs by creating an input node of the type I need, then right clicking the node > convert to > property. Still cannot rename the created property because that involves clicking (or right-clicking) on the property node, which throws the same error and prevents me from saving. Property nodes on top-level Shader Graphs do not present this issue.
I had a different issue from the bug report, but figured it would be worthwhile to mention here. My shader graphs were displaying pink and failing to save or compile with the text (nothing loaded) next to the name of the shader in the shader graph tab. I fixed it in my case by opening all of my sub-graphs and manually clicking “Save Asset,” which caused the contents to resave and reimport and fixed the “nothing loaded” problem with my main shaders.
I am not sure if the reason for this particular variation of the issue was related to version control and Unity not being able to write to those files during the import process, which would be a bug either way. But I was able to work around the problem with manually updating and saving the sub-graphs. Hope that helps someone!
I’ve created a project in a new project (same Unity version 2021.2.0f1, same ShaderGraph version 12.1.0) and create some shaders with shader graph.
Both project worked well.
I finished my second one and would like to merge it with the 1st one, so I’ve created a package.
Once I imported that one in my project all shadergraph where broken, unity can’t recognize them as shadergraph, asking me to find a software to open it.
I spend few days working on that and don’t understand what’s going on ?