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
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-10-21 13:55:15 +0300
committerBastien Montagne <bastien@blender.org>2021-10-21 13:55:15 +0300
commit641a5be50e03f4a7152dd37e97680bee26dc3e6f (patch)
tree171544b7a2c8e25ab1db5231e68e7ba615af7c86 /source/blender/blenkernel/BKE_lib_id.h
parent17a96051cf0f664509638bc31b714a4925b5052c (diff)
IDManagement: Add option to clear asset data when making ID local.
When appending an asset from the asset browser, its asset data needs to be cleared. However, linking an asset (or regular append from the file browser) should not clear such data. In linking case, it would be there again after a blend file reload anyway. So this commit introduces a new `BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR` option. NOTE: in case the appended ID needs to be copied from its linked data (instead of making the later directly local), asset data is lost anyway since it is never copied with the ID currently. Ref. {T91749} and D11768.
Diffstat (limited to 'source/blender/blenkernel/BKE_lib_id.h')
-rw-r--r--source/blender/blenkernel/BKE_lib_id.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h
index d2a8ec2e332..d79df4b2216 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -245,6 +245,10 @@ enum {
/** In case caller code already knows this ID should be made local using copying. */
LIB_ID_MAKELOCAL_FORCE_COPY = 1 << 2,
+ /** Clear asset data (in case the ID can actually be made local, in copy case asset data is never
+ * copied over). */
+ LIB_ID_MAKELOCAL_ASSET_DATA_CLEAR = 1 << 3,
+
/* Special type-specific options. */
/** For Objects, do not clear the proxy pointers while making the data-block local. */
LIB_ID_MAKELOCAL_OBJECT_NO_PROXY_CLEARING = 1 << 16,
@@ -271,13 +275,13 @@ void BKE_lib_id_swap(struct Main *bmain, struct ID *id_a, struct ID *id_b);
void BKE_lib_id_swap_full(struct Main *bmain, struct ID *id_a, struct ID *id_b);
void id_sort_by_name(struct ListBase *lb, struct ID *id, struct ID *id_sorting_hint);
-void BKE_lib_id_expand_local(struct Main *bmain, struct ID *id);
+void BKE_lib_id_expand_local(struct Main *bmain, struct ID *id, const int flags);
bool BKE_id_new_name_validate(struct ListBase *lb,
struct ID *id,
const char *name,
const bool do_linked_data) ATTR_NONNULL(1, 2);
-void BKE_lib_id_clear_library_data(struct Main *bmain, struct ID *id);
+void BKE_lib_id_clear_library_data(struct Main *bmain, struct ID *id, const int flags);
/* Affect whole Main database. */
void BKE_main_id_tag_idcode(struct Main *mainvar,