Search Issue Tracker
Found in [Package]
[Shader Graph] NullReferenceException error thrown on selecting any property in Blackboard window in Subgraph Shader Graph
-ArgumentNullException error is thrown on deleting property from the Blackboard window.
-NullReferenceException error thrown on selecting any property in Blackboard window in Subgraph Shader Graph.
Steps to repro:
1. Create a new HDRP template project.
2. Project > Click on "+" > Shader > SubGraph.
3. Open SubGraph > Blackboard > Click on "+" > Vector2.
4. Select Vector2 property.
NullReferenceException error thrown in the console.
No error in the console.
2021.2.0a7, 2021.1.0b10, 2021.1.0a10 with Package version 12.0.0, 11.0.0.
Working Fine in:
2021.1.a9, 2020.2.7f1 with Package version 10.3.2, 10.3.1.
2021.1.17f1 with Package version 9.0.0-preview.71.
2019.4.21f with Package version 7.5.3.
Occurring on Windows 10 & Mac 10.15.
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers.ShaderInputPropertyDrawer.UpdateEnableState () (at Library/PackageCacheemail@example.com/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/PackageCachefirstname.lastname@example.org/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/PackageCacheemail@example.com/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/PackageCachefirstname.lastname@example.org/Editor/Drawing/Inspector/InspectorView.cs:140)
UnityEditor.ShaderGraph.Drawing.Inspector.InspectorView.Update () (at Library/PackageCacheemail@example.com/Editor/Drawing/Inspector/InspectorView.cs:126)
UnityEditor.ShaderGraph.Drawing.GraphEditorView.HandleGraphChanges (System.Boolean wasUndoRedoPerformed) (at Library/PackageCachefirstname.lastname@example.org/Editor/Drawing/Views/GraphEditorView.cs:654)
UnityEditor.ShaderGraph.Drawing.MaterialGraphEditWindow.Update () (at Library/PackageCacheemail@example.com/Editor/Drawing/MaterialGraphEditWindow.cs:330)
ArgumentNullException: Value cannot be null.
Parameter name: identifier
UnityEditor.Undo.RegisterCompleteObjectUndo (UnityEngine.Object objectToUndo, System.String name) (at <c2e9ddac9be94c64888ec1c467657510>:0)
UnityEditor.Graphing.GraphObject.RegisterCompleteObjectUndo (System.String actionName) (at Library/PackageCachefirstname.lastname@example.org/Editor/Data/Implementation/GraphObject.cs:54)
UnityEditor.ShaderGraph.Drawing.MaterialGraphView.DeleteSelectionImplementation (System.String operationName, UnityEditor.Experimental.GraphView.GraphView+AskUser askUser) (at Library/PackageCacheemail@example.com/Editor/Drawing/Views/MaterialGraphView.cs:891)
UnityEditor.ShaderGraph.Drawing.MaterialGraphView+<>c__DisplayClass38_0.<BuildContextualMenu>b__5 (UnityEngine.UIElements.DropdownMenuAction e) (at Library/PackageCachefirstname.lastname@example.org/Editor/Drawing/Views/MaterialGraphView.cs:343)
UnityEngine.UIElements.DropdownMenuAction.Execute () (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEditor.UIElements.EditorMenuExtensions+<>c__DisplayClass1_0.<PrepareMenu>b__0 () (at <cfee44c50c74452d92e0643773711d9d>:0)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String options, System.Int32 selected) (at <c2e9ddac9be94c64888ec1c467657510>:0)
Bug never reproduced in 21.2 as far as I can tell (did not repro in a7 or a6), making this case a duplicate of case 1328377, which was fixed in 2021.1.7f1 (11.0.0)
Mar 23, 2023 15:56
I was having this same issue but found a work around which doesn't make a lot of sense. But it worked for me, and now the issue is magically gone. Manually close the shadergraph tab before you run your scene. The error stopped for me. I had it crop up once more when I had it open again, but did the same thing. Now it is not happening at all.
Something strange going on under the hood, which is why some do not have the issue and others do. I was able to keep working though with this option above, hope it helps the rest of you.
Jun 18, 2022 08:00
Just got this in 2022.1.4f1. Definitely not resolved.
May 14, 2021 01:12
Having this issue on URP 2021.1.4, Shadergraph 11.0.0 here. I cannot edit existing shader graphs or create new ones at all. How is this not higher priority, and how come there's no plan to apply the fix before 12.0.0?
May 10, 2021 10:22
We need an emergency hot fix
May 02, 2021 23:16
Still no conclusion? This problem seems to have no workaround and has entirely halted production on existing SubGraphs. I hope this can be resolved soon.
Apr 17, 2021 18:04
Sorry, meant to write HDRP 11 on 2021.1.3f1, not 2020.1.3f1.
Apr 17, 2021 17:56
Yes, cannot even create shaders due to this problem on HDRP 11, 2020.1.3f1. This needs an emergency hot fix please!!!
Apr 12, 2021 07:14
Any ETA on when this fix will release? It´s impossible to work with SubGraphs at the moment due to this.
This is breaking an essential package marked as "production ready" so I would assume this would have high priority.
Apr 08, 2021 09:21
Same happening on Mac Os 10.15.17, Unity 2021.1.1f1 and Shadergraph 11.
I migrated a project from Unity 2020 to 2021 and now my graph are broken when I try to edit them.
Apr 05, 2021 12:53
This also happens on URP for me.
I'm using Shadergraph version 11, and unity version 2021.1.1
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Filters dropdown: Window doesn't rescale on items collapse
- Sprite Preview is broken when the Sprite is too tall or too wide
- Objects are invisible in Scene view when using Wireframe Shading Mode
- The property of a component becomes read-only when it is bound to "PropertyStreamHandle"
- Physics.Raycast does not work when used on the whole model
This is a duplicate of issue #1328377