Search Issue Tracker

Duplicate

Votes

28

Found in [Package]

12.0.0, 11.0.0.

Issue ID

1318882

Regression

Yes

[Shader Graph] NullReferenceException error thrown on selecting any property in Blackboard window in Subgraph Shader Graph

Package: 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.

Actual Result:
NullReferenceException error thrown in the console.

Expected Result:
No error in the console.

Reproducible in:
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.

Environment:
Occurring on Windows 10 & Mac 10.15.

Stack trace:
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()

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/PackageCache/com.unity.shadergraph@11.0.0/Editor/Data/Implementation/GraphObject.cs:54)
UnityEditor.ShaderGraph.Drawing.MaterialGraphView.DeleteSelectionImplementation (System.String operationName, UnityEditor.Experimental.GraphView.GraphView+AskUser askUser) (at Library/PackageCache/com.unity.shadergraph@11.0.0/Editor/Drawing/Views/MaterialGraphView.cs:891)
UnityEditor.ShaderGraph.Drawing.MaterialGraphView+<>c__DisplayClass38_0.<BuildContextualMenu>b__5 (UnityEngine.UIElements.DropdownMenuAction e) (at Library/PackageCache/com.unity.shadergraph@11.0.0/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)

  1. Resolution Note:

    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)

Comments (10)

  1. FunkMachine

    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.

  2. Llockham-Industries

    Jun 18, 2022 08:00

    Just got this in 2022.1.4f1. Definitely not resolved.

  3. crimsonbinome22

    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?

  4. xadrados

    May 10, 2021 10:22

    We need an emergency hot fix

  5. ZackPetropoulakis

    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.

  6. Korindian

    Apr 17, 2021 18:04

    Sorry, meant to write HDRP 11 on 2021.1.3f1, not 2020.1.3f1.

  7. Korindian

    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!!!

  8. HG_SB

    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.

  9. marras1994

    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.

  10. Aalegre

    Apr 05, 2021 12:53

    This also happens on URP for me.
    I'm using Shadergraph version 11, and unity version 2021.1.1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.