Commit: b8705900099f6d7c3e8d94ba658d21924f25f198 Author: Bastien Montagne Date: Fri Dec 1 14:20:11 2017 +0100 Branches: asset-engine https://developer.blender.org/rBb8705900099f6d7c3e8d94ba658d21924f25f198
Various cleanup and minor fixes. =================================================================== M release/scripts/startup/bl_ui/space_info.py M source/blender/blenkernel/intern/blender.c M source/blender/blenkernel/intern/library.c M source/blender/blenloader/intern/readfile.c M source/blender/blenloader/intern/versioning_270.c M source/blender/blenloader/intern/versioning_280.c M source/blender/blenloader/intern/writefile.c M source/blender/editors/include/UI_interface.h M source/blender/editors/space_file/file_intern.h M source/blender/editors/space_file/file_ops.c M source/blender/editors/space_file/filelist.c M source/blender/editors/space_file/filelist.h M source/blender/editors/space_file/space_file.c M source/blender/makesdna/DNA_ID.h M source/blender/makesrna/intern/rna_space.c M source/blender/python/intern/bpy_app.c M source/blender/windowmanager/WM_types.h M source/blender/windowmanager/intern/wm_files.c M source/blender/windowmanager/intern/wm_files_link.c =================================================================== diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 7f3507f9db0..f5b7e15dc39 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -88,7 +88,6 @@ class INFO_HT_header(Header): if (bpy.app.assets_fail or bpy.app.assets_need_reload) and not bpy.app.assets_quiet: row.operator("script.assets_warn_clear", text="Ignore") if bpy.app.assets_need_reload is True and bpy.app.assets_quiet is False: - #~ row.label(icon='SCREEN_BACK', text="Reload Assets") row.operator("wm.assets_reload", icon='SCREEN_BACK', text="Reload Assets") row.label("Some assets have to be reloaded", icon='INFO') if bpy.app.assets_fail is True and bpy.app.assets_quiet is False: diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 0f24008629b..b8a66b0e81f 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -72,6 +72,7 @@ #include "BLF_api.h" + Global G; UserDef U; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 221c3796963..f8fd7b98431 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -2473,7 +2473,7 @@ void BKE_id_ui_prefix(char name[MAX_ID_NAME + 1], const ID *id) void BKE_library_filepath_set(Library *lib, const char *filepath) { if (lib->flag & LIBRARY_FLAG_VIRTUAL) { - /* Setting path for virtual libraries makes no sense. */ + BLI_assert(!"Setting path for virtual libraries makes no sense."); return; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 933f29db350..1cdfbc0a061 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7608,7 +7608,9 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main) { Main *newmain; +#ifdef DEBUG_LIBRARY printf("adding lib %s (%s)\n", lib->id.name, lib->name); +#endif /* check if the library was already read */ for (newmain = fd->mainlist->first; newmain; newmain = newmain->next) { @@ -8470,7 +8472,9 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, const short return blo_nextbhead(fd, bhead); id->tag = tag | LIB_TAG_NEED_LINK; +#ifdef DEBUG_LIBRARY printf("id: %s (%p, %p), lib: %p\n", id->name, id, id->uuid, main->curlib); +#endif id->lib = main->curlib; id->us = ID_FAKE_USERS(id); id->icon_id = 0; diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 799ccacbf09..b945f5bdcd3 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -1725,32 +1725,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } - - { - /* Move non-op filebrowsers to 'library browsing' type/mode. */ - for (bScreen *screen = main->screen.first; screen; screen = screen->id.next) { - for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { - for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { - if (sl->spacetype == SPACE_FILE) { - SpaceFile *sfile = (SpaceFile *)sl; - if (sfile->params != NULL) { - sfile->params->type = FILE_LOADLIB; - sfile->params->filter = FILE_TYPE_FOLDER | FILE_TYPE_BLENDERLIB; - /* For now, always init filterid to 'all true' */ - sfile->params->filter_id = FILTER_ID_AC | FILTER_ID_AR | FILTER_ID_BR | FILTER_ID_CA | - FILTER_ID_CU | FILTER_ID_GD | FILTER_ID_GR | FILTER_ID_IM | - FILTER_ID_LA | FILTER_ID_LS | FILTER_ID_LT | FILTER_ID_MA | - FILTER_ID_MB | FILTER_ID_MC | FILTER_ID_ME | FILTER_ID_MSK | - FILTER_ID_NT | FILTER_ID_OB | FILTER_ID_PA | FILTER_ID_PAL | - FILTER_ID_PC | FILTER_ID_SCE | FILTER_ID_SPK | FILTER_ID_SO | - FILTER_ID_TE | FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_WO | - FILTER_ID_CF; - } - } - } - } - } - } } void do_versions_after_linking_270(Main *main) diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 8da4fef7b21..3f15284ca6f 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -753,4 +753,33 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main) } } } + + + { + if (1 || !DNA_struct_find(fd->filesdna, "AssetUUID")) { /* struct_find will have to wait, not working for now... */ + /* Move non-op filebrowsers to 'library browsing' type/mode. */ + for (bScreen *screen = main->screen.first; screen; screen = screen->id.next) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_FILE) { + SpaceFile *sfile = (SpaceFile *)sl; + if (sfile->params != NULL) { + sfile->params->type = FILE_LOADLIB; + sfile->params->filter = FILE_TYPE_FOLDER | FILE_TYPE_BLENDERLIB; + /* For now, always init filterid to 'all true' */ + sfile->params->filter_id = FILTER_ID_AC | FILTER_ID_AR | FILTER_ID_BR | FILTER_ID_CA | + FILTER_ID_CU | FILTER_ID_GD | FILTER_ID_GR | FILTER_ID_IM | + FILTER_ID_LA | FILTER_ID_LS | FILTER_ID_LT | FILTER_ID_MA | + FILTER_ID_MB | FILTER_ID_MC | FILTER_ID_ME | FILTER_ID_MSK | + FILTER_ID_NT | FILTER_ID_OB | FILTER_ID_PA | FILTER_ID_PAL | + FILTER_ID_PC | FILTER_ID_SCE | FILTER_ID_SPK | FILTER_ID_SO | + FILTER_ID_TE | FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_WO | + FILTER_ID_CF; + } + } + } + } + } + } + } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 23d039be20e..e9012646464 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -24,7 +24,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/blenloader/intern/ ile.c +/** \file blender/blenloader/intern/writefile.c * \ingroup blenloader */ @@ -3846,7 +3846,7 @@ static void write_libraries(WriteData *wd, Main *main) while (a--) { for (id = lbarray[a]->first; id; id = id->next) { switch ((ID_Type)GS(id->name)) { - /* Those should be the only datatypes found in a virtual library! */ + /* Those should be the only datatypes found in a virtual library (for now)! */ case ID_IM: write_image(wd, (Image *)id); break; diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index f39093662ff..468534a40ce 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -525,8 +525,10 @@ void UI_but_drag_set_rna(uiBut *but, struct PointerRNA *ptr); void UI_but_drag_set_path(uiBut *but, const char *path, const bool use_free); void UI_but_drag_set_name(uiBut *but, const char *name); void UI_but_drag_set_value(uiBut *but); -void UI_but_drag_set_image(uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale, const bool use_free); -void UI_but_drag_set_library(uiBut *but, const int icon, struct ImBuf *ima, const float scale, const uiDragLibraryHandle *drag_data, const bool use_free); +void UI_but_drag_set_image( + uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale, const bool use_free); +void UI_but_drag_set_library( + uiBut *but, const int icon, struct ImBuf *ima, const float scale, const uiDragLibraryHandle *drag_data, const bool use_free); bool UI_but_active_drop_name(struct bContext *C); bool UI_but_active_drop_color(struct bContext *C); diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 2153fdb40f3..05bc66528da 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -113,6 +113,7 @@ void file_sfile_to_operator_ex(struct wmOperator *op, struct SpaceFile *sfile, c void file_sfile_to_operator(struct wmOperator *op, struct SpaceFile *sfile); void file_operator_to_sfile(struct SpaceFile *sfile, struct wmOperator *op); + /* filesel.c */ void fileselect_file_set(SpaceFile *sfile, const int index); float file_string_width(const char *str); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 79ddaf64bc2..638eb76837e 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1439,7 +1439,7 @@ int file_exec(bContext *C, wmOperator *exec_op) SpaceFile *sfile = CTX_wm_space_file(C); const struct FileDirEntry *file = filelist_file(sfile->files, sfile->params->active_file); char filepath[FILE_MAX_LIBEXTRA]; - + /* directory change */ if (file && (file->typeflag & FILE_TYPE_DIR)) { if (!file->relpath) { diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 3f8de328748..a7acf3d0afe 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1889,17 +1889,19 @@ static bool filelist_file_cache_block_create(FileList *filelist, const int start static void filelist_file_cache_block_release(struct FileList *filelist, const int size, int cursor) { FileListEntryCache *cache = &filelist->filelist_cache; - int i; - for (i = 0; i < size; i++, cursor++) { - FileDirEntry *entry @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs