diff options
-rw-r--r-- | source/blender/python/intern/bpy.c | 8 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app_handlers.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_driver.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface_atexit.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_intern_string.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_library.c | 6 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_operator.c | 9 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_operator_wrap.c | 5 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 6 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 11 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna_anim.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna_array.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna_callback.c | 3 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_traceback.c | 3 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_util.c | 3 | ||||
-rw-r--r-- | source/blender/python/intern/gpu.c | 3 |
18 files changed, 77 insertions, 10 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index dfb7a1e8f75..2df907f3a12 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -22,11 +22,11 @@ /** \file blender/python/intern/bpy.c * \ingroup pythonintern + * + * This file defines the '_bpy' module which is used by python's 'bpy' package + * to access C defined builtin functions. + * A script writer should never directly access this module. */ - - -/* This file defines the '_bpy' module which is used by python's 'bpy' package. - * a script writer should never directly access this module */ #define WITH_PYTHON /* for AUD_PyInit.h, possibly others */ diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index cc3b88722b6..b5ae225fda7 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -22,6 +22,10 @@ /** \file blender/python/intern/bpy_app.c * \ingroup pythonintern + * + * This file defines a 'PyStructSequence' accessed via 'bpy.app', mostly + * exposing static applications variables such as version and buildinfo + * however some writable variables have been added such as 'debug' and 'tempdir' */ diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index f130a4bcc5c..edab92b295b 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -22,6 +22,10 @@ /** \file blender/python/intern/bpy_app_handlers.c * \ingroup pythonintern + * + * This file defines a 'PyStructSequence' accessed via 'bpy.app.handlers', + * which exposes various lists that the script author can add callback + * functions into (called via blenders generic BLI_cb api) */ #include <Python.h> diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index 0fe1d2d26ba..98b4786607f 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -22,6 +22,10 @@ /** \file blender/python/intern/bpy_driver.c * \ingroup pythonintern + * + * This file defines the 'BPY_driver_exec' to execute python drivers, + * called by the animation system, there are also some utility functions + * to deal with the namespace used for driver execution. */ /* ****************************************** */ diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index ea2266c99b4..ffa9e5cc27c 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -23,6 +23,10 @@ /** \file blender/python/intern/bpy_interface.c * \ingroup pythonintern + * + * This file deals with embedding the python interpreter within blender, + * starting and stopping python and exposing blender/python modules so they can + * be accesses from scripts. */ diff --git a/source/blender/python/intern/bpy_interface_atexit.c b/source/blender/python/intern/bpy_interface_atexit.c index aa5b934891c..a0cf3c38503 100644 --- a/source/blender/python/intern/bpy_interface_atexit.c +++ b/source/blender/python/intern/bpy_interface_atexit.c @@ -22,6 +22,10 @@ /** \file blender/python/intern/bpy_interface_atexit.c * \ingroup pythonintern + * + * This file inserts an exit callback into pythons 'atexit' module. + * Without this sys.exit() can crash because blender is not properly closing + * resources. */ diff --git a/source/blender/python/intern/bpy_intern_string.c b/source/blender/python/intern/bpy_intern_string.c index 32d329e11b3..4f206c4c365 100644 --- a/source/blender/python/intern/bpy_intern_string.c +++ b/source/blender/python/intern/bpy_intern_string.c @@ -22,6 +22,10 @@ /** \file blender/python/intern/bpy_intern_string.c * \ingroup pythonintern + * + * Store python versions of strings frequently used for python lookups + * to avoid converting, creating the hash and freeing every time as + * PyDict_GetItemString and PyObject_GetAttrString do. */ #include <Python.h> diff --git a/source/blender/python/intern/bpy_library.c b/source/blender/python/intern/bpy_library.c index 382a513f40a..54398f75a1d 100644 --- a/source/blender/python/intern/bpy_library.c +++ b/source/blender/python/intern/bpy_library.c @@ -22,6 +22,12 @@ /** \file blender/python/intern/bpy_library.c * \ingroup pythonintern + * + * This file exposed blend file library appending/linking to python, typically + * this would be done via RNA api but in this case a hand written python api + * allows us to use pythons context manager (__enter__ and __exit__). + * + * Everything here is exposed via bpy.data.libraries.load(...) context manager. */ /* nifty feature. swap out strings for RNA data */ diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 70a5d79e9ac..3fd4e8a128b 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -1,6 +1,4 @@ - /* - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -24,6 +22,13 @@ /** \file blender/python/intern/bpy_operator.c * \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. + * + * \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. */ diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index cb460f2fa08..aa458925202 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -22,6 +22,11 @@ /** \file blender/python/intern/bpy_operator_wrap.c * \ingroup pythonintern + * + * This file is so python can 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. */ diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index cfd2e5556a1..4dbaf5db4a4 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -22,6 +22,10 @@ /** \file blender/python/intern/bpy_props.c * \ingroup pythonintern + * + * This file defines 'bpy.props' module used so scripts can define their own + * rna properties for use with python operators or adding new properties to + * existing blender types. */ @@ -254,7 +258,7 @@ static int bpy_prop_callback_assign(struct PropertyRNA *prop, PyObject *update_c { /* assume this is already checked for type and arg length */ if (update_cb) { - PyObject **py_data= MEM_callocN(sizeof(PyObject *) * BPY_DATA_CB_SLOT_SIZE, "bpy_prop_callback_assign"); + PyObject **py_data= MEM_callocN(sizeof(PyObject *) * BPY_DATA_CB_SLOT_SIZE, __func__); RNA_def_property_update_runtime(prop, (void *)bpy_prop_update_cb); py_data[BPY_DATA_CB_SLOT_UPDATE]= update_cb; RNA_def_py_data(prop, py_data); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 3411bceda69..44e26a56db6 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -22,9 +22,14 @@ /** \file blender/python/intern/bpy_rna.c * \ingroup pythonintern + * + * This file is the main interface between python and blenders data api (RNA), + * exposing RNA to python so blender data can be accessed in a python like way. + * + * The two main types are 'BPy_StructRNA' and 'BPy_PropertyRNA' - the base + * classes for most of the data python accesses in blender. */ - #include <Python.h> #include <stddef.h> @@ -6470,7 +6475,9 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param const int is_operator= RNA_struct_is_a(ptr->type, &RNA_Operator); const char *func_id= RNA_function_identifier(func); /* testing, for correctness, not operator and not draw function */ - const short is_readonly= strstr("draw", func_id) || /*strstr("render", func_id) ||*/ !is_operator; + const short is_readonly= ((strncmp("draw", func_id, 4) ==0) || /* draw or draw_header */ + /*strstr("render", func_id) ||*/ + !is_operator); #endif py_class= RNA_struct_py_type_get(ptr->type); diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index 4ebb407f4d6..edc6e672238 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -22,6 +22,8 @@ /** \file blender/python/intern/bpy_rna_anim.c * \ingroup pythonintern + * + * This file defines the animation related methods used in bpy_rna.c */ #include <Python.h> diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index eda2511a187..73e9e0a44d9 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -15,13 +15,15 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * Contributor(s): Arystanbek Dyussenov + * Contributor(s): Arystanbek Dyussenov, Campbell Barton * * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/python/intern/bpy_rna_array.c * \ingroup pythonintern + * + * This file deals with array access for 'BPy_PropertyArrayRNA' from bpy_rna.c */ #include <Python.h> diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c index af6fc88097b..85f950947a7 100644 --- a/source/blender/python/intern/bpy_rna_callback.c +++ b/source/blender/python/intern/bpy_rna_callback.c @@ -22,6 +22,9 @@ /** \file blender/python/intern/bpy_rna_callback.c * \ingroup pythonintern + * + * This file currently exposes callbacks for interface regions but may be + * extended later. */ diff --git a/source/blender/python/intern/bpy_traceback.c b/source/blender/python/intern/bpy_traceback.c index aa21627a279..5045f6708b5 100644 --- a/source/blender/python/intern/bpy_traceback.c +++ b/source/blender/python/intern/bpy_traceback.c @@ -20,6 +20,9 @@ /** \file blender/python/intern/bpy_traceback.c * \ingroup pythonintern + * + * This file contains utility functions for getting data from a python stack + * trace. */ diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index bec3a07d32a..43ca4da7ae2 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -22,6 +22,9 @@ /** \file blender/python/intern/bpy_util.c * \ingroup pythonintern + * + * This file contains blender/python utility functions for the api's internal + * use (unrelated to 'bpy.utils') */ diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c index 1162491ee26..57ce7b59067 100644 --- a/source/blender/python/intern/gpu.c +++ b/source/blender/python/intern/gpu.c @@ -27,6 +27,9 @@ /** \file blender/python/intern/gpu.c * \ingroup pythonintern + * + * This file defines the 'gpu' module, used to get GLSL shader code and data + * from blender materials. */ /* python redefines */ |