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>2009-03-11 20:28:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-03-11 20:28:37 +0300
commit64512d3e8e9f950b8249deb506eb243345dc107e (patch)
tree14c6d7ba33f8674b85aceede7730d91b871caae8 /source/blender/python/intern/bpy_rna.h
parent891c3bc663b0f1ece07bfd48e06853a9eedb6178 (diff)
WIP PyAPI from winter camp discussions, make subtypes of the base RNA python type, eventually allowing us to have python defined RNA classes in
python - lux/pov/renderman materials, lamps etc as well as operators. At the moment there are 2 ways to do this, The first is like subclassing from python, another (disabled) method copies the base PyTypeObject struct and makes some changes. The PyType is stored in the RNA Struct for reuse, right now there are no access functions - needs to be improved. Added a python script for printing all blend file data to the console which helps testing the api. dir(rna) wont work for python 2.x now, use rna.__dir__() instead.
Diffstat (limited to 'source/blender/python/intern/bpy_rna.h')
-rw-r--r--source/blender/python/intern/bpy_rna.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h
index fc16ad6ea9a..63a2be9a31a 100644
--- a/source/blender/python/intern/bpy_rna.h
+++ b/source/blender/python/intern/bpy_rna.h
@@ -36,6 +36,17 @@ extern PyTypeObject pyrna_prop_Type;
#define BPy_StructRNA_Check(v) (PyObject_TypeCheck(v, &pyrna_struct_Type))
#define BPy_PropertyRNA_Check(v) (PyObject_TypeCheck(v, &pyrna_prop_Type))
+ //XXX add propper accessor function, we know this is just after next/prev pointers
+
+ #define BPy_RNA_PYTYPE( _data ) (((BPy_StructFakeType *)(_data))->py_type)
+
+typedef struct {
+ void * _a;
+ void * _b;
+ PyTypeObject *py_type;
+} BPy_StructFakeType;
+
+
typedef struct {
PyObject_HEAD /* required python macro */
PointerRNA ptr;
@@ -50,6 +61,9 @@ typedef struct {
PyObject *BPY_rna_module( void );
PyObject *BPY_rna_doc( void );
+void BPY_rna_init_types( void );
+void BPY_rna_free_types( void );
+
PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr );
PyObject *pyrna_prop_CreatePyObject( PointerRNA *ptr, PropertyRNA *prop );