Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Truncated Filename in Project Window

Discussion in 'Editor & General Support' started by IARI, May 22, 2016.

  1. IARI

    IARI

    Joined:
    May 8, 2014
    Posts:
    70
    File Names In the Project Window are Truncated.
    Screenshot (2).png

    In a Folder with a lot of iconless elements (a collection of scripts) this is very annyong - I want to be able to see the full file name. This can be either by viewing the files
    • in a list style (vertically aligned)
    • fontsize adjustable independently of the icon-size
    • text wrapping for the tile-view
    • tiles with a landscape format instead of square
    Increasing the tilesize does dow NOT work:
    Screenshot (3).png
    Even when its at the highest end, whats getting big is mostly the tiles/icons (which is a complete waste of UI-space that could be used by i.e. the scene viewer.)
    The filename-string is still truncated a little less, but thats not enough.

    I don't really care how, but is it possible to just display the whole filename?
     
  2. ZackMFleischman

    ZackMFleischman

    Joined:
    Apr 10, 2017
    Posts:
    1
    +1 Oh god please yes someone figure this out
     
  3. Rayeloy

    Rayeloy

    Joined:
    Feb 12, 2017
    Posts:
    45
    +1, I need this. It's really frustrating to have to click on every item to see the whole name or to use the colunm view.
     
    revu_ likes this.
  4. PiotrPieniak

    PiotrPieniak

    Joined:
    Apr 15, 2019
    Posts:
    1
    +1, how to fix this...
     
  5. ammirea

    ammirea

    Joined:
    Oct 22, 2018
    Posts:
    8
    Another inconvenient is file names are truncated even when displaying "full" name. In our business we receive files containing periods inside and considered to have no extensions. Same with asset bundles which don't have extensions. Currently there's no way to view their names correctly in Unity. I use "show in explorer" to see the names. This is due to Unity omitting extensions.
    Please Unity devs, revisit project view so it displays full names.
     
  6. choijaeyoung

    choijaeyoung

    Joined:
    Feb 8, 2020
    Posts:
    13
    +1. It's been somewhat problematic when you're organizing similar items by its name at the end (ex. Player Weapon - Machine Gun Lv1, Lv2..., Player Weapon - Gatling Gun, etc) and also need to see the prefab image to easily locate your prefabs. I really wish there's a way to view the entire file name when it's not the list view.
     
  7. HamCha87

    HamCha87

    Joined:
    Jan 4, 2019
    Posts:
    7
    +1 Unity needs to implement a feature for this
     
  8. thomascrozelonpro

    thomascrozelonpro

    Joined:
    Sep 6, 2021
    Posts:
    2
    Well, I see i'm not the only one lol. Can't wait to find a solution too.
     
  9. thomascrozelonpro

    thomascrozelonpro

    Joined:
    Sep 6, 2021
    Posts:
    2
    The only solution that I've found so far is to open 2 project windows, one zoomed out max to see the full name, and the other one zoomed in to see the preview. When you click on one assets, it is highlighted in both windows. Hope it helps someone out there.

    xxxxx.JPG
     
  10. mrdatsun

    mrdatsun

    Joined:
    Apr 8, 2020
    Posts:
    26
    A bit like thomascrozelonpro says above, I found that by adding a new tab. Add Tab->Project from the 3-dot panels options top-right of the panel, I had a second tab-panel that automatically shows the project in filename mode. Then you can even close the old tab, and you have a simple file browser style project panel.
     

    Attached Files:

    Last edited: Mar 3, 2022
    thomascrozelonpro likes this.
  11. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,622
    i know this is an old post, but, again... is there a good solution for this? because i'm facing the same issue now and the only way to make it works is with this redundant workflow with 3 windows showing exactly the same, is a waste of space
     
  12. WeaselOnaStick

    WeaselOnaStick

    Joined:
    Dec 29, 2017
    Posts:
    3
    It's really unfathomable how such a simple-to-fix issue is still open after 7 years with so many LTS versions behind. At least give us an option to change the font size, or amount of lines...
     
    Ruslank100 likes this.
  13. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,622
    @WeaselOnaStick man, is like, unity editor is trolling you, this is the kind of problem you face back in 2005 or something like that, it feels mediocre IMHO... so much "technology" and you can not see the full name of your files on the project tab since 2016 (and before) lol
     
  14. DucaDiMonteSberna

    DucaDiMonteSberna

    Joined:
    Jan 18, 2018
    Posts:
    79
  15. JackAidley

    JackAidley

    Joined:
    Aug 31, 2020
    Posts:
    8
    I find an improvement on @thomascrozelonpro 's approach is to set the "description" project tab to use one-column layout, producing something like this:

    upload_2023-8-30_15-14-39.png

    Which takes up much less space whilst maintaining most of the advantages.
     
    HamCha87 likes this.
  16. SAMYTHEBIGJUICY

    SAMYTHEBIGJUICY

    Joined:
    Jul 12, 2023
    Posts:
    44
    its now 2023 and they still cant implement a list view lmao. Thanks for the giant icons
     
    Ruslank100 likes this.
  17. But Unity has a list view, I think it always had. Just slide the slider all the way to the left.
    Capture.PNG
     
    SAMYTHEBIGJUICY likes this.
  18. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,622
    is not exactly useful when you need to see textures or 3d assets with long names

    This is the way i use it, i open another project window with the two colum layer, but i hide the list view of that and i use the original project view on list mode to see the full name, when i select any file on either window is selected in the other, it was easy to get use to it
    asda.png
     
  19. ok8596

    ok8596

    Joined:
    Feb 21, 2014
    Posts:
    40
    I have written code to force the name display in the Project Window to be overridden. It be disabled on renaming and sub-assets. I think it's pretty flawed, so please let me know if you can improve it.

    I'm sure Unity developers could come up with a far smarter implementation in less than a few minutes if they wanted to...
    Code (CSharp):
    1. using System;
    2. using System.IO;
    3. using System.Reflection;
    4. using UnityEditor;
    5. using UnityEngine;
    6.  
    7. [InitializeOnLoad]
    8. public static class ProjectWindowShowFullAssetName {
    9.     static GUIStyle style;
    10.     static GUIContent assetGUIContent;
    11.     static Color32 backgroundColor;
    12.     static Color32 selectedFrameColor;
    13.     static ProjectWindowShowFullAssetName() {
    14.         EditorApplication.projectWindowItemInstanceOnGUI -= Draw;
    15.         EditorApplication.projectWindowItemInstanceOnGUI += Draw;
    16.         style = new GUIStyle {
    17.             fontSize = 10,
    18.             wordWrap = true,
    19.             alignment = TextAnchor.UpperCenter,
    20.             margin = new RectOffset(0,0,0,0),
    21.         };
    22.         assetGUIContent = new GUIContent();
    23.         if (EditorGUIUtility.isProSkin) {
    24.             backgroundColor = new Color32(51, 51, 51, 255);
    25.             selectedFrameColor = new Color32(44, 93, 135, 255);
    26.         } else {
    27.             backgroundColor = new Color32(190, 190, 190, 255);
    28.             selectedFrameColor = new Color32(58, 114, 176, 255);
    29.         }
    30.     }
    31.  
    32.     static int lastFrameCount;
    33.     static bool isRenaming;
    34.     static void Draw(int instanceID, Rect selectionrect ) {
    35.         if (lastFrameCount != Time.frameCount) {
    36.             isRenaming = IsRenaming();
    37.             lastFrameCount = Time.frameCount;
    38.         }
    39.         if (isRenaming) return;
    40.         if (selectionrect.height <= 20) return;
    41.         if (AssetDatabase.IsSubAsset(instanceID)) return;
    42.  
    43.        
    44.         var path = AssetDatabase.GetAssetPath(instanceID);
    45.         if (string.IsNullOrWhiteSpace(path)) return;
    46.  
    47.         var assetName = Path.GetFileNameWithoutExtension(path);
    48.         var icon = AssetDatabase.GetCachedIcon(path);
    49.  
    50.         var nameRect = new Rect(selectionrect.x, selectionrect.yMax - 12, selectionrect.width, 12);
    51.  
    52.         bool selected = false;
    53.         assetGUIContent.text = assetName;
    54.  
    55.         foreach (var assetguid in Selection.instanceIDs) {
    56.             if (assetguid == instanceID) {
    57.                 selected = true;
    58.                 break;
    59.             }
    60.         }
    61.         if (EditorGUIUtility.isProSkin) {
    62.             style.normal.textColor = Color.white;
    63.         } else {
    64.             style.normal.textColor = selected ? Color.white : Color.black;
    65.         }
    66.         var selectedFrameRect = new Rect(nameRect.x - 6, nameRect.y - 1, nameRect.width + 12, style.CalcHeight(assetGUIContent, nameRect.width) + 3);
    67.  
    68.         EditorGUI.DrawRect(selectedFrameRect, selected ? selectedFrameColor : backgroundColor);
    69.         EditorGUI.DrawRect(new Rect(selectedFrameRect.xMax - 1, selectedFrameRect.y, 1, selectedFrameRect.height), backgroundColor);
    70.         GUI.Label(nameRect, assetName, style);
    71.  
    72.         if (icon) {
    73.             var iconRect = new Rect(nameRect.x, nameRect.y - 15, 14, 14);
    74.             EditorGUI.DrawRect(iconRect, new Color(0, 0, 0, 0.5f));
    75.             GUI.DrawTexture(iconRect, icon);
    76.         }
    77.     }
    78.  
    79.     static private Assembly asm;
    80.     static private EditorWindow projectBrowserWindow;
    81.     static private Type typeProjectBrowser;
    82.     static bool IsRenaming() {
    83.         if (asm == null) asm = Assembly.Load("UnityEditor.dll");
    84.         var flag = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance;
    85.         if(typeProjectBrowser == null) typeProjectBrowser = asm.GetType("UnityEditor.ProjectBrowser");
    86.         if(projectBrowserWindow == null) projectBrowserWindow = EditorWindow.GetWindow(typeProjectBrowser,false,null,false);
    87.         var m_ListAreaState = projectBrowserWindow.GetType().GetField("m_ListAreaState", flag).GetValue(projectBrowserWindow);
    88.         var m_RenameOverlay = m_ListAreaState.GetType().GetField("m_RenameOverlay", flag).GetValue(m_ListAreaState);
    89.         return (bool)m_RenameOverlay.GetType().GetField("m_IsRenaming", flag).GetValue(m_RenameOverlay);
    90.     }
    91. }
    92.  
    sample.png
     
    faxif and DucaDiMonteSberna like this.
  20. DucaDiMonteSberna

    DucaDiMonteSberna

    Joined:
    Jan 18, 2018
    Posts:
    79
  21. ok8596

    ok8596

    Joined:
    Feb 21, 2014
    Posts:
    40
    No, it does not inherit from the Editor class and can be placed anywhere. However, it is safe to place it in the Editor folder since it is not included in the build.
     
    DucaDiMonteSberna likes this.
  22. DucaDiMonteSberna

    DucaDiMonteSberna

    Joined:
    Jan 18, 2018
    Posts:
    79
    It's nice but I cannot see anything while I'm renaming stuff

    EDIT: also what's the purpose of the small icon on the bottom left of every asset? It just repeats the bigger image that represents the asset!
     
  23. ok8596

    ok8596

    Joined:
    Feb 21, 2014
    Posts:
    40
    I am using reflection to detect if renaming is in progress, but apparently it is not perfect. The icon in the lower left is to see that Prefab or Material changes when it is a variant, etc.
     
    DucaDiMonteSberna likes this.