Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2021-09-24UUID: add less-than operatorSybren A. Stüvel
Add `operator<` to C++ class to allow lexicographic ordering of UUIDs. This will be necessary when writing asset catalogs to disk in a predictable (i.e. ordered) manner.
2021-09-24Cleanup: spelling in commentsCampbell Barton
2021-09-23bUUID: make it explicit the default constructor produces the nil valueSybren A. Stüvel
The implicit default constructor zeroes all plain data fields, and now this behaviour is explicit & tested for in a unit test.
2021-09-23Cleanup: UUID, fix clang-tidy warningsSybren A. Stüvel
Use explicit `uint32_t` instead of `uint`, add a missing end-of-namespace comment, and change `auto` to `const auto *`. No functional changes.
2021-09-23UUID: add `!=` operator for comparing UUIDsSybren A. Stüvel
Make it possible to unit test with `EXPECT_NE(uuid1, uuid2)`.
2021-09-23UUID: place C++ code in correct namespaceSybren A. Stüvel
Put the `bUUID` class in the `blender` namespace, instead of the `blender::bke` namespace. As a result, some C++ code now correctly uses the C++ class, where previously it would use the C struct and use implicit casting where necessary. As a result, support for initializer lists had to be explicitly coded and in another place an explicit `::bUUID` was necessary to avoid ambiguity.
2021-09-23Cleanup: bUUID, document the constructorsSybren A. Stüvel
No functional changes.
2021-09-23Assets: add Asset Catalog systemSybren A. Stüvel
Catalogs work like directories on disk (without hard-/symlinks), in that an asset is only contained in one catalog. See T90066 for design considerations. #### Known Limitations Only a single catalog definition file (CDF), is supported, at `${ASSET_LIBRARY_ROOT}/blender_assets.cats.txt`. In the future this is to be expanded to support arbitrary CDFs (like one per blend file, one per subdirectory, etc.). The current implementation is based on the asset browser, which in practice means that the asset browser owns the `AssetCatalogService` instance for the selected asset library. In the future these instances will be accessible via a less UI-bound asset system. The UI is still very rudimentary, only showing the catalog ID for the currently selected asset. Most notably, the loaded catalogs are not shown yet. The UI is being implemented and will be merged soon. #### Catalog Identifiers Catalogs are internally identified by UUID. In older designs this was a human-readable name, which has the problem that it has to be kept in sync with its semantics (so when renaming a catalog from X to Y, the UUID can be kept the same). Since UUIDs don't communicate any human-readable information, the mapping from catalog UUID to its path (stored in the Catalog Definition File, CDF) is critical for understanding which asset is stored in which human-readable catalog. To make this less critical, and to allow manual data reconstruction after a CDF is lost/corrupted, each catalog also has a "simple name" that's stored along with the UUID. This is also stored on each asset, next to the catalog UUID. #### Writing to Disk Before saving asset catalogs to disk, the to-be-overwritten file gets inspected. Any new catalogs that are found thre are loaded to memory before writing the catalogs back to disk: - Changed catalog path: in-memory data wins - Catalogs deleted on disk: they are recreated based on in-memory data - Catalogs deleted in memory: deleted on disk as well - New catalogs on disk: are loaded and thus survive the overwriting #### Tree Design This implements the initial tree structure to load catalogs into. See T90608, and the basic design in T90066. Reviewed By: Severin Maniphest Tasks: T91552 Differential Revision: https://developer.blender.org/D12589
2021-09-21UUIDs: rename UUID to bUUIDSybren A. Stüvel
Rename the `UUID` struct to `bUUID`. This avoids a symbol clash on Windows, which also defines `UUID`. This only pops up when a `UUID` field is used in the DNA code, which is why it wasn't a problem before (it will be once D12589 lands). No functional changes.
2021-09-21Cleanup: mention `UUID_STRING_LEN` in commentSybren A. Stüvel
Mention that `UUID_STRING_LEN` exists in the documentation of `BLI_uuid_format()`. No functional changes.
2021-09-20Cleanup: spelling (correct c5c8c68eec93e57ed46be4371d8831e2f0fe3fe2)Campbell Barton
"iff" was intended as "if and only if". while exact use of abbreviations isn't clear cut, I assumed this was a typo & it's not used anywhere else in source/, expand to "only if" (suggested by Sybren).
2021-09-20UUID: add nil value for UUIDsSybren A. Stüvel
Add `BLI_uuid_nil()` that returns the nil UUID (used to indicate "not set") and `BLI_uuid_is_nil(uuid)` to do an equality test with the nil value.
2021-09-20Cleanup: spellingCampbell Barton
2021-09-17Blenlib: introduce a UUID typeSybren A. Stüvel
Add `BLI_uuid` and `DNA_uuid_types.h` with a UUID implementation following RFC4122 (https://datatracker.ietf.org/doc/html/rfc4122.html). The following features are implemented: - A struct of 128 bits that can be used in DNA definitions. - Generation of version 4 UUIDs, that is, purely random ones. - UUID equality function. - String to UUID and UUID to string conversion functions that are compatible with RFC4122. - C++ stream operator that outputs the UUID as string. This UUID will be used by the asset system, to uniquely identify asset catalogs. Reviewed By: Severin, jacqueslucke Differential Revision: https://developer.blender.org/D12475