[Bf-blender-cvs] [1ca9c54] asset-engine: Merge branch 'asset-experiments' into asset-engine

Bastien Montagne noreply at git.blender.org
Mon May 4 15:57:50 CEST 2015


Commit: 1ca9c549f90fa63f98f4f8e01a3093dcaf80c3ed
Author: Bastien Montagne
Date:   Mon May 4 15:55:56 2015 +0200
Branches: asset-engine
https://developer.blender.org/rB1ca9c549f90fa63f98f4f8e01a3093dcaf80c3ed

Merge branch 'asset-experiments' into asset-engine

===================================================================



===================================================================

diff --cc release/scripts/startup/bl_ui/space_filebrowser.py
index 7862126,9033ff9..dd5a611
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@@ -43,183 -43,59 +44,63 @@@ class FILEBROWSER_HT_header(Header)
          row = layout.row()
          row.separator()
  
 -        row = layout.row(align=True)
 -        layout.operator_context = 'EXEC_DEFAULT'
 -        row.operator("file.directory_new", icon='NEWFOLDER')
 +        if st.asset_engine:
 +            draw_header = getattr(st.asset_engine, "draw_header", None)
 +            if draw_header:
 +                draw_header(row, context)
 +        else:
 +            row = layout.row(align=True)
 +            layout.operator_context = 'EXEC_DEFAULT'
 +            row.operator("file.directory_new", icon='NEWFOLDER')
 +            layout.operator_context = 'INVOKE_DEFAULT'
  
 -        layout.operator_context = 'INVOKE_DEFAULT'
 -        params = st.params
 +            params = st.params
  
 -        # can be None when save/reload with a file selector open
 -        if params:
 -            is_lib_browser = params.use_library_browsing
 +            # can be None when save/reload with a file selector open
 +            if params:
 +                is_lib_browser = params.use_library_browsing
  
 -            layout.prop(params, "display_type", expand=True, text="")
 +                layout.prop(params, "display_type", expand=True, text="")
  
 -            if params.display_type == 'FILE_IMGDISPLAY':
 -                layout.prop(params, "thumbnail_size", text="")
 +                if params.display_type == 'FILE_IMGDISPLAY':
 +                    layout.prop(params, "thumbnail_size", text="")
  
 -            layout.prop(params, "sort_method", expand=True, text="")
 +                layout.prop(params, "sort_method", expand=True, text="")
  
 -            layout.prop(params, "recursion_level")
 -            layout.prop(params, "show_hidden", text="", icon='FILE_HIDDEN')
 -            layout.prop(params, "use_filter", text="", icon='FILTER')
 +                layout.prop(params, "recursion_level")
 +                layout.prop(params, "show_hidden", text="", icon='FILE_HIDDEN')
 +                layout.prop(params, "use_filter", text="", icon='FILTER')
  
 -            row = layout.row(align=True)
 -            row.active = params.use_filter
 -
 -            row.prop(params, "use_filter_folder", text="")
 -
 -            if params.filter_glob:
 -                #if st.active_operator and hasattr(st.active_operator, "filter_glob"):
 -                #    row.prop(params, "filter_glob", text="")
 -                row.label(params.filter_glob)
 -            else:
 -                row.prop(params, "use_filter_blender", text="")
 -                row.prop(params, "use_filter_backup", text="")
 -                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="")
 -
 -            if is_lib_browser:
 -                row.prop(params, "use_filter_blendid", text="")
 -                if (params.use_filter_blendid) :
 -                    row.separator()
 -                    row.prop(params, "filter_id", text="")
 -
 -            row.separator()
 -            row.prop(params, "filter_search", text="", icon='VIEWZOOM')
 +                row = layout.row(align=True)
 +                row.active = params.use_filter
  
 -        layout.template_running_jobs()
 +                row.prop(params, "use_filter_folder", text="")
  
 +                if params.filter_glob:
 +                    #if st.active_operator and hasattr(st.active_operator, "filter_glob"):
 +                    #    row.prop(params, "filter_glob", text="")
 +                    row.label(params.filter_glob)
 +                else:
 +                    row.prop(params, "use_filter_blender", text="")
 +                    row.prop(params, "use_filter_backup", text="")
 +                    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="")
 +
 +                if is_lib_browser:
 +                    row.prop(params, "use_filter_blendid", text="")
 +                    if (params.use_filter_blendid) :
 +                        row.separator()
 +                        row.prop(params, "filter_id", text="")
 +
 +                row.separator()
 +                row.prop(params, "filter_search", text="", icon='VIEWZOOM')
 +
 +        layout.template_running_jobs()
  
- 
- class FILEBROWSER_UL_dir(bpy.types.UIList):
-     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
-         direntry = item
-         space = context.space_data
-         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)
-             row.prop(direntry, "name", text="", emboss=False, icon=icon)
- 
-         elif self.layout_type in {'GRID'}:
-             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",
-                               space, "system_folders_active", rows=1, maxrows=6)
- 
- 
- 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",
-                               space, "system_bookmarks_active", rows=1, maxrows=6)
- 
- 
- class FILEBROWSER_MT_bookmarks_specials(Menu):
-     bl_label = "Bookmarks Specials"
- 
-     def draw(self, context):
-         layout = self.layout
- 
-         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", rows=(2 if num_rows < 2 else 4), maxrows=6)
- 
-             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'
- 
- 
- 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",
-                                  space, "recent_folders_active", rows=1, maxrows=6)
- 
-             col = row.column(align=True)
-             col.operator("file.reset_recent", icon='X', text="")
- 
- 
  class FILEBROWSER_UL_dir(bpy.types.UIList):
      def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
          direntry = item




More information about the Bf-blender-cvs mailing list