Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

HDRP Shader Graph - generate shader code from Graph - ArgumentNullException

Discussion in 'Graphics Experimental Previews' started by sstrong, Aug 2, 2018.

  1. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,255
    In ShaderGraph 3.0.0 (HDRP 3.0.0) and U2018.2.0f2, when I right-click Unit Master node and select "Generate Code" I get the following error:

    ArgumentNullException: Argument cannot be null.
    Parameter name: source
    System.Linq.Check.SourceAndPredicate (System.Object source, System.Object predicate)
    System.Linq.Enumerable.Where[Char] (IEnumerable`1 source, System.Func`2 predicate)
    UnityEditor.ShaderGraph.Drawing.MaterialNodeView.SanitizeName (System.String name) (at C:/Users/stephen.SCSM/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.shadergraph@3.0.0-preview/Editor/Drawing/Views/MaterialNodeView.cs:261)
    UnityEditor.ShaderGraph.Drawing.MaterialNodeView.ShowGeneratedCode () (at C:/Users/stephen.SCSM/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.shadergraph@3.0.0-preview/Editor/Drawing/Views/MaterialNodeView.cs:268)
     
    Last edited: Aug 2, 2018
  2. VOTRUBEC

    VOTRUBEC

    Joined:
    Dec 17, 2014
    Posts:
    106
    Did you ever get an answer for this? I've got the same issue in LW-SRP as well. It seems not so much whether it's LW or HD, but the Shader Graph itself..
     
  3. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    195
    Same here. Could you solve it?
     
  4. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,255
    Right-click, select Copy Shader and paste into a text editor.
     
    Desoxi likes this.
  5. Kink3d

    Kink3d

    Joined:
    Nov 16, 2015
    Posts:
    45
    Hi,

    We have fixes for this in PR that we are currently trying to get into the main branch. Until then please follow @sstrong 's advice and use "Copy Shader" to copy the full shader to clipboard.

    Thanks for your patience.
     
    Deleted User likes this.