This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/makesrna/SConscript
Arystanbek Dyussenov 62138aaa5a 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
2009-09-06 15:13:57 +00:00

44 lines
911 B
Python

#!/usr/bin/python
Import ('env')
objs = []
o = SConscript('intern/SConscript')
objs += o
incs = '#/intern/guardedalloc ../blenkernel ../blenlib ../makesdna intern .'
incs += ' ../windowmanager ../editors/include ../imbuf'
incs += ' ../render/extern/include'
defs = []
if env['WITH_BF_OPENEXR']:
defs.append('WITH_OPENEXR')
if env['WITH_BF_OPENJPEG']:
defs.append('WITH_OPENJPEG')
if env['WITH_BF_DDS']:
defs.append('WITH_DDS')
if env['WITH_BF_FFMPEG']:
defs.append('WITH_FFMPEG')
incs += ' ' + env['BF_FFMPEG_INC']
if env['WITH_BF_OGG']:
defs.append('WITH_OGG')
if env['WITH_BF_QUICKTIME']:
defs.append('WITH_QUICKTIME')
if env['WITH_BF_LCMS']:
defs.append('WITH_LCMS')
if env['WITH_BF_GAMEENGINE']:
defs.append('GAMEBLENDER=1')
if env['BF_UNIT_TEST']:
defs.append('UNIT_TEST')
env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core','player'], priority = [165,20] )