diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2018-06-22 13:30:27 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2018-06-22 13:31:20 +0300 |
commit | 0427eca2a6761e1b8a8fd9a44434c2f0e94df75e (patch) | |
tree | 9b8037bfe6986b86f4d0ad36cb3d0b0644826dc2 /source/blender/makesrna/intern/rna_userdef.c | |
parent | e402c363888fc1fea38ffcf30b19502da46244d9 (diff) |
StudioLight: remove caches when removing studiolight
Cache files were not deleted and when uploading a new file with the same
name resulted in using the old cache file.
Diffstat (limited to 'source/blender/makesrna/intern/rna_userdef.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index d6e6eb31dc3..b617d1ba9be 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -692,6 +692,32 @@ static int rna_UserDef_studiolight_path_length(PointerRNA *ptr) return strlen(sl->path); } +/* StudioLight.path_irr_cache */ +static void rna_UserDef_studiolight_path_irr_cache_get(PointerRNA *ptr, char *value) +{ + StudioLight *sl = (StudioLight *)ptr->data; + BLI_strncpy(value, sl->path_irr_cache, FILE_MAX); +} + +static int rna_UserDef_studiolight_path_irr_cache_length(PointerRNA *ptr) +{ + StudioLight *sl = (StudioLight *)ptr->data; + return strlen(sl->path_irr_cache); +} + +/* StudioLight.path_sh_cache */ +static void rna_UserDef_studiolight_path_sh_cache_get(PointerRNA *ptr, char *value) +{ + StudioLight *sl = (StudioLight *)ptr->data; + BLI_strncpy(value, sl->path_sh_cache, FILE_MAX); +} + +static int rna_UserDef_studiolight_path_sh_cache_length(PointerRNA *ptr) +{ + StudioLight *sl = (StudioLight *)ptr->data; + return strlen(sl->path_sh_cache); +} + /* StudioLight.index */ static int rna_UserDef_studiolight_index_get(PointerRNA *ptr) { @@ -3270,6 +3296,16 @@ static void rna_def_userdef_studiolight(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Path", ""); RNA_def_property_clear_flag(prop, PROP_EDITABLE); + prop = RNA_def_property(srna, "path_irr_cache", PROP_STRING, PROP_DIRPATH); + RNA_def_property_string_funcs(prop, "rna_UserDef_studiolight_path_irr_cache_get", "rna_UserDef_studiolight_path_irr_cache_length", NULL); + RNA_def_property_ui_text(prop, "Irradiance Cache Path", "Path where the irradiance cache is stored"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + + prop = RNA_def_property(srna, "path_sh_cache", PROP_STRING, PROP_DIRPATH); + RNA_def_property_string_funcs(prop, "rna_UserDef_studiolight_path_sh_cache_get", "rna_UserDef_studiolight_path_sh_cache_length", NULL); + RNA_def_property_ui_text(prop, "SH Cache Path", "Path where the spherical harmonics cache is stored"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_define_verify_sdna(true); } |