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 (14)

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

  2. 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.

  3. 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.

  4. 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.