ID: Add run-time flag indicating that ID is coming from copy-on-write
This commit is contained in:
@@ -576,6 +576,7 @@ ID *deg_expand_copy_on_write_datablock(const Depsgraph *depsgraph,
|
||||
if (newid != NULL) {
|
||||
MEM_freeN(newid);
|
||||
}
|
||||
id_cow->tag |= LIB_TAG_COPY_ON_WRITE;
|
||||
return id_cow;
|
||||
}
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@ void IDDepsNode::init(const ID *id, const char *UNUSED(subdata))
|
||||
id_cow = (ID *)BKE_libblock_alloc_notest(GS(id->name));
|
||||
DEG_COW_PRINT("Create shallow copy for %s: id_orig=%p id_cow=%p\n",
|
||||
id_orig->name, id_orig, id_cow);
|
||||
id_cow->tag |= LIB_TAG_COPY_ON_WRITE;
|
||||
#else
|
||||
id_cow = id_orig;
|
||||
#endif
|
||||
|
||||
@@ -363,6 +363,9 @@ enum {
|
||||
LIB_TAG_ID_RECALC_DATA = 1 << 13,
|
||||
LIB_TAG_ANIM_NO_RECALC = 1 << 14,
|
||||
LIB_TAG_ID_RECALC_ALL = (LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA),
|
||||
|
||||
/* The datablock is a copy-on-write version. */
|
||||
LIB_TAG_COPY_ON_WRITE = (1 << 15),
|
||||
};
|
||||
|
||||
/* To filter ID types (filter_id) */
|
||||
|
||||
Reference in New Issue
Block a user