Blender Git Loki

Git Commits -> Revision 9733e90

Revision 9733e90 by Elia Sarti (master)
January 24, 2010, 10:51 (GMT)
RNA functions

Fixed and completed support for returning multiple values. This includes support for returning arrays, both fixed and dynamically sized. The way this is achieved is by storing an additional int value next to the dynamic parameter in the ParameterList stack which gets passed to the C function as an additional parameter. In the case of return parameters it is duty of the C function to set this int to the correct length value for the dynamic parameter (which makes sense). Note that for the dynamic output/return parameter it is assumed the function has allocated that memory (which gets freed automatically).

Also, I cleaned the makesrna's bridge function generation code a bit and renamed PROP_RETURN to PROP_OUTPUT, which represents better the reality now that there are multiple returns. The function now to mark multiple returns (outputs) is RNA_def_function_output.

For an example, look at Action.get_frame_range in rna_action_api.c, by the way Aligorith I removed the #ifdef for this function now that there's support for returning arrays, feel free to modify (the function seems to work).

Commit Details:

Full Hash: 9733e902a51e5b6ea42ea9ff28569b36ce9a307e
SVN Revision: 26223
Parent Commit: 7c21eb7
Lines Changed: +220, -100

14 Modified Paths:

/source/blender/makesrna/intern/makesrna.c (+80, -41) (Diff)
/source/blender/makesrna/intern/rna_access.c (+55, -6) (Diff)
/source/blender/makesrna/intern/rna_action_api.c (+7, -12) (Diff)
/source/blender/makesrna/intern/rna_define.c (+26, -4) (Diff)
/source/blender/makesrna/intern/rna_internal.h (+1, -0) (Diff)
/source/blender/makesrna/intern/rna_object_api.c (+3, -3) (Diff)
/source/blender/makesrna/intern/rna_rna.c (+1, -1) (Diff)
/source/blender/makesrna/intern/rna_scene_api.c (+1, -1) (Diff)
/source/blender/makesrna/RNA_access.h (+4, -0) (Diff)
/source/blender/makesrna/RNA_define.h (+1, -1) (Diff)
/source/blender/makesrna/RNA_types.h (+1, -1) (Diff)
/source/blender/python/intern/bpy_array.c (+7, -5) (Diff)
/source/blender/python/intern/bpy_rna.c (+31, -23) (Diff)
/source/blender/python/intern/bpy_rna.h (+2, -2) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021