2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-06-29 20:23:40 +00:00
|
|
|
import bpy
|
2015-02-10 23:09:45 +00:00
|
|
|
from bpy.types import Header, Panel, Menu
|
2009-06-29 20:23:40 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class FILEBROWSER_HT_header(Header):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'FILE_BROWSER'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
st = context.space_data
|
|
|
|
|
2014-01-27 07:38:53 +00:00
|
|
|
layout.template_header()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
row.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
row.operator("file.previous", text="", icon='BACK')
|
|
|
|
row.operator("file.next", text="", icon='FORWARD')
|
|
|
|
row.operator("file.parent", text="", icon='FILE_PARENT')
|
|
|
|
row.operator("file.refresh", text="", icon='FILE_REFRESH')
|
2009-10-31 19:31:45 +00:00
|
|
|
|
Final 'FileBrowser First Stage' merge.
It basically rewrites most of filelist.c, with some more limited changes in other areas of filebrowser.
From user perspective, it:
* Removes some info in 'long' drawing mode (owner, permissions) - OS-specific data that do not really matter in Blender!
* Makes short/long display 'fixed' size (among four choices, like thumbnails mode).
* Allows to list several layers of dirtree at once, in a flat way (inside .blend files and/or real directories).
* Consequently, adds datablocks types filtering.
* Uses way less RAM when listing big directories, especially in thumbnail mode (we are talking of several hundred of MiB spared).
* Generates thumbnails way faster.
From code perspective, it:
* Is ready for asset engine needs (on data structure level in filebrowser's listing).
* Simplifies and makes 'generic' file listing much lighter.
* Separates file listing in three different aspects:
** 'generic' filelisting (in BLI), which becomes a shallow wrapper around stat struct.
** 'filebrowser drawing' filelisting, which only contains current visible subset of the whole list (sliding window), with extra drawing data (strings for size, date/time, preview, etc.).
** 'asset-ready' filelisting, which is used for operations common to 'basic' filehandling and future asset-related one.
* Uses uuid's to handle file selection/state in the browser, instead of using flags in filelisting items.
* Uses much lighter BLI_task handling for previews, instead of heavy 'job' system (using the new 'notifier' timer to handle UI refresh, in similar way to jobs).
* Moves .blend datablocks preview handling to IMB_thumbnail (necessary to avoid storing all datablock previews at once, and gives better consistency and performances too).
Revision: https://developer.blender.org/D1316
Thanks to Campbell & Sergey for the reviews. :)
2015-08-19 20:41:39 +00:00
|
|
|
layout.separator()
|
2015-03-29 23:44:57 +00:00
|
|
|
layout.operator_context = 'EXEC_DEFAULT'
|
Final 'FileBrowser First Stage' merge.
It basically rewrites most of filelist.c, with some more limited changes in other areas of filebrowser.
From user perspective, it:
* Removes some info in 'long' drawing mode (owner, permissions) - OS-specific data that do not really matter in Blender!
* Makes short/long display 'fixed' size (among four choices, like thumbnails mode).
* Allows to list several layers of dirtree at once, in a flat way (inside .blend files and/or real directories).
* Consequently, adds datablocks types filtering.
* Uses way less RAM when listing big directories, especially in thumbnail mode (we are talking of several hundred of MiB spared).
* Generates thumbnails way faster.
From code perspective, it:
* Is ready for asset engine needs (on data structure level in filebrowser's listing).
* Simplifies and makes 'generic' file listing much lighter.
* Separates file listing in three different aspects:
** 'generic' filelisting (in BLI), which becomes a shallow wrapper around stat struct.
** 'filebrowser drawing' filelisting, which only contains current visible subset of the whole list (sliding window), with extra drawing data (strings for size, date/time, preview, etc.).
** 'asset-ready' filelisting, which is used for operations common to 'basic' filehandling and future asset-related one.
* Uses uuid's to handle file selection/state in the browser, instead of using flags in filelisting items.
* Uses much lighter BLI_task handling for previews, instead of heavy 'job' system (using the new 'notifier' timer to handle UI refresh, in similar way to jobs).
* Moves .blend datablocks preview handling to IMB_thumbnail (necessary to avoid storing all datablock previews at once, and gives better consistency and performances too).
Revision: https://developer.blender.org/D1316
Thanks to Campbell & Sergey for the reviews. :)
2015-08-19 20:41:39 +00:00
|
|
|
layout.operator("file.directory_new", icon='NEWFOLDER', text="")
|
|
|
|
layout.separator()
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2015-03-29 23:44:57 +00:00
|
|
|
layout.operator_context = 'INVOKE_DEFAULT'
|
2010-09-01 02:25:49 +00:00
|
|
|
params = st.params
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-09-01 02:25:49 +00:00
|
|
|
# can be None when save/reload with a file selector open
|
2010-09-07 15:17:42 +00:00
|
|
|
if params:
|
Final 'FileBrowser First Stage' merge.
It basically rewrites most of filelist.c, with some more limited changes in other areas of filebrowser.
From user perspective, it:
* Removes some info in 'long' drawing mode (owner, permissions) - OS-specific data that do not really matter in Blender!
* Makes short/long display 'fixed' size (among four choices, like thumbnails mode).
* Allows to list several layers of dirtree at once, in a flat way (inside .blend files and/or real directories).
* Consequently, adds datablocks types filtering.
* Uses way less RAM when listing big directories, especially in thumbnail mode (we are talking of several hundred of MiB spared).
* Generates thumbnails way faster.
From code perspective, it:
* Is ready for asset engine needs (on data structure level in filebrowser's listing).
* Simplifies and makes 'generic' file listing much lighter.
* Separates file listing in three different aspects:
** 'generic' filelisting (in BLI), which becomes a shallow wrapper around stat struct.
** 'filebrowser drawing' filelisting, which only contains current visible subset of the whole list (sliding window), with extra drawing data (strings for size, date/time, preview, etc.).
** 'asset-ready' filelisting, which is used for operations common to 'basic' filehandling and future asset-related one.
* Uses uuid's to handle file selection/state in the browser, instead of using flags in filelisting items.
* Uses much lighter BLI_task handling for previews, instead of heavy 'job' system (using the new 'notifier' timer to handle UI refresh, in similar way to jobs).
* Moves .blend datablocks preview handling to IMB_thumbnail (necessary to avoid storing all datablock previews at once, and gives better consistency and performances too).
Revision: https://developer.blender.org/D1316
Thanks to Campbell & Sergey for the reviews. :)
2015-08-19 20:41:39 +00:00
|
|
|
is_lib_browser = params.use_library_browsing
|
|
|
|
|
|
|
|
layout.prop(params, "recursion_level", text="")
|
|
|
|
|
2010-09-01 02:25:49 +00:00
|
|
|
layout.prop(params, "display_type", expand=True, text="")
|
2015-04-29 19:25:34 +00:00
|
|
|
|
2015-10-16 09:21:12 +00:00
|
|
|
layout.prop(params, "display_size", text="")
|
2015-04-29 19:25:34 +00:00
|
|
|
|
2010-09-01 02:25:49 +00:00
|
|
|
layout.prop(params, "sort_method", expand=True, text="")
|
|
|
|
|
2015-01-13 15:36:49 +00:00
|
|
|
layout.prop(params, "show_hidden", text="", icon='FILE_HIDDEN')
|
2010-09-01 02:25:49 +00:00
|
|
|
layout.prop(params, "use_filter", text="", icon='FILTER')
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.active = params.use_filter
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2010-09-01 02:25:49 +00:00
|
|
|
row.prop(params, "use_filter_folder", text="")
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2010-09-24 07:05:43 +00:00
|
|
|
if params.filter_glob:
|
2015-08-31 17:51:50 +00:00
|
|
|
# if st.active_operator and hasattr(st.active_operator, "filter_glob"):
|
|
|
|
# row.prop(params, "filter_glob", text="")
|
2010-09-24 07:05:43 +00:00
|
|
|
row.label(params.filter_glob)
|
|
|
|
else:
|
|
|
|
row.prop(params, "use_filter_blender", text="")
|
2012-10-27 18:31:52 +00:00
|
|
|
row.prop(params, "use_filter_backup", text="")
|
2010-09-24 07:05:43 +00:00
|
|
|
row.prop(params, "use_filter_image", text="")
|
|
|
|
row.prop(params, "use_filter_movie", text="")
|
|
|
|
row.prop(params, "use_filter_script", text="")
|
|
|
|
row.prop(params, "use_filter_font", text="")
|
|
|
|
row.prop(params, "use_filter_sound", text="")
|
|
|
|
row.prop(params, "use_filter_text", text="")
|
2011-04-04 10:13:04 +00:00
|
|
|
|
Final 'FileBrowser First Stage' merge.
It basically rewrites most of filelist.c, with some more limited changes in other areas of filebrowser.
From user perspective, it:
* Removes some info in 'long' drawing mode (owner, permissions) - OS-specific data that do not really matter in Blender!
* Makes short/long display 'fixed' size (among four choices, like thumbnails mode).
* Allows to list several layers of dirtree at once, in a flat way (inside .blend files and/or real directories).
* Consequently, adds datablocks types filtering.
* Uses way less RAM when listing big directories, especially in thumbnail mode (we are talking of several hundred of MiB spared).
* Generates thumbnails way faster.
From code perspective, it:
* Is ready for asset engine needs (on data structure level in filebrowser's listing).
* Simplifies and makes 'generic' file listing much lighter.
* Separates file listing in three different aspects:
** 'generic' filelisting (in BLI), which becomes a shallow wrapper around stat struct.
** 'filebrowser drawing' filelisting, which only contains current visible subset of the whole list (sliding window), with extra drawing data (strings for size, date/time, preview, etc.).
** 'asset-ready' filelisting, which is used for operations common to 'basic' filehandling and future asset-related one.
* Uses uuid's to handle file selection/state in the browser, instead of using flags in filelisting items.
* Uses much lighter BLI_task handling for previews, instead of heavy 'job' system (using the new 'notifier' timer to handle UI refresh, in similar way to jobs).
* Moves .blend datablocks preview handling to IMB_thumbnail (necessary to avoid storing all datablock previews at once, and gives better consistency and performances too).
Revision: https://developer.blender.org/D1316
Thanks to Campbell & Sergey for the reviews. :)
2015-08-19 20:41:39 +00:00
|
|
|
if is_lib_browser:
|
|
|
|
row.prop(params, "use_filter_blendid", text="")
|
|
|
|
if params.use_filter_blendid:
|
|
|
|
row.separator()
|
|
|
|
row.prop(params, "filter_id_category", text="")
|
|
|
|
|
2015-01-03 20:55:16 +00:00
|
|
|
row.separator()
|
2015-01-13 15:43:55 +00:00
|
|
|
row.prop(params, "filter_search", text="", icon='VIEWZOOM')
|
2015-01-03 20:55:16 +00:00
|
|
|
|
Final 'FileBrowser First Stage' merge.
It basically rewrites most of filelist.c, with some more limited changes in other areas of filebrowser.
From user perspective, it:
* Removes some info in 'long' drawing mode (owner, permissions) - OS-specific data that do not really matter in Blender!
* Makes short/long display 'fixed' size (among four choices, like thumbnails mode).
* Allows to list several layers of dirtree at once, in a flat way (inside .blend files and/or real directories).
* Consequently, adds datablocks types filtering.
* Uses way less RAM when listing big directories, especially in thumbnail mode (we are talking of several hundred of MiB spared).
* Generates thumbnails way faster.
From code perspective, it:
* Is ready for asset engine needs (on data structure level in filebrowser's listing).
* Simplifies and makes 'generic' file listing much lighter.
* Separates file listing in three different aspects:
** 'generic' filelisting (in BLI), which becomes a shallow wrapper around stat struct.
** 'filebrowser drawing' filelisting, which only contains current visible subset of the whole list (sliding window), with extra drawing data (strings for size, date/time, preview, etc.).
** 'asset-ready' filelisting, which is used for operations common to 'basic' filehandling and future asset-related one.
* Uses uuid's to handle file selection/state in the browser, instead of using flags in filelisting items.
* Uses much lighter BLI_task handling for previews, instead of heavy 'job' system (using the new 'notifier' timer to handle UI refresh, in similar way to jobs).
* Moves .blend datablocks preview handling to IMB_thumbnail (necessary to avoid storing all datablock previews at once, and gives better consistency and performances too).
Revision: https://developer.blender.org/D1316
Thanks to Campbell & Sergey for the reviews. :)
2015-08-19 20:41:39 +00:00
|
|
|
layout.template_running_jobs()
|
|
|
|
|
2015-01-03 20:55:16 +00:00
|
|
|
|
2015-02-10 23:09:45 +00:00
|
|
|
class FILEBROWSER_UL_dir(bpy.types.UIList):
|
|
|
|
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
|
|
|
direntry = item
|
2015-04-22 06:26:00 +00:00
|
|
|
# space = context.space_data
|
2015-02-10 23:09:45 +00:00
|
|
|
icon = 'NONE'
|
|
|
|
if active_propname == "system_folders_active":
|
|
|
|
icon = 'DISK_DRIVE'
|
|
|
|
if active_propname == "system_bookmarks_active":
|
|
|
|
icon = 'BOOKMARKS'
|
|
|
|
if active_propname == "bookmarks_active":
|
|
|
|
icon = 'BOOKMARKS'
|
|
|
|
if active_propname == "recent_folders_active":
|
|
|
|
icon = 'FILE_FOLDER'
|
|
|
|
|
|
|
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
|
|
|
row = layout.row(align=True)
|
2015-02-11 16:07:52 +00:00
|
|
|
row.enabled = direntry.is_valid
|
|
|
|
# Non-editable entries would show grayed-out, which is bad in this specific case, so switch to mere label.
|
2015-04-22 06:26:00 +00:00
|
|
|
if direntry.is_property_readonly("name"):
|
2015-02-11 16:07:52 +00:00
|
|
|
row.label(text=direntry.name, icon=icon)
|
|
|
|
else:
|
|
|
|
row.prop(direntry, "name", text="", emboss=False, icon=icon)
|
2015-02-10 23:09:45 +00:00
|
|
|
|
2015-04-14 00:29:11 +00:00
|
|
|
elif self.layout_type == 'GRID':
|
2015-02-10 23:09:45 +00:00
|
|
|
layout.alignment = 'CENTER'
|
|
|
|
layout.prop(direntry, "path", text="")
|
|
|
|
|
|
|
|
|
|
|
|
class FILEBROWSER_PT_system_folders(Panel):
|
|
|
|
bl_space_type = 'FILE_BROWSER'
|
|
|
|
bl_region_type = 'TOOLS'
|
|
|
|
bl_category = "Bookmarks"
|
|
|
|
bl_label = "System"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
space = context.space_data
|
|
|
|
|
|
|
|
if space.system_folders:
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list("FILEBROWSER_UL_dir", "system_folders", space, "system_folders",
|
2015-02-17 18:25:52 +00:00
|
|
|
space, "system_folders_active", item_dyntip_propname="path", rows=1, maxrows=10)
|
2015-02-10 23:09:45 +00:00
|
|
|
|
2015-05-17 07:17:31 +00:00
|
|
|
|
2015-02-10 23:09:45 +00:00
|
|
|
class FILEBROWSER_PT_system_bookmarks(Panel):
|
|
|
|
bl_space_type = 'FILE_BROWSER'
|
|
|
|
bl_region_type = 'TOOLS'
|
|
|
|
bl_category = "Bookmarks"
|
|
|
|
bl_label = "System Bookmarks"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return not context.user_preferences.filepaths.hide_system_bookmarks
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
space = context.space_data
|
|
|
|
|
|
|
|
if space.system_bookmarks:
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list("FILEBROWSER_UL_dir", "system_bookmarks", space, "system_bookmarks",
|
2015-02-17 18:25:52 +00:00
|
|
|
space, "system_bookmarks_active", item_dyntip_propname="path", rows=1, maxrows=10)
|
2015-02-10 23:09:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
class FILEBROWSER_MT_bookmarks_specials(Menu):
|
|
|
|
bl_label = "Bookmarks Specials"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2015-02-11 16:07:52 +00:00
|
|
|
layout.operator("file.bookmark_cleanup", icon='X', text="Cleanup")
|
2015-02-10 23:09:45 +00:00
|
|
|
|
2015-02-11 16:07:52 +00:00
|
|
|
layout.separator()
|
2015-02-10 23:09:45 +00:00
|
|
|
layout.operator("file.bookmark_move", icon='TRIA_UP_BAR', text="Move To Top").direction = 'TOP'
|
|
|
|
layout.operator("file.bookmark_move", icon='TRIA_DOWN_BAR', text="Move To Bottom").direction = 'BOTTOM'
|
|
|
|
|
|
|
|
|
|
|
|
class FILEBROWSER_PT_bookmarks(Panel):
|
|
|
|
bl_space_type = 'FILE_BROWSER'
|
|
|
|
bl_region_type = 'TOOLS'
|
|
|
|
bl_category = "Bookmarks"
|
|
|
|
bl_label = "Bookmarks"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
space = context.space_data
|
|
|
|
|
|
|
|
if space.bookmarks:
|
|
|
|
row = layout.row()
|
|
|
|
num_rows = len(space.bookmarks)
|
|
|
|
row.template_list("FILEBROWSER_UL_dir", "bookmarks", space, "bookmarks",
|
|
|
|
space, "bookmarks_active", item_dyntip_propname="path",
|
2015-02-17 18:25:52 +00:00
|
|
|
rows=(2 if num_rows < 2 else 4), maxrows=10)
|
2015-02-10 23:09:45 +00:00
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.operator("file.bookmark_add", icon='ZOOMIN', text="")
|
|
|
|
col.operator("file.bookmark_delete", icon='ZOOMOUT', text="")
|
|
|
|
col.menu("FILEBROWSER_MT_bookmarks_specials", icon='DOWNARROW_HLT', text="")
|
|
|
|
|
|
|
|
if num_rows > 1:
|
|
|
|
col.separator()
|
|
|
|
col.operator("file.bookmark_move", icon='TRIA_UP', text="").direction = 'UP'
|
|
|
|
col.operator("file.bookmark_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
|
|
|
|
else:
|
|
|
|
layout.operator("file.bookmark_add", icon='ZOOMIN')
|
|
|
|
|
|
|
|
|
|
|
|
class FILEBROWSER_PT_recent_folders(Panel):
|
|
|
|
bl_space_type = 'FILE_BROWSER'
|
|
|
|
bl_region_type = 'TOOLS'
|
|
|
|
bl_category = "Bookmarks"
|
|
|
|
bl_label = "Recent"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return not context.user_preferences.filepaths.hide_recent_locations
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
space = context.space_data
|
|
|
|
|
|
|
|
if space.recent_folders:
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list("FILEBROWSER_UL_dir", "recent_folders", space, "recent_folders",
|
2015-02-17 18:25:52 +00:00
|
|
|
space, "recent_folders_active", item_dyntip_propname="path", rows=1, maxrows=10)
|
2015-02-10 23:09:45 +00:00
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.operator("file.reset_recent", icon='X', text="")
|
|
|
|
|
|
|
|
|
Final 'FileBrowser First Stage' merge.
It basically rewrites most of filelist.c, with some more limited changes in other areas of filebrowser.
From user perspective, it:
* Removes some info in 'long' drawing mode (owner, permissions) - OS-specific data that do not really matter in Blender!
* Makes short/long display 'fixed' size (among four choices, like thumbnails mode).
* Allows to list several layers of dirtree at once, in a flat way (inside .blend files and/or real directories).
* Consequently, adds datablocks types filtering.
* Uses way less RAM when listing big directories, especially in thumbnail mode (we are talking of several hundred of MiB spared).
* Generates thumbnails way faster.
From code perspective, it:
* Is ready for asset engine needs (on data structure level in filebrowser's listing).
* Simplifies and makes 'generic' file listing much lighter.
* Separates file listing in three different aspects:
** 'generic' filelisting (in BLI), which becomes a shallow wrapper around stat struct.
** 'filebrowser drawing' filelisting, which only contains current visible subset of the whole list (sliding window), with extra drawing data (strings for size, date/time, preview, etc.).
** 'asset-ready' filelisting, which is used for operations common to 'basic' filehandling and future asset-related one.
* Uses uuid's to handle file selection/state in the browser, instead of using flags in filelisting items.
* Uses much lighter BLI_task handling for previews, instead of heavy 'job' system (using the new 'notifier' timer to handle UI refresh, in similar way to jobs).
* Moves .blend datablocks preview handling to IMB_thumbnail (necessary to avoid storing all datablock previews at once, and gives better consistency and performances too).
Revision: https://developer.blender.org/D1316
Thanks to Campbell & Sergey for the reviews. :)
2015-08-19 20:41:39 +00:00
|
|
|
class FILEBROWSER_PT_advanced_filter(Panel):
|
|
|
|
bl_space_type = 'FILE_BROWSER'
|
|
|
|
bl_region_type = 'TOOLS'
|
|
|
|
bl_category = "Filter"
|
|
|
|
bl_label = "Advanced Filter"
|
|
|
|
|
2015-10-06 18:17:40 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
# only useful in append/link (library) context currently...
|
|
|
|
return context.space_data.params.use_library_browsing
|
|
|
|
|
Final 'FileBrowser First Stage' merge.
It basically rewrites most of filelist.c, with some more limited changes in other areas of filebrowser.
From user perspective, it:
* Removes some info in 'long' drawing mode (owner, permissions) - OS-specific data that do not really matter in Blender!
* Makes short/long display 'fixed' size (among four choices, like thumbnails mode).
* Allows to list several layers of dirtree at once, in a flat way (inside .blend files and/or real directories).
* Consequently, adds datablocks types filtering.
* Uses way less RAM when listing big directories, especially in thumbnail mode (we are talking of several hundred of MiB spared).
* Generates thumbnails way faster.
From code perspective, it:
* Is ready for asset engine needs (on data structure level in filebrowser's listing).
* Simplifies and makes 'generic' file listing much lighter.
* Separates file listing in three different aspects:
** 'generic' filelisting (in BLI), which becomes a shallow wrapper around stat struct.
** 'filebrowser drawing' filelisting, which only contains current visible subset of the whole list (sliding window), with extra drawing data (strings for size, date/time, preview, etc.).
** 'asset-ready' filelisting, which is used for operations common to 'basic' filehandling and future asset-related one.
* Uses uuid's to handle file selection/state in the browser, instead of using flags in filelisting items.
* Uses much lighter BLI_task handling for previews, instead of heavy 'job' system (using the new 'notifier' timer to handle UI refresh, in similar way to jobs).
* Moves .blend datablocks preview handling to IMB_thumbnail (necessary to avoid storing all datablock previews at once, and gives better consistency and performances too).
Revision: https://developer.blender.org/D1316
Thanks to Campbell & Sergey for the reviews. :)
2015-08-19 20:41:39 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
space = context.space_data
|
|
|
|
params = space.params
|
|
|
|
|
|
|
|
if params and params.use_library_browsing:
|
|
|
|
layout.prop(params, "use_filter_blendid")
|
|
|
|
if params.use_filter_blendid:
|
|
|
|
layout.separator()
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(params, "filter_id")
|
|
|
|
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
bpy.utils.register_module(__name__)
|