diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-17 14:27:07 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-17 17:41:42 +0300 |
commit | 8a97b8555587d8241fd79d54c08c1a6ced7acf53 (patch) | |
tree | 542918ca772900129bf35f4187682bcfd5932bc8 /source | |
parent | d8293fd6be0c3a5a0e615bfd4717ecc36e19bd49 (diff) |
Fix T54504: Cycles wrong backwards compatibility with linked libraries.
The code assumed all datablocks were read from .blend files saved with the
same version. This restructures the Cycles versioning code to take into
account libraries.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 3a22782f31e..85b1ec4d958 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -762,6 +762,14 @@ static IDProperty *rna_IDPropertyWrapPtr_idprops(PointerRNA *ptr, bool UNUSED(cr return ptr->data; } +static void rna_Library_version_get(PointerRNA *ptr, int *value) +{ + Library *lib = (Library *)ptr->data; + value[0] = lib->versionfile / 100; + value[1] = lib->versionfile % 100; + value[2] = lib->subversionfile; +} + #else static void rna_def_ID_properties(BlenderRNA *brna) @@ -1110,6 +1118,12 @@ static void rna_def_library(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "packedfile"); RNA_def_property_ui_text(prop, "Packed File", ""); + prop = RNA_def_int_vector(srna, "version", 3, NULL, 0, INT_MAX, + "Version", "Version of Blender the library .blend was saved with", 0, INT_MAX); + RNA_def_property_int_funcs(prop, "rna_Library_version_get", NULL, NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_flag(prop, PROP_THICK_WRAP); + func = RNA_def_function(srna, "reload", "WM_lib_reload"); RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Reload this library and all its linked data-blocks"); |