Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/cachefile.c
| Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | |||||
| #endif | #endif | ||||
| if (cache_file->handle_mutex) { | if (cache_file->handle_mutex) { | ||||
| BLI_mutex_free(cache_file->handle_mutex); | BLI_mutex_free(cache_file->handle_mutex); | ||||
| } | } | ||||
| BLI_freelistN(&cache_file->object_paths); | BLI_freelistN(&cache_file->object_paths); | ||||
| } | } | ||||
| CacheFile *BKE_cachefile_copy(Main *bmain, const CacheFile *cache_file) | /** | ||||
| * Only copy internal data of CacheFile ID from source to already allocated/initialized destination. | |||||
| * You probably nerver want to use that directly, use id_copy or BKE_id_copy_ex for typical needs. | |||||
| * | |||||
| * WARNING! This function will not handle ID user count! | |||||
| * | |||||
| * \param flag Copying options (see BKE_library.h's LIB_ID_COPY_... flags for more). | |||||
| */ | |||||
| void BKE_cachefile_copy_data( | |||||
| Main *UNUSED(bmain), CacheFile *cache_file_dst, const CacheFile *UNUSED(cache_file_src), const int UNUSED(flag)) | |||||
| { | { | ||||
| CacheFile *new_cache_file = BKE_libblock_copy(bmain, &cache_file->id); | cache_file_dst->handle = NULL; | ||||
| new_cache_file->handle = NULL; | BLI_listbase_clear(&cache_file_dst->object_paths); | ||||
| } | |||||
| BLI_listbase_clear(&new_cache_file->object_paths); | |||||
| BKE_id_copy_ensure_local(bmain, &cache_file->id, &new_cache_file->id); | |||||
| return new_cache_file; | CacheFile *BKE_cachefile_copy(Main *bmain, const CacheFile *cache_file) | ||||
| { | |||||
| CacheFile *cache_file_copy; | |||||
| BKE_id_copy_ex(bmain, &cache_file->id, (ID **)&cache_file_copy, 0, false); | |||||
| return cache_file_copy; | |||||
| } | } | ||||
| void BKE_cachefile_make_local(Main *bmain, CacheFile *cache_file, const bool lib_local) | void BKE_cachefile_make_local(Main *bmain, CacheFile *cache_file, const bool lib_local) | ||||
| { | { | ||||
| BKE_id_make_local_generic(bmain, &cache_file->id, true, lib_local); | BKE_id_make_local_generic(bmain, &cache_file->id, true, lib_local); | ||||
| } | } | ||||
| void BKE_cachefile_reload(const Main *bmain, CacheFile *cache_file) | void BKE_cachefile_reload(const Main *bmain, CacheFile *cache_file) | ||||
| ▲ Show 20 Lines • Show All 126 Lines • Show Last 20 Lines | |||||