LibOverride: Expose the 'needs resync' status of libraries to RNA/Py API.

Could be useful for automated update/sanitizer tools in a production
pipeline.

Note that this propoerty is left editable for now, on purpose (external
tools may want to clear the flag).
This commit is contained in:
Bastien Montagne
2023-09-06 17:13:07 +02:00
parent 1a4225d746
commit 3ce87be27f

View File

@@ -2493,6 +2493,14 @@ static void rna_def_library(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_THICK_WRAP);
prop = RNA_def_property(srna, "needs_liboverride_resync", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, nullptr, "tag", LIBRARY_TAG_RESYNC_REQUIRED);
RNA_def_property_ui_text(prop,
"Library Overrides Need resync",
"True if this library contains library overrides that are linked in "
"current blendfile, and that had to be recursively resynced on load "
"(it is recommended to open and re-save that library blendfile then)");
func = RNA_def_function(srna, "reload", "rna_Library_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");