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-15 03:27:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-03-15 06:48:17 +0300
commit042f06ef3cd8d2c39593258c5bc4198d647f573b (patch)
treede9a9c320c15b3eb15cab3bf8356fd77096721b4 /source/blender/python
parentc23da7a5c9079702a33ea2309d9ee1d714481237 (diff)
Cleanup: update comments, remove ifdef'd code
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_operator.c10
-rw-r--r--source/blender/python/intern/bpy_operator_wrap.c10
2 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 967eece4bcb..94ad6a8ef78 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -17,12 +17,12 @@
/** \file
* \ingroup pythonintern
*
- * This file defines '_bpy.ops', an internal python module which gives python
- * the ability to inspect and call both C and Python defined operators.
+ * This file defines `_bpy.ops`, an internal python module which gives Python
+ * the ability to inspect and call operators (defined by C or Python).
*
* \note
- * This module is exposed to the user via 'release/scripts/modules/bpy/ops.py'
- * which fakes exposing operators as modules/functions using its own classes.
+ * This C module is private, it should only be used by `release/scripts/modules/bpy/ops.py` which
+ * exposes operators as dynamically defined modules & callable objects to access all operators.
*/
#include <Python.h>
@@ -38,7 +38,7 @@
#include "bpy_capi_utils.h"
#include "bpy_operator.h"
#include "bpy_operator_wrap.h"
-#include "bpy_rna.h" /* for setting arg props only - pyrna_py_to_prop() */
+#include "bpy_rna.h" /* for setting argument properties & type method `get_rna_type`. */
#include "RNA_access.h"
#include "RNA_enum_types.h"
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c
index 5137f41d43a..c2d7257e458 100644
--- a/source/blender/python/intern/bpy_operator_wrap.c
+++ b/source/blender/python/intern/bpy_operator_wrap.c
@@ -17,7 +17,7 @@
/** \file
* \ingroup pythonintern
*
- * This file is so python can define operators that C can call into.
+ * This file exposes functionality for defining to define operators that C can call into.
* The generic callback functions for python operators are defines in
* 'rna_wm.c', some calling into functions here to do python specific
* functionality.
@@ -115,6 +115,10 @@ static void operator_properties_init(wmOperatorType *ot)
/* end 'ot->prop' assignment */
}
+/**
+ * Generic function used by all Python defined operators
+ * it's passed as an argument to #WM_operatortype_append_ptr in for operator registration.
+ */
void BPY_RNA_operator_wrapper(wmOperatorType *ot, void *userdata)
{
/* take care not to overwrite anything set in
@@ -131,6 +135,10 @@ void BPY_RNA_operator_wrapper(wmOperatorType *ot, void *userdata)
operator_properties_init(ot);
}
+/**
+ * Generic function used by all Python defined macro-operators
+ * it's passed as an argument to #WM_operatortype_append_ptr in for operator registration.
+ */
void BPY_RNA_operator_macro_wrapper(wmOperatorType *ot, void *userdata)
{
wmOperatorType *data = (wmOperatorType *)userdata;