Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Keyboard shortcuts are an essential and missing feature.

Discussion in 'Shader Graph' started by DigitalSalmon, Mar 23, 2020.

  1. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    This has been brought up many many times.

    Could we please have some keyboard shortcuts, like every other big boy shader editor since 2010?

    1,2,3,4,5 -> Vectors/Colours
    M - Mulitply
    O - One Minus
    S - Subtract
    A - Add
    D - Divide

    Are we waiting for integration with a new input package?
     
  2. Elizabeth_LeGros

    Elizabeth_LeGros

    Unity Technologies

    Joined:
    Jan 7, 2020
    Posts:
    50
  3. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    Do you guys not think this is an important feature? There is so much amazing work going into making SG really powerful, then the first thing i'm asked by every new artist on the team is "where are the keyboard shortcuts?"

    I'm just baffled that something like this would be considered a roadmap consideration, it's a bit like someone suggesting supporting normal maps or a multiply node...
     
  4. tweedie

    tweedie

    Joined:
    Apr 24, 2013
    Posts:
    311
    +1. It's pretty absurd Shadergraph doesn't have this, given how pervasive 1,2,3,4 are.

    That roadmap doesn't appear to have a place where we can view all the open suggestions, nor can I lend my support to an existing request. It would be nicer if there was a page where they could all be seen in one place and upvoted, to avoid duplicates, as well as discuss and converge on better versions of similar ideas. A bit like a forum.
     
  5. Elizabeth_LeGros

    Elizabeth_LeGros

    Unity Technologies

    Joined:
    Jan 7, 2020
    Posts:
    50
    I would say it is certainly a feature we want to support; its more a question of what we should be focusing on based on time/scheduling. This is something that has been discussed before, and unfortunately the solution is not something that can be accomplished quickly. So, then it becomes another task that we have to base priority on versus our other features/bugs we want to tackle. I say you should put it on the timeline because we are watching that timeline to see what features are most important to the community, and if this is something the community needs then we take that into consideration.

    You can vote on things on our roadmap, as well as add your own ideas! click on one of the things you think of as important and you can say how important it is to have!
     
  6. tweedie

    tweedie

    Joined:
    Apr 24, 2013
    Posts:
    311
    Thanks, I missed that. I still think it's a bit limiting, as I might like to upvote an issue to indicate its important to me, but explain why, or comment on details about a topic. For instance, a huge limitation of the built in pipeline is the inability for UI renderers to use MaterialPropertyBlocks, which was a huge frustration for many users. It would be good to be able to indicate on the UI roadmap item that this was a previous flaw we'd like to avoid. Either way I appreciate feedback on the feedback website isnt exactly relevant to this thread nor your responsibility :)

    Can you elaborate on why? Unless you're allowing remapping, or plan to integrate with / depend on another system in Unity like the new Shortcuts, this seems very trivial. I'm guessing there are good reasons why it isn't.
     
    hippocoder and Elizabeth_LeGros like this.
  7. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    Do you have any more information around why the solution can't be accomplished with relative ease? The MaterialGraphEditWindow has a reference to the GraphData, which contains an AddNode method which looks very well put together. I don't mean to over-simplify, and I appreciate how self-entitled I will be coming across, I'm just really struggling to see why this wasn't one of the first things to get done.

    I hate using UE4, but their material editor is crushing Unity, and it's not because of advanced features, it's because they have got the quality of life features like this.
     
    Unifikation likes this.
  8. Elizabeth_LeGros

    Elizabeth_LeGros

    Unity Technologies

    Joined:
    Jan 7, 2020
    Posts:
    50
    When you vote on something, you get a chance to explain why its important to you too :)

    Building the system cleanly is just not as simple as it looks from the top level, unfortunately. There's a bunch of quirks about the back end to account for, and only so many engineers on the team to be able to work. Not being vague to be mean, just trying not to break any NDAs or anything :D.

    The roadmap is the best way to help inform us of what the community wants and gives us the right info to prioritize tasks for shadergraph
     
  9. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    I really appreciate you taking the time.

    Respectfully, I think I have to simply agree to disagree.

    Line 332 of GraphEditorView.cs

    Code (CSharp):
    1.  
    2. if (evt.keyCode == KeyCode.M) {
    3.     if (m_Graph != null) {
    4.         m_Graph.AddNode(new MultiplyNode());
    5.     }
    6. }
    7.  
    When you press M, a new multiply node is created. It functions as expected, and saves and loads properly (As far as I can test).

    It's clear the GraphView/RegisterCallback approach might not enjoy the combination of hold keyboard button + mouse press. I also fully understand that whacking in some lines of code isn't the same as developing and following a robust and consistent approach.

     
  10. Elizabeth_LeGros

    Elizabeth_LeGros

    Unity Technologies

    Joined:
    Jan 7, 2020
    Posts:
    50
    You're not wrong that this is one approach that works; its the backend side that we find the quirks/complexity.

    That being said, this is a great way to add that functionality locally and if you are finding you need it now this is a good solution!

    BUT modifying package code does mean upgrades may not be fun later, just something to keep in mind.
     
  11. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    Code (CSharp):
    1.  
    2. internal class KeyboardShortcutHelper
    3.     {
    4.         private MaterialGraphView GraphView { get; }
    5.         private GraphData GraphData { get; }
    6.  
    7.         public KeyboardShortcutHelper(MaterialGraphView graphView, GraphData graph)
    8.         {
    9.             GraphView = graphView;
    10.             GraphData = graph;
    11.  
    12.             GraphView.RegisterCallback<KeyDownEvent>(OnKeyDown);
    13.         }
    14.  
    15.         void OnKeyDown(KeyDownEvent evt) {
    16.             if (GraphData == null) return;
    17.  
    18.             Vector2 pos = evt.originalMousePosition;
    19.  
    20.             switch (evt.keyCode) {
    21.                 case KeyCode.O:
    22.                     CreateNode(() => new OneMinusNode(), pos);
    23.                     break;
    24.                 case KeyCode.M:
    25.                     CreateNode(() => new MultiplyNode(), pos);
    26.                     break;
    27.                 case KeyCode.L:
    28.                     CreateNode(() => new LerpNode(), pos);
    29.                     break;
    30.                 case KeyCode.D:
    31.                     CreateNode(() => new DivideNode(), pos);
    32.                     break;
    33.                 case KeyCode.S:
    34.                     CreateNode(() => new SubtractNode(), pos);
    35.                     break;
    36.                 case KeyCode.A:
    37.                     CreateNode(() => new AddNode(), pos);
    38.                     break;
    39.                 case KeyCode.F:
    40.                     CreateNode(() => new FractionNode(), pos);
    41.                     break;
    42.                 case KeyCode.Alpha1:
    43.                     CreateNode(() => new Vector1Node(), pos);
    44.                     break;
    45.                 case KeyCode.Alpha2:
    46.                     CreateNode(() => new Vector2Node(), pos);
    47.                     break;
    48.                 case KeyCode.Alpha3:
    49.                     CreateNode(() => new Vector3Node(), pos);
    50.                     break;
    51.                 case KeyCode.Alpha4:
    52.                     CreateNode(() => new Vector4Node(), pos);
    53.                     break;
    54.                 case KeyCode.Alpha5:
    55.                     CreateNode(() => new ColorNode(), pos);
    56.                     break;
    57.             }
    58.         }
    59.  
    60.         private void CreateNode(Func<AbstractMaterialNode> createNode, Vector2 pos) {
    61.             AbstractMaterialNode multiplyNode = createNode();
    62.  
    63.             var drawState = multiplyNode.drawState;
    64.             Vector2 p = GraphView.contentViewContainer.WorldToLocal(pos);
    65.  
    66.             drawState.position = new Rect(p.x, p.y, drawState.position.width, drawState.position.height);
    67.             multiplyNode.drawState = drawState;
    68.             GraphData.AddNode(multiplyNode);
    69.         }
    70.     }
    71.  
    Add this to the top of GraphEditorView.cs

    Code (CSharp):
    1. KeyboardShortcutHelper shortcutHelper = new KeyboardShortcutHelper(graphView, graph);
    Add this to the end of the constructor for GraphEditorView

    -

    Any early warnings on which quirks this is going to hit would be appreciated so I can ahead of them before they bite me!

    This, if it continues to work, makes ShaderGraph fundamentally better. Would be totally down for cleaning it up + PR.
     
    Last edited: Mar 24, 2020
  12. Elizabeth_LeGros

    Elizabeth_LeGros

    Unity Technologies

    Joined:
    Jan 7, 2020
    Posts:
    50
    Nice solution! Like I said, this works great on a local user case.

    Part of the reason why we can't do this is simply because shadergraph is an official part of the Unity ecosystem, and so we need to keep consistent behavior with other systems. Take VFX graph: the solution here would need to work for both teams and so couldnt just be thrown in GraphData. Then we need to make sure these settings are exposed for accessibility and decisions need to be made about where those settings live (per graph, per project, etc). We then also need to decide how a node gets its own keyboard shortcut - can users specify one themselves? If so, what happens if they want a pipeline specific node to have a hotkey, and a different pipeline gets chosen? Etc etc

    We want to make shadergraph into the best tool it can possibly be, and that sometimes means not doing the quick code fix in favor of a total and robust fix later. Thats why I am so heavily encouraging adding this to our timeline - so we can give the problem the time it needs for a robust and great solution that meets community and Unity standards
     
  13. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    I think it's excellent that decisions are being thought out before action being taken, and that lots of use cases are being considered - It's a great approach to ensure ongoing commitments don't become technical debt.

    I think the goal of maintaining parity with VFX Graph is admirable, but the list of differences at present is testament to the fact that ultimately, the focus is on feature set before consistency. This is infinitely truer in the context of Unity's wider code base.

    If a feature can get a massive amount of the way towards covering 90% of users/use cases, without actively impeding your ability to extend or exchange it later, then I believe there is a strong case to be made that the decision Unity have made is the wrong one. One day of developer time to save countless hundreds of hours in the short-medium term is amazing value.

    I'll stop pushing! I appreciate I don't have the full picture. Thank you very much for taking so much time. Stay safe!
     
    Last edited: Mar 24, 2020
    qoobit likes this.
  14. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    260
    How is there still not a save shortcut in the unity shader graph? This is essential
     
    kdbguy and Alex_Zutari like this.
  15. curiouspers

    curiouspers

    Joined:
    Aug 7, 2014
    Posts:
    19
    +1 for this feature, also thanks DigitalSalmon for workaround
     
    Alex_Zutari likes this.
  16. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    Almost a year old, and still nothing :( Hard to imagine how many thousands of hours have been wasted by developers.
     
  17. Alex_Zutari

    Alex_Zutari

    Joined:
    Jun 5, 2019
    Posts:
    2
    Lack of shortcuts has been the only thing holding me back from using Shader Graph.

    As a Houdini user, I feel like my arms and legs are tied and I'm only allowed to use 1 finger to do my work inside Shader Graph.

    I'll definitely be using your solution for the time being @DigitalSalmon thanks for taking the time and effort into doing something that Unity Tech Team should have done for us (as an addable asset from the asset store or package manager) a long time ago.
     
    Unifikation likes this.
  18. seonghwan-dev

    seonghwan-dev

    Joined:
    May 3, 2021
    Posts:
    2
    mgear and dhiben like this.
  19. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    And we're into 2022, and there are still no proper keyboard shortcuts in ShaderGraph!

    I can only draw the conclusion that Unity think your time doesn't matter, as this *still* missing feature has become a constant reminder of how headline$ are more important than quality of life features.

    There shouldn't need to be a feature request. There shouldn't need to be almost 2 years of dev work. This is an embarrassment to the engine.

    And to return to parity a year on - The VFX Graph arithmetic nodes are still different, so the idea that parity should have any influence over feature priority is just not valid.
     
    IsmailBurakCendik and florianBrn like this.
  20. TimNedvyga

    TimNedvyga

    Joined:
    May 18, 2015
    Posts:
    95
    Totally agree, would be useful for VFX Graph too!
     
  21. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    481
    All the roadmap suggestions we make are hidden, so nobody will vote them anyways, except the person making the suggestion.

    Simple things like these shortcuts, register variables or having some custom attributes are still not added after years. Some features like enums are broken, exposed and override shader declaration makes 0 sense, the custom functions needing _float or _half makes any shader library unusable without modifications.

    Maybe, in a few years, because 5-6 years is still to little for these tools to mature, while we got some better tools developed by 1 person in months.
     
    IsmailBurakCendik, tweedie and Ruchir like this.
  22. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    It doesn't really feel like anyone at Unity is working on Shader Graph does it?

    People who actually use these tools would not make the decisions that are being made.

    Poor management? Lack of funding? Never used the superior competing tools?
     
  23. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    481
    It feels like shader graph is yet another tool made because a cool blog post can be written about it. The only good part I can find about it, is that it kind of work properly with the ever changing render pipelines. Other than that, it is like using instagram for creation shaders.
     
    IsmailBurakCendik likes this.
  24. tweedie

    tweedie

    Joined:
    Apr 24, 2013
    Posts:
    311
    In 2020, Unity reported 1.5 million monthly creators.

    Assume just 1% of them use ShaderGraph in a capacity where shortcuts would have saved them just 5 minutes time across a whole 1 month period.

    23 months have passed since this thread was created. 23 months. Almost two years.

    1,500,000 * 0.01 * (5/60) * 23 = 28,750 hours of developer time wasted. I think the real figure could easily be 5x that.

    Quality of Life features really matter, and small savings add up. Imagine how ridiculous it would be if Undo/Redo were not mapped to hotkeys, because that is the level of absurdity we are talking about here.

    What state of internal affairs are necessary for shortcuts to take 2 years to be implemented?
     
    florianBrn and Ruchir like this.
  25. calc1fer

    calc1fer

    Joined:
    Oct 5, 2019
    Posts:
    62
    The fact that this feature is still not considered a priority shows very well how RIDICULOUS Unity is.
     
    Kabinet13 likes this.
  26. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    This is your monthly reminder that Unity's flagship shader tool does not have keyboard shortcuts.

    Fun fact about shortcuts - One of the earliest examples was a "shift" key on a typewriter in 1878, used for upper/lower case switching. That was 144 years ago.
     
  27. TimNedvyga

    TimNedvyga

    Joined:
    May 18, 2015
    Posts:
    95

    Attached Files:

    florianBrn likes this.
  28. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    Hello from the future! It's now May 2022!

    Today's fact - It's been roughly 4,889,728 seconds since this thread was started.That's "1358 hours", or, if you prefer, "Enough time to implement a basic feature".

    Is the Shadergraph team hiring? Does such a team even exist? Would you like one less passive aggressive user, and one more very capable developer to come onboard to improve your package, perhaps to implement keyboard shortcuts? benjamin@digitalsalmon.co.uk
     
  29. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    679
    upload_2022-5-18_14-48-19.png
     
  30. aaaaaieeeeeeeee

    aaaaaieeeeeeeee

    Joined:
    Aug 17, 2014
    Posts:
    9
    I'm a bit confused about where to implement that in the script.
    I come from UE so im only good at graphs but i suck at scripting.
    Where is the end of the Constructor for GraphEditorView?
     
  31. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    Hey - Sorry mate, probably too much work to implement if you're not comfy with C# (Welcome to Unity!)

    You're not missing out on much - That hack does as *okay* job, but it's not really a QoL improvement as it doesn't rely on a "click" event. At some point I might take another crack at it.

    Best bet is to up vote the feature request, though I expect my general tone conveys my faith that anyone at Unity cares at all about Shadergraph.
     
    aaaaaieeeeeeeee likes this.
  32. tweedie

    tweedie

    Joined:
    Apr 24, 2013
    Posts:
    311
    Adding keyboard shortcuts has now taken more time than a new project takes to load in Unity 2020.x
     
  33. kdbguy

    kdbguy

    Joined:
    Aug 29, 2011
    Posts:
    16
    I can't believe we're halfway through another year and this is still "under consideration".

    I mean, how can we still not even use CTRL+S to save a graph in 2022?
     
  34. millionart

    millionart

    Joined:
    Sep 19, 2014
    Posts:
    1
    IsmailBurakCendik likes this.
  35. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    Anther mnth, anther letter n my keybard sacrificed in a bld ritual in the hpes that Unity will cme dwn frm their clud and put a dev team n their flagship shader editr.

    Hpefully they arrive sn r things are ging t get tricky.
     
    Last edited: Jul 14, 2022
    timmehhhhhhh and funkyCoty like this.
  36. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    upload_2022-8-5_11-9-15.png

    Boy the Shadergraph team have been busy. Amazed they found time to update the package version number.
     
    IsmailBurakCendik and Qriva like this.
  37. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    481
    curiouspers, Ben_at_Work and Ruchir like this.
  38. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    Remember remember the 9th of September. The day that Shadergraph still didn't have keyboard shortcuts.
     
  39. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    Almost halloween! Todays spoooooky fact! "Shortcut" is defined as "an alternative route that is shorter than the one usually taken." - Like when competent developers make shorter routes for their users, saving them time!

    The opposite of a shortcut is "the long way" - Like when incompetent developers don't bother for years whilst claiming their package is "flagship", then wonder why all their users are leaving for Unreal Engine.
     
    funkyCoty likes this.
  40. PinguPongu

    PinguPongu

    Joined:
    Feb 2, 2021
    Posts:
    23
    Shortcuts in Shadergraph would save me hours just of: pressing spacebar, taking my hand of the mouse to write "Multpily", pressing enter, seeing no results, realizing I spelled Multiply wrong, clicking on the shadergraph window again, pressing spacebar, typing Multiply again and pressing enter.
    vs how Amplify does it
    pressing "M" and left clicking.
     
    Last edited: Jan 10, 2023
  41. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    As we approach this threads 3rd birthday, let's all decide what to get it as a present - I think if we all pitch in by, for example, paying for a Unity license, we might just have enough to hire it a competent development team that gives a crap about it's users?

    Or maybe a t-shirt that says "I visited Unity's flagship shader editor and all I got was infuriated by their utter contempt for their users".

    Or how about we just buy a cake, get it delivered to the SG team, but then we just eat it ourselves when it gets return to sender because there isn't one.
     
  42. IsmailBurakCendik

    IsmailBurakCendik

    Joined:
    Apr 21, 2017
    Posts:
    8
    Such a shame. Read whole thread, I am more than happy to see some other passionate developers such as @DigitalSalmon implemented his own solution and really trying to get some attention here.

    This is another good reason which keeps me on track using Amplify Shader Editor instead of this :)
     
  43. Greg_Littlefield

    Greg_Littlefield

    Joined:
    Jun 5, 2018
    Posts:
    5
    I can't believe the year is 2023 and Unity's own solution doesn't support such a basic, essential, and easy to implement, feature. This is just mind boggling..
    Our team just moved from our previous Unity 2019 project where we used a 3rd party shader editor (Amplify), to try Shader Graph and needless to say we won't be using it.
     
    Unifikation likes this.
  44. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    Please may we have keyboard shortcuts in Shadergraph?
     
    Unifikation likes this.
  45. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    I got married last Tuesday! That means I was able to meet a lovely girl, get engaged, plan and execute a wonderful wedding, and in that time... we still don't have keyboard shortcuts.

    I'll be sure to let you know when my first born child arrives in the hopes that one day I may be able to teach them Shadergraph without them having to endure the utterly shameful experience that Unity thinks it's developers currently deserve.
     
  46. PixelDough

    PixelDough

    Joined:
    Apr 27, 2018
    Posts:
    45
    Congrats on the marriage, @DigitalSalmon ! Here's to hoping the next generation might be able to use a modern shader editor with normal modern features :p
     
    Unifikation likes this.
  47. jadenbalogh

    jadenbalogh

    Joined:
    Jun 6, 2017
    Posts:
    8
    Not to come on this forum and just complain, but... yes, keyboard shortcuts are a base feature. Just popped open ShaderGraph after not trying it for a couple years, and sure enough, Ctrl+S does nothing. As far as I know, ShaderGraph is not an experimental feature, and is not considered deprecated. So why doesn't Ctrl+S save my graph?

    I tried to check the linked product board, and failed to find any task about keyboard shortcuts. Not sure what else to say, other than... please? :)
     
    Unifikation likes this.
  48. FredMoreau

    FredMoreau

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    112
    Hey there,

    Here's the roadmap card.
    Please vote and give us feedback as to how you want to see this work.

    Thanks
     
  49. DigitalSalmon

    DigitalSalmon

    Joined:
    Jul 29, 2013
    Posts:
    99
    I'm glad there is... progress? But...

    Voting? Under consideration? Why would Unity wait for years, then ask for permission to finish their flagship shader editor?

    We want to see it work how Unreal, Shaderforge, or Amplify work. Like a real shader editor please.
     
  50. EricFFG

    EricFFG

    Joined:
    May 10, 2021
    Posts:
    176
    The first thought when using shader graph was "wow this is so much slower than Amplify shader, did the persons who made this ever use another editor or make shaders with it? Its impossible to imagine anyone who had used ASE would go back to this usability"

    I am still now using shader graph since third party things tend to break in really bad ways despite shader graph being much slower to use, at least it has a solid featureset and it can do basically all the things needed, so respectful on that id say. One big plus on SG is also that subgraphs don't require the main graph to be calculated again.

    The space search is also considerably slower than the ASE version as the search is a bit clunky in comparison and this is the main tool.

    Unity is doing features to check a checklist off, not to offer an optimal experience and the classic "Unity dosn't work with their own tools" is here as strong as always UX wise.