Commit Graph

6 Commits

Author SHA1 Message Date
Bastien Montagne 3fdae6e56d Core: LibQuery: Add a 'filter' callback to `BKE_lib_query_unused_ids` Api.
This will allow for more control over which ID should actually be marked
as unused/to be deleted.

Also some general minor cleanups and refactor, most notably:
* Add a constructor to internal `UnusedIDsData` struct, which can
  directly use the public `LibQueryUnusedIDsData` parameters struct.
* Add default values to trivial data in `LibQueryUnusedIDsData`.

No expected behavioral changes in this commit.
2024-02-21 15:01:20 +01:00
Bastien Montagne df0efda0d6 Refactor: IDTypeInfo: Add info about 'potentially used IDTypes'.
This data was 'hidden' away in a util in
`lib_query.cc`, which made it hard to discover and keep up-to-date.

However, as shown by e.g. #108407, critical low-level features in ID
management code, such as remapping, now rely on this information being
valid.

Also simplify `BKE_library_id_can_use_filter_id` and
`BKE_library_id_can_use_idtype` to make them more generic, relying on
IDTypeInfo to retrieve IDtype-specific info.

No behavioral changes expected here.
2024-02-15 19:45:10 +01:00
Hans Goudey 5ba6f6d833 Cleanup: Replace typedef keyword in C++ headers 2024-02-13 15:34:32 -05:00
Bastien Montagne 09a2688684 Refactor `BKE_lib_query_unused_ids` API.
Add a new `BKE_lib_query_unused_ids_amounts` to query expected amounts
of deleted IDs. This function does not tag IDs in main anymore.

Factorize most parameters (and output data) into a new struct
`LibQueryUnusedIDsData`.

Part of PR https://projects.blender.org/blender/blender/pulls/117304.
2024-02-09 17:01:31 +01:00
Hans Goudey 69d2dd0731 Cleanup: Remove unnecessary keywords in C++ headers 2024-01-30 14:56:04 -05:00
Bastien Montagne 03c1cc4310 Cleanup: Move `BKE_lib_query` header to Cpp era. 2024-01-18 12:21:19 +01:00