From 62138aaa5a7f931fa2ddb4815f755413111cceb0 Mon Sep 17 00:00:00 2001 From: Arystanbek Dyussenov Date: Sun, 6 Sep 2009 15:13:57 +0000 Subject: 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 --- source/blender/makesrna/intern/rna_internal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/makesrna/intern/rna_internal.h') diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 13cc2ae9017..7de80843f27 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -157,6 +157,7 @@ void RNA_def_sensor(struct BlenderRNA *brna); void RNA_def_sequence(struct BlenderRNA *brna); void RNA_def_smoke(struct BlenderRNA *brna); void RNA_def_space(struct BlenderRNA *brna); +void RNA_def_test(struct BlenderRNA *brna); void RNA_def_text(struct BlenderRNA *brna); void RNA_def_texture(struct BlenderRNA *brna); void RNA_def_timeline_marker(struct BlenderRNA *brna); -- cgit v1.2.3