documentation - brief descriptions for bpy api files.

This commit is contained in:
Campbell Barton 2011-11-05 08:21:12 +00:00
parent 62f2218554
commit 2b939904ab
18 changed files with 77 additions and 10 deletions

@ -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 */

@ -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'
*/

@ -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>

@ -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.
*/
/* ****************************************** */

@ -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.
*/

@ -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.
*/

@ -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>

@ -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 */

@ -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.
*/

@ -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.
*/

@ -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);

@ -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);

@ -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>

@ -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>

@ -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.
*/

@ -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.
*/

@ -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')
*/

@ -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 */