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>2020-05-29 07:50:29 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-29 08:55:25 +0300
commit654fde2dd213e8799da09875eab961d5286b2452 (patch)
tree28ead63734dbde1f1f003f16c97781c0aaafc58c /source/blender/python/intern/bpy_rna_types_capi.c
parente115b7b06d325c00edae733f3eefd6dbab2dd89e (diff)
PyAPI: use bpy_rna_types_capi.c to set type methods
Remove use of '_bpy' as an intermediate module to store functions which were then assigned in bpy_types.py.
Diffstat (limited to 'source/blender/python/intern/bpy_rna_types_capi.c')
-rw-r--r--source/blender/python/intern/bpy_rna_types_capi.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna_types_capi.c b/source/blender/python/intern/bpy_rna_types_capi.c
index 10d6d7e8e32..5a2ba4a5cdb 100644
--- a/source/blender/python/intern/bpy_rna_types_capi.c
+++ b/source/blender/python/intern/bpy_rna_types_capi.c
@@ -33,8 +33,10 @@
#include "BLI_utildefines.h"
+#include "bpy_library.h"
#include "bpy_rna.h"
#include "bpy_rna_callback.h"
+#include "bpy_rna_id_collection.h"
#include "bpy_rna_types_capi.h"
#include "../generic/py_capi_utils.h"
@@ -46,6 +48,31 @@
#include "WM_api.h"
/* -------------------------------------------------------------------- */
+/** \name Blend Data
+ * \{ */
+
+static struct PyMethodDef pyrna_blenddata_methods[] = {
+ {NULL, NULL, 0, NULL}, /* #BPY_rna_id_collection_user_map_method_def */
+ {NULL, NULL, 0, NULL}, /* #BPY_rna_id_collection_batch_remove_method_def */
+ {NULL, NULL, 0, NULL}, /* #BPY_rna_id_collection_orphans_purge_method_def */
+ {NULL, NULL, 0, NULL},
+};
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Blend Data Libraries
+ * \{ */
+
+static struct PyMethodDef pyrna_blenddatalibraries_methods[] = {
+ {NULL, NULL, 0, NULL}, /* #BPY_library_load_method_def */
+ {NULL, NULL, 0, NULL}, /* #BPY_library_write_method_def */
+ {NULL, NULL, 0, NULL},
+};
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
/** \name Window Manager Clipboard Property
*
* Avoid using the RNA API because this value may change between checking it's length
@@ -164,7 +191,24 @@ static struct PyMethodDef pyrna_space_methods[] = {
void BPY_rna_types_extend_capi(void)
{
+ /* BlendData */
+ ARRAY_SET_ITEMS(pyrna_blenddata_methods,
+ BPY_rna_id_collection_user_map_method_def,
+ BPY_rna_id_collection_batch_remove_method_def,
+ BPY_rna_id_collection_orphans_purge_method_def);
+ BLI_assert(ARRAY_SIZE(pyrna_blenddata_methods) == 4);
+ pyrna_struct_type_extend_capi(&RNA_BlendData, pyrna_blenddata_methods, NULL);
+
+ /* BlendDataLibraries */
+ ARRAY_SET_ITEMS(
+ pyrna_blenddatalibraries_methods, BPY_library_load_method_def, BPY_library_write_method_def);
+ BLI_assert(ARRAY_SIZE(pyrna_blenddatalibraries_methods) == 3);
+ pyrna_struct_type_extend_capi(&RNA_BlendDataLibraries, pyrna_blenddatalibraries_methods, NULL);
+
+ /* Space */
pyrna_struct_type_extend_capi(&RNA_Space, pyrna_space_methods, NULL);
+
+ /* WindowManager */
pyrna_struct_type_extend_capi(
&RNA_WindowManager, pyrna_windowmanager_methods, pyrna_windowmanager_getset);
}