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. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  5. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    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:
    204
    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:
    296
    Seconded!
     
  3. Deleted User

    Deleted User

    Guest

    Definitely third!
     
  4. Antony-Blackett

    Antony-Blackett

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

    troxmo

    Joined:
    Mar 16, 2022
    Posts:
    1
    is this still not a thing?
     
  6. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    27
    And a Save All graphs button too!
     
  7. ashtorak

    ashtorak

    Joined:
    Feb 19, 2014
    Posts:
    38
    Some auto save functionality would also be nice while you are at it :)
     
  8. Ziflin

    Ziflin

    Joined:
    Mar 12, 2013
    Posts:
    119
    Three years to get a shortcut for something as basic as save functionality is a bit frustrating. Is there a feature request for this anywhere? I agree that I often find myself pressing Ctrl+S thinking the shader saved only to realize a while late that it didn't. It seems quite broken the way it is...
     
    moonshinebot likes this.
  9. moonshinebot

    moonshinebot

    Joined:
    Sep 30, 2021
    Posts:
    17
    Why is this not yet a thing :) Is there some workaround to the missing keyboard shortcut? Some scriptable save mechanism, maybe using reflection?