Implemented dynamic and multidimensional array support in RNA.
authorArystanbek Dyussenov <arystan.d@gmail.com>
Tue, 25 Aug 2009 17:06:36 +0000 (17:06 +0000)
committerArystanbek Dyussenov <arystan.d@gmail.com>
Tue, 25 Aug 2009 17:06:36 +0000 (17:06 +0000)
commit706a4c22b54ede250fbdb2c2bd772c63cdbf7d09
treee9398918b950b98e3fa17741d67fe7b94915f89f
parent7288bacad9bbe5e670de3454c9a64dee0c3d920c
Implemented dynamic and multidimensional array support in RNA.

Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.

Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.

What this means for ID property access:

* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array

What this means for functions:

* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])

Python part is not complete yet, e.g. it is possible to:

MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad

but the following won't work:

MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
24 files changed:
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/fcurve.c
source/blender/editors/animation/anim_ipo_utils.c
source/blender/editors/animation/drivers.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_anim.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/space_outliner/outliner.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_define.h
source/blender/makesrna/RNA_types.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_internal_types.h
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_object.c
source/blender/python/intern/bpy_array.c [new file with mode: 0644]
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna.h