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:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-01-05 18:56:37 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-01-05 18:56:37 +0400
commite8b415bdb4ba282e3574cad1463bf2512fe5eb8f (patch)
tree42d45b749f9442393ef08e41a1c98bc3e4978872 /source/blender/python/generic/py_capi_utils.h
parent5ee3cd6c86391e78a6905d1aa9c5241f623dcfc1 (diff)
This patch adds support in bpy.props for getter/setter callback functions. We already have update callbacks, but generic get/set functions can come in handy in some cases where the functionality is too complex to use a single value.
The current C callback functions are too simple allow a straightforward implementation, in particular they don't receive the PropertyRNA pointer itself as an argument, which means the callback cannot directly access the PropertyRNA's py_data pointers which store the python function objects. For this reason a second runtime variant of these callbacks has been added. It is only used for runtime callbacks and not in makesrna, but otherwise works the same way.
Diffstat (limited to 'source/blender/python/generic/py_capi_utils.h')
-rw-r--r--source/blender/python/generic/py_capi_utils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h
index db582bd7086..b4eea6ac90c 100644
--- a/source/blender/python/generic/py_capi_utils.h
+++ b/source/blender/python/generic/py_capi_utils.h
@@ -39,6 +39,8 @@ void PyC_FileAndNum(const char **filename, int *lineno);
void PyC_FileAndNum_Safe(const char **filename, int *lineno); /* checks python is running */
int PyC_AsArray(void *array, PyObject *value, const Py_ssize_t length,
const PyTypeObject *type, const short is_double, const char *error_prefix);
+PyObject * PyC_FromArray(const void *array, int length, const PyTypeObject *type,
+ const short is_double, const char *error_prefix);
/* follow http://www.python.org/dev/peps/pep-0383/ */
PyObject * PyC_UnicodeFromByte(const char *str);