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:
authorCampbell Barton <ideasman42@gmail.com>2021-03-08 17:01:31 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-03-08 17:01:31 +0300
commit9e0921497912cbfe9846358d1cb1220f88315f80 (patch)
tree093e2de27514b297de63ce6ea1597401507622ab /source/blender/blenloader/intern/versioning_250.c
parentcfd11af9819433c5b83359b72f002fcd59fdc1ab (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/blenloader/intern/versioning_250.c')
-rw-r--r--source/blender/blenloader/intern/versioning_250.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index 983fdce15f1..467fd8b0399 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -449,7 +449,9 @@ static void versions_gpencil_add_main(ListBase *lb, ID *id, const char *name)
BKE_id_new_name_validate(lb, id, name);
/* alphabetic insertion: is in BKE_id_new_name_validate */
- BKE_lib_libblock_session_uuid_ensure(id);
+ if ((id->tag & LIB_TAG_TEMP_MAIN) == 0) {
+ BKE_lib_libblock_session_uuid_ensure(id);
+ }
if (G.debug & G_DEBUG) {
printf("Converted GPencil to ID: %s\n", id->name + 2);