diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-02 10:35:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-02 10:35:00 +0400 |
commit | ad0a176a228adb19ea0161584250e2216833a530 (patch) | |
tree | cd6178cdc9197ed40f90ffbcdaa8c3414315c2c8 /source/blender/python/intern/bpy_rna.h | |
parent | d172001ceef06c0479131b33f15a5e9e46251472 (diff) |
- new subclass for ID-Property based collections - this way add/remove/move functions will only be shown for types that support it.
- moved array attributes into array properties - saves 8 bytes per allocated non-array property.
Diffstat (limited to 'source/blender/python/intern/bpy_rna.h')
-rw-r--r-- | source/blender/python/intern/bpy_rna.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index 514784d5a4c..14c6ff4a1a3 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -55,11 +55,17 @@ typedef struct { PyObject_HEAD /* required python macro */ PointerRNA ptr; PropertyRNA *prop; +} BPy_PropertyRNA; + +typedef struct { + PyObject_HEAD /* required python macro */ + PointerRNA ptr; + PropertyRNA *prop; /* Arystan: this is a hack to allow sub-item r/w access like: face.uv[n][m] */ int arraydim; /* array dimension, e.g: 0 for face.uv, 2 for face.uv[n][m], etc. */ int arrayoffset; /* array first item offset, e.g. if face.uv is [4][2], arrayoffset for face.uv[n] is 2n */ -} BPy_PropertyRNA; +} BPy_PropertyArrayRNA; /* cheap trick */ #define BPy_BaseTypeRNA BPy_PropertyRNA @@ -96,7 +102,7 @@ int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, int pyrna_py_to_array_index(PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int index, PyObject *py, const char *error_prefix); PyObject *pyrna_py_from_array(PointerRNA *ptr, PropertyRNA *prop); -PyObject *pyrna_py_from_array_index(BPy_PropertyRNA *self, PointerRNA *ptr, PropertyRNA *prop, int index); +PyObject *pyrna_py_from_array_index(BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, int index); PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop); int pyrna_array_contains_py(PointerRNA *ptr, PropertyRNA *prop, PyObject *value); |