diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-08 17:01:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-08 17:01:31 +0300 |
commit | 9e0921497912cbfe9846358d1cb1220f88315f80 (patch) | |
tree | 093e2de27514b297de63ce6ea1597401507622ab /source/blender/makesdna/DNA_ID.h | |
parent | cfd11af9819433c5b83359b72f002fcd59fdc1ab (diff) |
PyAPI: add bpy.types.BlendFile.temp_data for temporary library loading
This adds support for creating a `BlendFile` (internally called `Main`),
which is limited to a context.
Temporary data can now be created which can then use
`.libraries.load()` the same as with `bpy.data`.
To prevent errors caused by mixing the temporary ID's with data in
`bpy.data` they are tagged as temporary so they can't be assigned
to properties, however they can be passed as arguments to functions.
Reviewed By: mont29, sybren
Ref D10612
Diffstat (limited to 'source/blender/makesdna/DNA_ID.h')
-rw-r--r-- | source/blender/makesdna/DNA_ID.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 14f0fef5270..c708219cfe8 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -566,6 +566,12 @@ enum { /* RESET_AFTER_USE Used by undo system to tag unchanged IDs re-used from old Main (instead of * read from memfile). */ LIB_TAG_UNDO_OLD_ID_REUSED = 1 << 19, + + /* This ID is part of a temporary #Main which is expected to be freed in a short time-frame. + * Don't allow assigning this to non-temporary members (since it's likely to cause errors). + * When set #ID.session_uuid isn't initialized, since the data isn't part of the session. */ + LIB_TAG_TEMP_MAIN = 1 << 20, + }; /* Tag given ID for an update in all the dependency graphs. */ |