Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/filelist.c
| Show First 20 Lines • Show All 3,392 Lines • ▼ Show 20 Lines | |||||
| static void filelist_readjob_lib(FileListReadJob *job_params, | static void filelist_readjob_lib(FileListReadJob *job_params, | ||||
| short *stop, | short *stop, | ||||
| short *do_update, | short *do_update, | ||||
| float *progress) | float *progress) | ||||
| { | { | ||||
| filelist_readjob_do(true, job_params, stop, do_update, progress); | filelist_readjob_do(true, job_params, stop, do_update, progress); | ||||
| } | } | ||||
| static void filelist_asset_library_path(const FileListReadJob *job_params, | |||||
| char r_library_root_path[FILE_MAX]) | |||||
| { | |||||
| if (job_params->filelist->type == FILE_MAIN_ASSET) { | |||||
| /* For the "Current File" library (#FILE_MAIN_ASSET) we get the asset library root path based | |||||
| * on main. */ | |||||
| BKE_asset_library_find_suitable_root_path_from_main(job_params->current_main, | |||||
| r_library_root_path); | |||||
| } | |||||
| else { | |||||
| BLI_strncpy(r_library_root_path, job_params->tmp_filelist->filelist.root, FILE_MAX); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * Load asset library data, which currently means loading the asset catalogs for the library. | |||||
| */ | |||||
| static void filelist_readjob_load_asset_library_data(FileListReadJob *job_params, short *do_update) | static void filelist_readjob_load_asset_library_data(FileListReadJob *job_params, short *do_update) | ||||
| { | { | ||||
| FileList *tmp_filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ | FileList *tmp_filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ | ||||
| /* Check whether assets catalogs need to be loaded. */ | |||||
| if (job_params->filelist->asset_library_ref != NULL) { | if (job_params->filelist->asset_library_ref != NULL) { | ||||
| char library_root_path[FILE_MAX]; | |||||
| filelist_asset_library_path(job_params, library_root_path); | |||||
| /* Load asset catalogs, into the temp filelist for thread-safety. | /* Load asset catalogs, into the temp filelist for thread-safety. | ||||
| * #filelist_readjob_endjob() will move it into the real filelist. */ | * #filelist_readjob_endjob() will move it into the real filelist. */ | ||||
| tmp_filelist->asset_library = BKE_asset_library_load(tmp_filelist->filelist.root); | tmp_filelist->asset_library = BKE_asset_library_load(library_root_path); | ||||
| *do_update = true; | *do_update = true; | ||||
| } | } | ||||
| } | } | ||||
| static void filelist_readjob_asset_library(FileListReadJob *job_params, | static void filelist_readjob_asset_library(FileListReadJob *job_params, | ||||
| short *stop, | short *stop, | ||||
| short *do_update, | short *do_update, | ||||
| float *progress) | float *progress) | ||||
| ▲ Show 20 Lines • Show All 232 Lines • Show Last 20 Lines | |||||