|
Blender V5.3
|
#include <string>Go to the source code of this file.
Classes | |
| class | blender::recents::Section |
Namespaces | |
| namespace | blender |
| BMesh Iterators. | |
| namespace | blender::recents |
Functions | |
| void | blender::recents::init () |
| void | blender::recents::init_async () |
| void | blender::recents::ensure_init () |
| bool | blender::recents::save () |
Recents API for persisted UI state.
This namespace provides a small, convenient API to read and write small pieces of persisted UI state (window geometry, panel flags, last-used filters, etc.) organized in named "sections".
Data is stored as TOML and split into:
Lookup order (when reading a key)
Versioning save() saves a root-level blender_version key (see BLENDER_VERSION) with the version that wrote the file. Code that needs to handle older data specifically can read it via recents::Section("").get<int32_t>("blender_version").
Threading / initialization Call recents::init() or recents::init_async() early in startup to populate runtime data from the built-in defaults and the on-disk file. The module will lazily ensure initialization when needed, so explicit init is optional but recommended to avoid synchronous waits.
Typical usage // Read auto bounds = recents::Section("temp.window.dimensions").get<std::vector<float>>("PREFERENCES");
// Write recents::Section("temp.window.dimensions").set("PREFERENCES", bounds);
// Explicit get/set auto s = recents::Section("panels"); bool is_open = s.get<bool>("open"); s.set("width", 12);
Definition in file BKE_recents.hh.