Search Unity

Rainbow Folders - Custom folder icons in the project browser? Easy!

Discussion in 'Assets and Asset Store' started by PhannGor, Jun 18, 2016.

  1. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @dock,

    Unfortunately, Unity Collaborate and Unity Version Control overlays are not supported starting from Unity 2020.1+. There is simply no API to do that correctly. Also, Unity changed the way Editor handles those overlays significantly so using reflection calls isn't an option here as well.

    We will keep monitoring this in case the situation will improve but there are no plans to add support for Plastic SCM or other VCS overlay in near future. Sorry for the inconvenience it may cause you...
     
    dock likes this.
  2. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    @PhannGor No problem, I totally understand. Unity's editor UI is a mess and hopefully will settle down with 2021, when that becomes less unstable.
     
    PhannGor likes this.
  3. spinaljack

    spinaljack

    Joined:
    Mar 18, 2010
    Posts:
    992
    I'm getting this error on unity 2020.3.27f1:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Borodar.RainbowFolders.ProjectWindowAdapter..cctor () (at <fc40e65a88544a9da0ab4a60cedba294>:0)
    3. Rethrow as TypeInitializationException: The type initializer for 'Borodar.RainbowFolders.ProjectWindowAdapter' threw an exception.
    4. Borodar.RainbowFolders.RainbowFoldersGUI..cctor () (at <fc40e65a88544a9da0ab4a60cedba294>:0)
    5. Rethrow as TypeInitializationException: The type initializer for 'Borodar.RainbowFolders.RainbowFoldersGUI' threw an exception.
    6. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <63ccfe108ffa44728b417cb47fb2f841>:0)
    My editor is unusable now
     
    Walter_Hulsebos likes this.
  4. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    You're using an outdated version of the Rainbow Folders. Please get the latest version from Asset Store or through the package manager.
     
  5. PlasticGerm

    PlasticGerm

    Joined:
    Aug 24, 2021
    Posts:
    7
    I came to ask a question, but I see you are in Ukraine. I hope you stay safe! You and your fellow people are in our thoughts and prayers on the other side of the world.
     
    PhannGor likes this.
  6. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    @PlasticGerm, thank you for warm words and overwhelming support from the whole civilized world! We really appreciate that!

    Regarding your question related to our assets, please don't hesitate to ask. I'm not promising a fast answer due to obvious reasons but we're trying to provide support whenever we can.

    Because this allows us to continue to spend our revenue on humanitarian aid for the Ukrainian people. Because we want to say "thank you" to all the people who sincerely support us during this difficult time. Because we want to make this world better, and that's what we could do best. We want to create, not destroy.
     
    ledshok, Ruchir and stevenatunity like this.
  7. PlasticGerm

    PlasticGerm

    Joined:
    Aug 24, 2021
    Posts:
    7
    I saw there was an update, so I thought I would check in. My question was that I have had a number of times now where I import Rainbow Folders and I can no longer see anything other than the Favorites folder listed in the project window. When I go delete Rainbow Folders from the disk, the project window populates the folders just fine. Not sure what's going on?
     
  8. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    @PlasticGerm, probably you're trying to import an outdated version of the Rainbow Folders. This asset heavily relies on UnityEditor API and that API is changing from version to version. To fix that issue with a broken project window, please remove your current installation of the Rainbow Folders from your project, update your Rainbow Folders asset in the Package Manager, and import the latest version into your project again.

    Also, there could be an occasional issue with Unity itself. For some reason, Unity could try to import an outdated version of the asset in some circumstances. If previous steps didn't help then you could try to:
    1. Find the Asset Store cache folder on your machine.
      For Windows it should be something like:
      User\AppData\Roaming\Unity\Asset Store-5.х\Borodar\Editor Extensions\System
      For Mac OS:
      User\Library\Unity\Asset Store-5.х\Borodar\Editor Extensions\System
    2. Then delete all the packages in that folder
    3. Open Unity Editor
    4. Delete Plugins\RainbowAssets
    5. Reimport the Rainbow Folders from the Asset Store again. At this point, Unity should download the correct version of the asset.
     
  9. PlasticGerm

    PlasticGerm

    Joined:
    Aug 24, 2021
    Posts:
    7
    I'm using 2.3.1, which is showing as downloaded on 3/4/22. Using Unity 2020.3.24f1. When Rainbow Folders is installed, I have to go into explorer and delete the RainbowAssets folder since I can't do it in Unity - I literally can't see the folders. I redownloaded the package and deleted the assets folder and then reimported and that did work. However, this is not the first time I have seen this happen, and before I basically did the same thing - delete the RainbowAssets folder, and it started working on reimport. I'm almost wondering if perhaps it is in conflict with another asset. Just as an FYI when I saw it happen this time, these are the other assets I'm using on the latest project.

    Doubling Technologies Project Asset Manager
    Grabbit
    Both your Rainbow Folder and Hierarchy
    Task Atlas
    Editor Portals
    Perfect F
    SuperPosition
    SmartBuilder
    Turbo Switch Pro
    Turbo Builder Pro
    Turbo Backup Pro
    Debugging Essentials
    Asset Hunter Pro
    MonKey
    Prefab World Builder
     
  10. jimmying

    jimmying

    Joined:
    Sep 20, 2017
    Posts:
    107
    Hi is it possible to do partial, wildcard, or regex matches for folder names? For example, if I created a definition for "*Fonts", it would apply the style for folders that are named "Fonts", "My Fonts", "More Fonts", etc.
     
  11. GeorgeHuan

    GeorgeHuan

    Joined:
    Nov 9, 2021
    Posts:
    1
    Unity 2020.3.25f1

    After import, project window be empty, and 999+ error

    Code (csharp):
    1.  
    2. NullReferenceException: Object reference not set to an instance of an object
    3. Borodar.RainbowFolders.ProjectWindowAdapter..cctor () (at <46feef4a472040c88393ea0d371667e0>:0)
    4. Rethrow as TypeInitializationException: The type initializer for 'Borodar.RainbowFolders.ProjectWindowAdapter' threw an exception.
    5. Borodar.RainbowFolders.RainbowFoldersGUI..cctor () (at <46feef4a472040c88393ea0d371667e0>:0)
    6. Rethrow as TypeInitializationException: The type initializer for 'Borodar.RainbowFolders.RainbowFoldersGUI' threw an exception.
    7. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <7ac35247888b44f4a7e290f1f6bb33f3>:0)
    8.  
     
    Walter_Hulsebos likes this.
  12. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    @GeorgeHuan
    Seems like you're trying to import an older version of the Rainbow Folders. Please open the Package Manager, "re-download" the asset, and then re-import it into your project. Hope this helps!

    upload_2022-4-12_20-18-1.png
     
  13. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @jimmying,

    Regarding regex rules, unfortunately, this is not supported yet. We have this feature planned for some of the next releases but it has performance limitations to be solved first.
     
    jimmying likes this.
  14. Blepius

    Blepius

    Joined:
    Mar 9, 2021
    Posts:
    68
    Edit: PlasticSCM no longer conflicts with Rainbow Folders! Seems to work a lot better now as well!
     
    Last edited: Jun 10, 2022
    Genebris likes this.
  15. Tayx

    Tayx

    Joined:
    Feb 4, 2015
    Posts:
    73
    Hello! Big fan, been using this asset for years. One thing I just noticed is that in Unity 2021.3.0 I'm not seeing the context menu option by right clicking a folder to change it's color and background.

    Is it a known bug? I've imported a clean version of 2.3.1. If I add the folder path directly in the Ruleset object it does work, but it's not an ideal workflow.

    Thanks in advance and keep up the good work!

    upload_2022-4-25_18-38-2.png
     
  16. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @Tayx,

    To apply a custom icon and/or background for some folder in your project view, just hold the "modifier" key and click on any folder icon in the Unity project browser. By default, it’s the Alt key, but you can change it in Project Settings → Borodar → Rainbow Folders.

     
    Tayx likes this.
  17. Tayx

    Tayx

    Joined:
    Feb 4, 2015
    Posts:
    73
    That's awesome thanks! Works great :)
     
  18. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Could you please describe which "same" situation you have? :)
     
  19. Honoki_

    Honoki_

    Joined:
    Sep 15, 2014
    Posts:
    9
    Hi! First of all, great asset! This asset has became a required asset on all of my projects and working on something without this feels a bit weird for me.
    So for my issue, I have tried to make a new project with the new LTS unity 2021 (2021.3.2f1). I tried to add this asset as always but it gave me some errors and prevent the project tab from loading.
    I'll provide a screenshot of the errors below
    upload_2022-5-16_22-5-37.png

    Hopefully you can help me.
     
  20. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    @Honoki_

    Seems like you're trying to import an older version of the Rainbow Folders. Please open the Package Manager, "re-download" the asset, and then re-import it into your project. Hope this helps!

     
    Honoki_ likes this.
  21. Honoki_

    Honoki_

    Joined:
    Sep 15, 2014
    Posts:
    9
    oooooh! It worked! Thank you!
    Package manager didn't tell that there's any update so I thought I am using the latest version. But it worked again now. Thank you!
     
  22. EgSanDi

    EgSanDi

    Joined:
    Jun 2, 2015
    Posts:
    3
    Is there a way to save the settings of Rainbow Packages on Git? upload_2022-6-8_22-57-25.png
     
  23. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    144
    What does it mean that it's not supported? How does it look like when I have version control? Should I not buy it if I use Plastic?
    Can somebody post a screenshot please?
     
  24. Blepius

    Blepius

    Joined:
    Mar 9, 2021
    Posts:
    68
    The latest version of Plastic SCM has removed the icons that conflict with Rainbow Folders.
     
  25. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    144
    So does it mean it works? Should I buy?
     
  26. Blepius

    Blepius

    Joined:
    Mar 9, 2021
    Posts:
    68
    Yep, Rainbow Folders now works with PlasticSCM, for me at least. That's up to you, of course, but I'll say that this is one of my favorite Editor assets!
     
    Genebris likes this.
  27. Vincent454

    Vincent454

    Joined:
    Oct 26, 2014
    Posts:
    167
    Can I override the default folder icon somehow? I've been trying to use just a blank name in the ruleset but that doesn't work
     
  28. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    No, there is no possibility to override the default folder. As a workaround, you can select all the root folders and apply the recursive rule to all of them.
     
    Vincent454 likes this.
  29. Vincent454

    Vincent454

    Joined:
    Oct 26, 2014
    Posts:
    167
    Thank you!
     
  30. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    [RF] There is no ruleset at path: Assets/Plugins/RainbowAssets/RainbowFolders/Editor/Data/RainbowFoldersRuleset.asset


    This warning is strange, as Rainbow Folders doesn't use this folder. Any tips to avoid it?
     
  31. MoFaShi

    MoFaShi

    Joined:
    Oct 25, 2015
    Posts:
    43
    Can't work with Unity 2021.3.8f1c1 ?
     
  32. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Yes, reading docs usually helps :)

    Just go to Edit → Project Settings → Borodar → Rainbow Folders and update the folder location to your one:
    upload_2022-9-1_10-52-43.png

    Also, in the latest versions, this should be done automatically.
     
  33. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Should work fine. Please make sure you're using the latest version of the Rainbow Folders from the Asset Store.
     
  34. Figarist

    Figarist

    Joined:
    Jul 14, 2017
    Posts:
    8
    Unity 2022.1.15f1: upload_2022-9-3_15-44-44.png
     

    Attached Files:

  35. makaolachsiungca

    makaolachsiungca

    Joined:
    Sep 27, 2019
    Posts:
    31
    Hi,
    Could we using API from rainbow folder to get asset icon?
    I would like to use custom icon setting to draw editor toolkit(pushpin) in my project.
    upload_2022-9-6_22-22-25.png
     
  36. AdamLiu

    AdamLiu

    Joined:
    Mar 19, 2014
    Posts:
    71
    I encountered the same error after upgrading my Unity from 2020.3.37 to 2020.3.38
     
  37. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    @AdamLiu, @Figarist,

    Just checked Unity 2022.1.15f1 and all works fine for me.

    Usually, you need to update your assets after upgrading the Unity version. The same story for the Rainbow Folders as well. Please open the Package Manager, "update" or "re-download" the asset, and then re-import it into your project. This should help.

     
    schmosef likes this.
  38. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    @makaolachsiungca,

    Sure, you can. I do not fully understand your request but seems that you could use the Borodar.RainbowFolders.ProjectRuleset class for your needs. Something like:

    Code (CSharp):
    1.  
    2. /// <summary>
    3. /// Searches for a rule that has the same type and key values.
    4. /// Returns the first occurrence within the settings if found; null otherwise.
    5. /// </summary>
    6. ProjectRuleset.Instance.GetRule(ProjectRule match)
    7.  
    8. /// <summary>
    9. /// Searches for a folder config that should be applied for the specified path (regardless of
    10. /// the key type). Returns the last occurrence within the settings, if found; null otherwise.
    11. /// </summary>
    12. ProjectRuleset.Instance.GetRuleByPath(string folderPath, bool allowRecursive = false)
    13.  
    Please don't hesitate to take a look at the source code. It's shipped together with package ;)
     
    makaolachsiungca likes this.
  39. makaolachsiungca

    makaolachsiungca

    Joined:
    Sep 27, 2019
    Posts:
    31
    Hi,
    I still couldn't get current icon texture from Icon storage and background storage,
    What am I probably missing?

    upload_2022-9-10_8-37-5.png


    Code (CSharp):
    1.    
    2.  internal static GUIContent NewGUIContentAnnotatePathIfFolder(Object obj)
    3.     {
    4.         string path = AssetDatabase.GetAssetPath(obj);
    5.        
    6.         var content = new GUIContent(EditorGUIUtility.ObjectContent(obj, null));
    7.  
    8.         if (AssetDatabase.IsValidFolder(path))
    9.         {
    10.  
    11.             var rule=ProjectRuleset.Instance.GetRuleByPath(path, true);
    12.  
    13.             if (rule != null)
    14.             {
    15.                 if (rule.HasIcon())
    16.                 {
    17.                     if (rule.HasLargeIcon())
    18.                         content.image = rule.LargeIcon;
    19.                     else if (rule.HasSmallIcon())
    20.                         content.image = rule.SmallIcon;
    21.                     else if (rule.HasCustomIcon())
    22.                         content.image = rule.LargeIcon;
    23.                     else
    24.                         Debug.LogError("None match icon.");
    25.                 }
    26.                 else
    27.                 {
    28.                     Debug.LogError("None exist icon.");
    29.  
    30.                     content.image = ProjectIconsStorage.GetIcons(rule.IconType).Item2;
    31.                 }
    32.  
    33.             }
    34.         }
    35.  
    36.  
    37.         content.text += " <size=8><color=grey>" + path + "</color></size>";
    38.         return content;
    39.     }
    40.  
    41.  internal static GUIStyle NewGUIStyleAnnotatePathIfFolder(Object obj)
    42.     {
    43.         string path = AssetDatabase.GetAssetPath(obj);
    44.  
    45.         var style= new GUIStyle(PushPinStytle.StyleItem);
    46.  
    47.         if (AssetDatabase.IsValidFolder(path))
    48.         {
    49.             var rule = ProjectRuleset.Instance.GetRuleByPath(path, true);
    50.  
    51.             if (rule != null)
    52.             {
    53.                 if (rule.HasBackground())
    54.                     style.normal.background = rule.BackgroundTexture;
    55.                 else
    56.                 {
    57.                     Debug.LogError("None background found.");
    58.                     var bg = ProjectBackgroundsStorage.GetBackground(rule.BackgroundType);
    59.  
    60.                     if (bg != null)
    61.                         style.normal.background = bg;
    62.                 }
    63.             }
    64.             else
    65.                 Debug.LogError("None rule match.");
    66.         }
    67.  
    68.         return style;
    69.     }
    70.  
     
  40. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
  41. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    340
    Hi, insanely useful asset, thanks!

    I was wondering if you could add a check for source control. For example, we're using perforce, and when I change some folder's colors, it doesn't "check out" the ruleset file, so the colors won't be updated in our source control unless I manually check out the ruleset file.

    This can usually be done doing this:
    UnityEditor.VersionControl.Provider.Checkout("AssetPath/Asset.asset", CheckoutMode.Both);

    Thanks in advance
     
  42. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @marcrem,

    There is the
    Code (CSharp):
    1. ProjectRuleset.OnRulesetChange
    action you could use for your needs. Just subscribe to it from your editor script and call
    Code (CSharp):
    1. UnityEditor.VersionControl.Provider.Checkout("AssetPath/Asset.asset", CheckoutMode.Both);
    or implement any other logic you want to execute after the ruleset is changed.
     
    marcrem likes this.
  43. Gigacee

    Gigacee

    Joined:
    Mar 4, 2015
    Posts:
    53
    Last edited: Feb 18, 2023
    PhannGor and Vincent454 like this.
  44. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    I think Rainbow Folder might be broken in the Unity 2022.3.1f1. It looks like if there is an error the project window will fail to render folder and files properly. Will update if I can pinpoint the issue a little more thoroughly.
     
  45. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @Meatloaf4,

    Just double-checked it and seems to be working fine with the Unity 2022.3.2f:

    upload_2023-6-20_18-19-14.png

    Please make sure you're using the latest version of the Rainbow Folders 2 asset from the asset store (which is v2.4.0 at the moment).
     

    Attached Files:

  46. makaolachsiungca

    makaolachsiungca

    Joined:
    Sep 27, 2019
    Posts:
    31
    Here we go,
    The colorful icon must been evaluate manually via ProjectIconsStorage.GetIcons().
    Now I have a custom pretty asset window!

    Code (CSharp):
    1. public static Texture2D TryGetIcon(DefaultAsset folder)
    2.         {
    3.             var rule = Borodar.RainbowFolders.ProjectRuleset.Instance.GetRuleByPath(folder.GetAssetPath(),true);
    4.  
    5.             Texture2D icon = null;
    6.  
    7.             if (rule != null)
    8.             {
    9.                 if (rule.HasIcon())
    10.                 {
    11.                     if (rule.HasLargeIcon())
    12.                         icon = rule.LargeIcon;
    13.                     else if (rule.HasSmallIcon())
    14.                         icon = rule.SmallIcon;
    15.                     else if (rule.HasCustomIcon())
    16.                         icon = rule.LargeIcon;
    17.                 }
    18.                 else
    19.                 {
    20.                     Debug.LogError("None exist icon.");
    21.                     icon = Borodar.RainbowFolders.ProjectIconsStorage.GetIcons(rule.IconType).Item2;
    22.                 }
    23.  
    24.                 // load icon from color
    25.                 if (icon == null)
    26.                     return Borodar.RainbowFolders.ProjectIconsStorage.GetIcons(rule.IconType).Item1;
    27.             }
    28.  
    29.             return EditorIcons.UnityFolderIcon;
    30.         }

    upload_2023-6-24_18-49-9.png
     
    PhannGor likes this.
  47. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    It is broken in Unity 2023.1.
     
  48. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Yes, just confirmed that. It seems like they changed the "Texture" API slightly. Working on a compatibility fix now.
     
    schmosef likes this.
  49. neumond

    neumond

    Joined:
    May 23, 2021
    Posts:
    1
    Hello!
    I get an error when I install Rainbow Folder, what should I do?
     

    Attached Files:

  50. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hello @neumond,

    Seems like you've installed a newer version of the RF2. It is just a warning that it didn't recognize the old ruleset using the old path from preferences. The next message means that it found a new one without any issues so you could continue to use the RF2 plugin.