Cleanup: Update description of BKE_id_is_editable.

Getting the owner ID of an embedded liboverride is not that expansive
anymore.

Also explain difference between this function and the new similar
`ID_IS_EDITABLE` macro.
This commit is contained in:
Bastien Montagne
2024-05-23 10:31:41 +02:00
parent 7fb1c4c573
commit feb09cbe62

View File

@@ -747,12 +747,8 @@ ID *BKE_id_owner_get(ID *id, const bool debug_relationship_assert = true);
/**
* Check if that ID can be considered as editable from a high-level (editor) perspective.
*
* NOTE: This used to be done with a check on whether ID was linked or not, but now with system
* overrides this is not enough anymore.
*
* NOTE: Execution of this function can be somewhat expensive currently. If this becomes an issue,
* we should either cache that status info also in virtual override IDs, or address the
* long-standing TODO of getting an efficient 'owner_id' access for all embedded ID types.
* \note Unlike the #ID_IS_EDITABLE macro, this also take into account higher-level aspects, e.g.
* it checks if the given ID is a system overrides (which should not be editable from the UI).
*/
bool BKE_id_is_editable(const Main *bmain, const ID *id);