[Bf-blender-cvs] [9379b7f] asset-engine: Merge branch 'asset-experiments' into asset-engine
Bastien Montagne
noreply at git.blender.org
Sat Jun 27 23:30:28 CEST 2015
Commit: 9379b7f96844c842271580ccbb86ffe3750025c4
Author: Bastien Montagne
Date: Sat Jun 27 23:26:32 2015 +0200
Branches: asset-engine
https://developer.blender.org/rB9379b7f96844c842271580ccbb86ffe3750025c4
Merge branch 'asset-experiments' into asset-engine
Conflicts:
release/scripts/startup/bl_ui/space_filebrowser.py
source/blender/editors/space_file/filelist.c
===================================================================
===================================================================
diff --cc release/scripts/startup/bl_ui/space_filebrowser.py
index 7cc8656,1f9c470..f47a01b
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@@ -41,62 -40,59 +41,62 @@@ class FILEBROWSER_HT_header(Header)
row.operator("file.parent", text="", icon='FILE_PARENT')
row.operator("file.refresh", text="", icon='FILE_REFRESH')
- layout.separator()
- layout.operator_context = 'EXEC_DEFAULT'
- layout.operator("file.directory_new", icon='NEWFOLDER', text="")
- layout.separator()
+ if st.asset_engine:
+ draw_header = getattr(st.asset_engine, "draw_header", None)
+ if draw_header:
+ draw_header(layout, context)
+ else:
+ layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator("file.directory_new", icon='NEWFOLDER', text="")
+ layout.separator()
+ 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, "recursion_level", text="")
+ layout.prop(params, "recursion_level", text="")
- layout.prop(params, "display_type", expand=True, text="")
+ layout.prop(params, "display_type", expand=True, text="")
- layout.prop(params, "thumbnail_size", text="")
+ 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, "show_hidden", text="", icon='FILE_HIDDEN')
- layout.prop(params, "use_filter", text="", icon='FILTER')
+ 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) :
++ 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):
diff --cc source/blender/editors/space_file/filelist.c
index 8edd1b9,76f7d6f..8b910f3
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@@ -2649,11 -2487,6 +2654,10 @@@ typedef struct FileListReadJob
char main_name[FILE_MAX];
struct FileList *filelist;
struct FileList *tmp_filelist; /* XXX We may use a simpler struct here... just a linked list and root path? */
+
+ int ae_job_id;
+ float *progress;
+ short *stop;
- //~ ReportList reports;
} FileListReadJob;
static void filelist_readjob_startjob(void *flrjv, short *stop, short *do_update, float *progress)
@@@ -2661,36 -2494,28 +2665,39 @@@
FileListReadJob *flrj = flrjv;
printf("START filelist reading (%d files, main thread: %d)\n",
- flrj->filelist->filelist.nbr_entries, BLI_thread_is_main());
-
- BLI_mutex_lock(&flrj->lock);
+ flrj->filelist->filelist.nbr_entries, BLI_thread_is_main());
+
+ if (flrj->filelist->ae) {
+ flrj->progress = progress;
+ flrj->stop = stop;
+ /* When using AE engine, worker thread here is just sleeping! */
+ while ((flrj->filelist->flags & FL_IS_PENDING) && !*stop) {
+ PIL_sleep_ms(10);
+ *do_update = true;
+ }
+ }
+ else {
+ BLI_mutex_lock(&flrj->lock);
- BLI_assert((flrj->tmp_filelist == NULL) && flrj->filelist);
+ BLI_assert((flrj->tmp_filelist == NULL) && flrj->filelist);
- flrj->tmp_filelist = MEM_dupallocN(flrj->filelist);
+ flrj->tmp_filelist = MEM_dupallocN(flrj->filelist);
- BLI_mutex_unlock(&flrj->lock);
-
- BLI_listbase_clear(&flrj->tmp_filelist->filelist.entries);
- flrj->tmp_filelist->filelist.nbr_entries = 0;
+ BLI_listbase_clear(&flrj->tmp_filelist->filelist.entries);
+ flrj->tmp_filelist->filelist.nbr_entries = 0;
+
- flrj->tmp_filelist->filelist_intern.filtered = NULL;
- BLI_listbase_clear(&flrj->tmp_filelist->filelist_intern.entries);
- memset(flrj->tmp_filelist->filelist_intern.curr_uuid, 0, sizeof(flrj->tmp_filelist->filelist_intern.curr_uuid));
+ flrj->tmp_filelist->filelist_intern.filtered = NULL;
+ BLI_listbase_clear(&flrj->tmp_filelist->filelist_intern.entries);
++ memset(flrj->tmp_filelist->filelist_intern.curr_uuid, 0, sizeof(flrj->tmp_filelist->filelist_intern.curr_uuid));
+
- flrj->tmp_filelist->libfiledata = NULL;
- memset(&flrj->tmp_filelist->filelist_cache, 0, sizeof(flrj->tmp_filelist->filelist_cache));
- flrj->tmp_filelist->selection_state = NULL;
+ flrj->tmp_filelist->libfiledata = NULL;
- memset(&flrj->tmp_filelist->filelist_cache, 0, sizeof(FileListEntryCache));
++ memset(&flrj->tmp_filelist->filelist_cache, 0, sizeof(flrj->tmp_filelist->filelist_cache));
+ flrj->tmp_filelist->selection_state = NULL;
- BLI_mutex_unlock(&flrj->lock);
++ BLI_mutex_unlock(&flrj->lock);
+
- flrj->tmp_filelist->read_jobf(flrj->tmp_filelist, flrj->main_name, stop, do_update, progress, &flrj->lock);
+ flrj->tmp_filelist->read_jobf(flrj->tmp_filelist, flrj->main_name, stop, do_update, progress, &flrj->lock);
+ }
}
static void filelist_readjob_update(void *flrjv)
More information about the Bf-blender-cvs
mailing list