Blender Git Loki

Git Commits -> Revision 62138aa

Revision 62138aa by Arystanbek Dyussenov (master)
September 6, 2009, 15:13 (GMT)
Python part of multidim. array support for RNA complete.

Multidim. arrays can now be modified at any level, for example:

struc.arrayprop = x
struc.arrayprop[i] = x
struc.arrayprop[i][j] = x
struc.arrayprop[i][j][k] = x
etc...

Approriate rvalue type/length checking is done.

To ensure all works correctly, I wrote automated tests in release/test/rna_array.py.

These tests cover: array/item access, assignment on different levels, tests that proper exceptions are thrown on invalid item access/assignment.

The tests use properties of the RNA Test struct defined in rna_test.c. This struct is only compiled when building with BF_UNIT_TEST=1 scons arg.

Currently unit tests are run manually by loading the script in the Text Editor.
Here's the output I have: http://www.pasteall.org/7644

Things to improve here:
- better exception messages when multidim. array assignment fails. Those we have currently are not very useful for multidim.
- add tests for slice assignment

Commit Details:

Full Hash: 62138aaa5a7f931fa2ddb4815f755413111cceb0
SVN Revision: 23032
Parent Commit: 3d64d65
Lines Changed: +1038, -210

2 Added Paths:

/release/test/rna_array.py (+279, -0) (View)
/source/blender/makesrna/intern/rna_test.c (+188, -0) (View)

15 Modified Paths:

/source/blender/blenloader/intern/readblenentry.c (+2, -3) (Diff)
/source/blender/makesrna/intern/makesrna.c (+1, -0) (Diff)
/source/blender/makesrna/intern/rna_access.c (+31, -2) (Diff)
/source/blender/makesrna/intern/rna_define.c (+2, -0) (Diff)
/source/blender/makesrna/intern/rna_internal.h (+1, -0) (Diff)
/source/blender/makesrna/intern/rna_internal_types.h (+6, -2) (Diff)
/source/blender/makesrna/intern/rna_main.c (+24, -0) (Diff)
/source/blender/makesrna/intern/rna_mesh.c (+1, -1) (Diff)
/source/blender/makesrna/intern/SConscript (+3, -0) (Diff)
/source/blender/makesrna/RNA_access.h (+1, -0) (Diff)
/source/blender/makesrna/SConscript (+3, -0) (Diff)
/source/blender/python/intern/bpy_array.c (+330, -53) (Diff)
/source/blender/python/intern/bpy_rna.c (+152, -144) (Diff)
/source/blender/python/intern/bpy_rna.h (+10, -3) (Diff)
/tools/btools.py (+4, -2) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021