Merge with -r 22620:23107.
[blender.git] / source / blender / makesrna / intern / makesrna.c
index d0c7824..0294107 100644 (file)
@@ -1237,6 +1237,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
        fprintf(f, "\tchar *_data");
        if(func->ret) fprintf(f, ", *_retdata");
        fprintf(f, ";\n");
+       if(func->ret && (func->ret->flag & PROP_DYNAMIC)) fprintf(f, "\tint _ret_array_length;\n");
        fprintf(f, "\t\n");
 
        /* assign self */
@@ -1291,6 +1292,12 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
                        fprintf(f, "reports");
                }
 
+               if(func->ret && (func->ret->flag & PROP_DYNAMIC)) {
+                       if(!first) fprintf(f, ", ");
+                       first= 0;
+                       fprintf(f, "&_ret_array_length");
+               }
+
                dparm= dfunc->cont.properties.first;
                for(; dparm; dparm= dparm->next) {
                        if(dparm->prop==func->ret)
@@ -1308,6 +1315,12 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
                        dparm= rna_find_parameter_def(func->ret);
                        ptrstr= (((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR)) || (dparm->prop->arraydimension))? "*": "";
                        fprintf(f, "\t*((%s%s%s*)_retdata)= %s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, func->ret->identifier);
+
+                       if(func->ret && (func->ret->flag & PROP_DYNAMIC)) {
+                               fprintf(f, "\t_parms->func->ret->arraylength[0]= _ret_array_length;\n");
+                               fprintf(f, "\t_parms->func->ret->totarraylength= _ret_array_length;\n");
+                               fprintf(f, "\t_parms->func->ret->arraydimension= 1;\n");
+                       }
                }
        }
 
@@ -1587,6 +1600,13 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA
                fprintf(f, "ReportList *reports");
        }
 
+       /* dynamic array length paramter */
+       if(func->ret && (func->ret->flag & PROP_DYNAMIC)) {
+               if(!first) fprintf(f, ", ");
+               first= 0;
+               fprintf(f, "int *array_length");
+       }
+
        /* defined parameters */
        for(dparm= dfunc->cont.properties.first; dparm; dparm= dparm->next) {
                if(dparm->prop==func->ret)
@@ -1969,7 +1989,7 @@ RNAProcessItem PROCESS_ITEMS[]= {
        {"rna_rna.c", NULL, RNA_def_rna},
        {"rna_ID.c", NULL, RNA_def_ID},
        {"rna_texture.c", NULL, RNA_def_texture},
-       {"rna_action.c", NULL, RNA_def_action},
+       {"rna_action.c", "rna_action_api.c", RNA_def_action},
        {"rna_animation.c", "rna_animation_api.c", RNA_def_animation},
        {"rna_actuator.c", NULL, RNA_def_actuator},
        {"rna_armature.c", NULL, RNA_def_armature},
@@ -1986,12 +2006,12 @@ RNAProcessItem PROCESS_ITEMS[]= {
        {"rna_fluidsim.c", NULL, RNA_def_fluidsim},
        {"rna_gpencil.c", NULL, RNA_def_gpencil},
        {"rna_group.c", NULL, RNA_def_group},
-       {"rna_image.c", NULL, RNA_def_image},
+       {"rna_image.c", "rna_image_api.c", RNA_def_image},
        {"rna_key.c", NULL, RNA_def_key},
        {"rna_lamp.c", NULL, RNA_def_lamp},
        {"rna_lattice.c", NULL, RNA_def_lattice},
        {"rna_main.c", "rna_main_api.c", RNA_def_main},
-       {"rna_material.c", NULL, RNA_def_material},
+       {"rna_material.c", "rna_material_api.c", RNA_def_material},
        {"rna_mesh.c", "rna_mesh_api.c", RNA_def_mesh},
        {"rna_meta.c", NULL, RNA_def_meta},
        {"rna_modifier.c", NULL, RNA_def_modifier},
@@ -2001,7 +2021,7 @@ RNAProcessItem PROCESS_ITEMS[]= {
        {"rna_object_force.c", NULL, RNA_def_object_force},
        {"rna_packedfile.c", NULL, RNA_def_packedfile},
        {"rna_particle.c", NULL, RNA_def_particle},
-       {"rna_pose.c", NULL, RNA_def_pose},
+       {"rna_pose.c", "rna_pose_api.c", RNA_def_pose},
        {"rna_property.c", NULL, RNA_def_gameproperty},
        {"rna_render.c", NULL, RNA_def_render},
        {"rna_scene.c", "rna_scene_api.c", RNA_def_scene},