3
$\begingroup$

I have to open up a lot of blend files in a row which are living in the same folder along with a lot of folders. When I open up the file browser I get a long list of folders first and have to scroll down a lot until I get to my blend files.

My current workaround is typing „.blend“ in search field:

Enter image description here

Is there a way to display only the blend files within the current folder to save some time?

$\endgroup$
1
  • $\begingroup$ Comments are not for extended discussion; this conversation has been moved to chat. $\endgroup$
    – Robert Gützkow
    Jun 12 '21 at 9:26
1
$\begingroup$

There are dedicated properties in the Filter Settings for convenience to enable and disable all relevant types in the File Browser which will already speed things up (as mentioned):

enter image description here

Unfortunately, there is no way to save the Filter Settings along with your preferences at the moment, means that your settings are gone when starting a new Blender session.


In the past few years there have been a lot of requests allowing the user to store the file browser settings and there is even a well recieved Q&A from 6 years ago but it seems this feature is not that relevant for a wide range of users or there is no developer interested in implementing that functionality. The idea of the add-on provided by @Chebhou and @p2or from the Q&A mentioned, is basically to add (permanent) properties via AddonPreferences and use that properties to override each setting in the draw method.

The following add-on is a minimal version of the provided add-on to only address the Folder Setting. When installed and enabled properly, a new toggle is added to the header of the File Browser and stores your custom setting as long as the add-on is enabled:

enter image description here

display_folder_override.py

bl_info = {
    "name" : "File Browser - Display Folder Override",
    "version" : (0, 1),
    "blender" : (2, 80, 0),
    "location" : "File Browser",
    "category" : "User Interface" }

import bpy
from bpy.props import BoolProperty
from bpy.types import AddonPreferences

class FBO_AP_Preferences(AddonPreferences):
    bl_idname = __name__
    folder_override: BoolProperty(name="Show Folders (Override)", default=True)

def draw_filebrowser(self, context):
    prefs = context.preferences.addons[__name__].preferences
    browser = context.space_data
    row = self.layout.row(align=True)
    row.prop(prefs, "folder_override")
    if browser.params.use_filter_folder is not prefs.folder_override:
        browser.params.use_filter_folder = prefs.folder_override

def register():
    bpy.utils.register_class(FBO_AP_Preferences)
    bpy.types.FILEBROWSER_PT_directory_path.append(draw_filebrowser)

def unregister():
    bpy.utils.unregister_class(FBO_AP_Preferences)
    bpy.types.FILEBROWSER_PT_directory_path.remove(draw_filebrowser)

if __name__ == "__main__":
    register()

Related: How to make the file manager default to sorting by modification date?

$\endgroup$
1
  • 1
    $\begingroup$ Thanks! And works on 2.92 + 3.0.0alpha!! Hero status approved👍 $\endgroup$
    – Chris
    Jun 12 '21 at 11:03
4
$\begingroup$

You can display only .blend file by enabling Filter (icon in header), but your setup of Filter is not remembered when dialog window is open again (even when Saved as Startup File ... to be precise - it can be saved into Startup file while dialog window is opened whe saving as Startup File, but it bring this window open anytime you open Blender (that is not wanted) and even more this window is missing Cancel / Open buttons ... so totaly useless.


As workaround you can ...

Add a Workspace, name it "Open" (or what ever) and switch View3D editor to File browser editor.

enter image description here

Set Filters as wanted.

enter image description here

Switch back to default Layout workspace and go to File > Defaults > Save Startup File

enter image description here

For opening file click on Open workspace, drag&drop file to anywhere out of File Browser editor and choose Open command.


Edit

What looks like a bug here is the ignorance of saving the workspace changes made by user. I had to save file as regular .blend and switch this file with existing one called startup.blend.

Directory of this file depends on OS, for Mac it is
/Users/xy/Library/Application Support/Blender/2.9x/config/

Than it works like that ... enter image description here


Right ... that is too much scratching :) Would be part of defaults.

$\endgroup$
0
0
$\begingroup$

Alternate solutions:

  • Copy/paste the strings of the files' you are hoping to find
  • Save the init file-browser search terms in a default, startup blend file (changes after init use do not always apply unfortunately)
  • You could state a default assets` path depending on what kind of file it is, e.g textures in the Preferences > File Paths
  • You could create a File Browser > Favorites (bookmark) for a certain folder that contains the assets` you are searching for easier access
$\endgroup$
1
  • 1
    $\begingroup$ Folders aren‘t my problem. Sorry for not being precise in my question. I updated my question. $\endgroup$
    – Chris
    Jun 11 '21 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.