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/python/intern/bpy.c | |
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/python/intern/bpy.c')
-rw-r--r-- | source/blender/python/intern/bpy.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 74fc8bcfec9..547cf2ad38f 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -44,6 +44,7 @@ #include "bpy_operator.h" #include "bpy_props.h" #include "bpy_rna.h" +#include "bpy_rna_data.h" #include "bpy_rna_gizmo.h" #include "bpy_rna_id_collection.h" #include "bpy_rna_types_capi.h" @@ -425,6 +426,8 @@ void BPy_init_modules(struct bContext *C) /* needs to be first so bpy_types can run */ BPY_library_load_type_ready(); + BPY_rna_data_context_type_ready(); + BPY_rna_gizmo_module(mod); bpy_import_test("bpy_types"); |