diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-04 16:07:37 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-01 17:02:27 +0300 |
commit | 89826e0a0d8ac55881569e021c487ac5541c6612 (patch) | |
tree | c80797e8c804d43fc84a8e91396a8a86cf3a79b7 /source/blender/editors/io | |
parent | a72a831570822190f782e6bbecfd57b45dc2e872 (diff) |
Alembic: integrate cache file into the dependency graph
* The cache file datablock is now evaluated as part of the dependency graph,
creating/freeing the Alembic file handle matching the current frame.
Modifiers and constraints depend on this evaluation.
* Cache file handles and readers now only exist on COW datablocks, never the
original ones.
* Object data paths are flushed back to the original for the user interface.
* The cache file keeps a list of all readers associated with its handle, and
automatically frees them when the handle is freed. This kind of sharing of
data across datablocks is weak but we have no better mechanism for it.
Fix T62720: Alembic sequences not working and crashing
Differential Revision: https://developer.blender.org/D4774
Diffstat (limited to 'source/blender/editors/io')
-rw-r--r-- | source/blender/editors/io/io_cache.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/editors/io/io_cache.c b/source/blender/editors/io/io_cache.c index 6358c2c1370..3dd3b20bda3 100644 --- a/source/blender/editors/io/io_cache.c +++ b/source/blender/editors/io/io_cache.c @@ -38,6 +38,8 @@ #include "RNA_access.h" +#include "DEG_depsgraph.h" + #include "UI_interface.h" #include "WM_api.h" @@ -93,7 +95,7 @@ static int cachefile_open_exec(bContext *C, wmOperator *op) CacheFile *cache_file = BKE_libblock_alloc(bmain, ID_CF, BLI_path_basename(filename), 0); BLI_strncpy(cache_file->filepath, filename, FILE_MAX); - BKE_cachefile_reload(bmain, cache_file); + DEG_id_tag_update(&cache_file->id, ID_RECALC_COPY_ON_WRITE); /* Will be set when running invoke, not exec directly. */ if (op->customdata != NULL) { @@ -137,7 +139,7 @@ void CACHEFILE_OT_open(wmOperatorType *ot) /* ***************************** Reload Operator **************************** */ -static int cachefile_reload_exec(bContext *C, wmOperator *op) +static int cachefile_reload_exec(bContext *C, wmOperator *UNUSED(op)) { CacheFile *cache_file = CTX_data_edit_cachefile(C); @@ -145,14 +147,10 @@ static int cachefile_reload_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - Main *bmain = CTX_data_main(C); - - BLI_freelistN(&cache_file->object_paths); - BKE_cachefile_reload(bmain, cache_file); + Depsgraph *depsgraph = CTX_data_depsgraph(C); + BKE_cachefile_reload(depsgraph, cache_file); return OPERATOR_FINISHED; - - UNUSED_VARS(op); } void CACHEFILE_OT_reload(wmOperatorType *ot) |