Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Feature Request Add keyboard shortcut for Save Asset

Discussion in 'Shader Graph' started by huulong, Dec 7, 2019.

  1. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    62
    This request has been made by SirIntruder https://forum.unity.com/threads/ux-...with-color-gradient-node.714512/#post-4773080, but it was a double-post therefore the thread title doesn't match the 2nd request, and I'm re-posting it properly here.

    When editing a shader, I sometimes have the impression I saved it, only to realize I'm still viewing the old shader in the game scene. This is because Ctrl+S is still mapped to File > Save (scene) when using the Shader Graph.

    For now, the only way to actually save the shader is to click Save Asset. A shortcut would make it easier to test the changes in the actual scene quickly (whether the user switches to the Scene tab, or split window between Scene and Shader Graph).

    I suggest the following:

    1a. When the Shader Graph tab is focused, Ctrl+S contextually remaps to Save Asset.
    This is the most intuitive, but there is a possible ambiguity with Save scene in case the user is using split window and didn't notice he/she was focusing Shader Graph rather than Scene tab. So the editor must feedback to the user that the shader was saved indeed, not the scene.

    or

    1b. Another shortcut, such as Ctrl+Alt+Shift+S, will Save Asset on the currently focused Shader Graph, if any. I prefer 1a to this solution due to the complexity of the shortcut compared to clicking on a button, but see Customization below.

    and

    2. An option to Save Asset automatically every X seconds (if any change detected), to avoid heavy processing while still being able to see the result in the Scene. Probably less convenient, though, it's more a backup idea to me.

    About Customization:

    I tried Edit > Shortcuts... to customize the Save Asset shortcut, but it seems it only works with top-bar menu items (and maybe even native Unity items, not items added by packages?). So Save Asset would have to be a menu item (rather than a button inside the tab), and the Shortcuts menu would have to support package/custom script menu items to allow us to customize the Save Asset shortcut.

    But to me, it would be the best as I guess some users would prefer a simpler shortcut (e.g. Ctrl+Alt+S is used for Version Control/Submit Changeset ... but I don't use Version Control so I could use this one instead). However, if they want to use Ctrl+S it will conflict with the existing Save (scene), and I don't think Unity can prioritize custom shortcuts like that (some code editors like Atom or Visual Studio allow you to define the context of a shortcut, but Unity doesn't), so some hardcoded work may still be needed in the end.

    Alternatively, there could be a Settings window just for the Shader Editor where you would customize the save shortcut. I'd rather have everything centralized though.

    I think in Unreal, I was using Ctrl+S in the Material Editor it would save my changes and saving is contextual in that editor.
     
  2. PatHightree

    PatHightree

    Joined:
    Aug 18, 2009
    Posts:
    268
    Seconded!
     
  3. jon_levin

    jon_levin

    Joined:
    Nov 24, 2019
    Posts:
    8
    Definitely third!
     
  4. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,557
    This has been an issue since forever... I remember requesting it in Unity 3.something... :( Fourth
     
unityunity