diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_cachefile.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_cachefile.c | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/source/blender/makesrna/intern/rna_cachefile.c b/source/blender/makesrna/intern/rna_cachefile.c index fb61be69ee6..189a4a7de86 100644 --- a/source/blender/makesrna/intern/rna_cachefile.c +++ b/source/blender/makesrna/intern/rna_cachefile.c @@ -45,29 +45,12 @@ # include "../../../alembic/ABC_alembic.h" # endif -static void rna_CacheFile_update(Main *bmain, Scene *scene, PointerRNA *ptr) +static void rna_CacheFile_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { CacheFile *cache_file = (CacheFile *)ptr->data; - DEG_id_tag_update(&cache_file->id, 0); + DEG_id_tag_update(&cache_file->id, ID_RECALC_COPY_ON_WRITE); WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); - - UNUSED_VARS(bmain, scene); -} - -static void rna_CacheFile_update_handle(Main *bmain, Scene *scene, PointerRNA *ptr) -{ - CacheFile *cache_file = ptr->data; - - if ((cache_file->flag & CACHEFILE_DIRTY) != 0) { - BKE_cachefile_clean(bmain, cache_file); - BLI_freelistN(&cache_file->object_paths); - cache_file->flag &= ~CACHEFILE_DIRTY; - } - - BKE_cachefile_reload(bmain, cache_file); - - rna_CacheFile_update(bmain, scene, ptr); } static void rna_CacheFile_object_paths_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) @@ -76,20 +59,6 @@ static void rna_CacheFile_object_paths_begin(CollectionPropertyIterator *iter, P rna_iterator_listbase_begin(iter, &cache_file->object_paths, NULL); } -static void rna_CacheFile_filename_set(PointerRNA *ptr, const char *value) -{ - CacheFile *cache_file = ptr->data; - - if (STREQ(cache_file->filepath, value)) { - return; - } - - /* Different file is opened, close all readers. */ - cache_file->flag |= CACHEFILE_DIRTY; - - BLI_strncpy(cache_file->filepath, value, sizeof(cache_file->filepath)); -} - #else /* cachefile.object_paths */ @@ -122,9 +91,8 @@ static void rna_def_cachefile(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_FILE); PropertyRNA *prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_CacheFile_filename_set"); RNA_def_property_ui_text(prop, "File Path", "Path to external displacements file"); - RNA_def_property_update(prop, 0, "rna_CacheFile_update_handle"); + RNA_def_property_update(prop, 0, "rna_CacheFile_update"); prop = RNA_def_property(srna, "is_sequence", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text( |