[Bf-blender-cvs] [af508a1e39c] blender2.8: Mark localized node trees and materials as such
Sergey Sharybin
noreply at git.blender.org
Tue May 1 10:24:39 CEST 2018
Commit: af508a1e39c002db8e07886e042378c12b8fc136
Author: Sergey Sharybin
Date: Mon Apr 30 17:52:45 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBaf508a1e39c002db8e07886e042378c12b8fc136
Mark localized node trees and materials as such
Makes it easier to see where the datablock is coming from.
===================================================================
M source/blender/blenkernel/intern/material.c
M source/blender/blenkernel/intern/node.c
M source/blender/makesdna/DNA_ID.h
===================================================================
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 39ad95e9183..2f2f2fb3599 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -199,7 +199,9 @@ Material *BKE_material_localize(Material *ma)
BLI_listbase_clear(&man->gpumaterial);
/* TODO Duplicate Engine Settings and set runtime to NULL */
-
+
+ man->id.tag |= LIB_TAG_LOCALIZED;
+
return man;
}
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index def8ea1d239..62c3bb5be35 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -2051,6 +2051,8 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
if (ntree->typeinfo->localize)
ntree->typeinfo->localize(ltree, ntree);
+ ltree->id.tag |= LIB_TAG_LOCALIZED;
+
BLI_mutex_unlock(ntree->duplilock);
return ltree;
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index daa4a3d9ca3..bcce2764eaf 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -457,16 +457,17 @@ enum {
/* RESET_AFTER_USE tag existing data before linking so we know what is new. */
LIB_TAG_PRE_EXISTING = 1 << 11,
- /* The datablock is a copy-on-write version. */
+ /* The datablock is a copy-on-write/localized version. */
LIB_TAG_COPY_ON_WRITE = 1 << 12,
LIB_TAG_COPY_ON_WRITE_EVAL = 1 << 13,
+ LIB_TAG_LOCALIZED = 1 << 14,
/* RESET_NEVER tag datablock for freeing etc. behavior (usually set when copying real one into temp/runtime one). */
- LIB_TAG_NO_MAIN = 1 << 14, /* Datablock is not listed in Main database. */
- LIB_TAG_NO_USER_REFCOUNT = 1 << 15, /* Datablock does not refcount usages of other IDs. */
+ LIB_TAG_NO_MAIN = 1 << 15, /* Datablock is not listed in Main database. */
+ LIB_TAG_NO_USER_REFCOUNT = 1 << 16, /* Datablock does not refcount usages of other IDs. */
/* Datablock was not allocated by standard system (BKE_libblock_alloc), do not free its memory
* (usual type-specific freeing is called though). */
- LIB_TAG_NOT_ALLOCATED = 1 << 16,
+ LIB_TAG_NOT_ALLOCATED = 1 << 17,
};
/* WARNING - when adding flags check on PSYS_RECALC */
More information about the Bf-blender-cvs
mailing list