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:
Diffstat (limited to 'source/blender/makesdna/DNA_ID.h')
-rw-r--r--source/blender/makesdna/DNA_ID.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 5b7c99f2545..d829d707a71 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -392,7 +392,14 @@ typedef struct ID {
* that references this ID (the bones of an armature or the modifiers of an object for e.g.).
*/
void *py_instance;
- void *_pad1;
+
+ /**
+ * Weak reference to an ID in a given library file, used to allow re-using already appended data
+ * in some cases, instead of appending it again.
+ *
+ * May be NULL.
+ */
+ struct LibraryWeakReference *library_weak_reference;
} ID;
/**
@@ -426,6 +433,26 @@ typedef struct Library {
short versionfile, subversionfile;
} Library;
+/**
+ * A weak library/ID reference for local data that has been appended, to allow re-using that local
+ * data instead of creating a new copy of it in future appends.
+ *
+ * NOTE: This is by design a week reference, in other words code should be totally fine and perform
+ * a regular append if it cannot find a valid matching local ID.
+ *
+ * NOTE: There should always be only one single ID in current Main matching a given linked
+ * reference.
+ */
+typedef struct LibraryWeakReference {
+ /** Expected to match a `Library.filepath`. */
+ char library_filepath[1024];
+
+ /** MAX_ID_NAME. May be different from the current local ID name. */
+ char library_id_name[66];
+
+ char _pad[2];
+} LibraryWeakReference;
+
/* for PreviewImage->flag */
enum ePreviewImage_Flag {
PRV_CHANGED = (1 << 0),