RNA C++ API improvements
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 22 Oct 2012 17:34:16 +0000 (17:34 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 22 Oct 2012 17:34:16 +0000 (17:34 +0000)
Added support of such features, as:

- Ability to call RNA functions using C++ classes
  For example RenderEngine.tag_update

- Property setters (for scalars and arrays)
  Used Qt/jQuery-like getters/setters style, meaning Class.prop() is a getter,
  Class.prop(value) is a setter.

Still to come:

Collection functions are not currently registering inside a property
Meaning BlendData.meshes wouldn't be a subclass of BlendDataMeshes result
you'll need to explicitly create BlendDataMeshes for now instead of doing
BlendData.meshes.remove()

intern/cycles/blender/blender_session.cpp
intern/cycles/blender/blender_util.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_scene_api.c

index 3fdd4418eb664707bf6ef4670fd8fc2245ce4923..05db9f55380686e577cf52d05bf91ee81c5c929b 100644 (file)
@@ -178,15 +178,12 @@ static PassType get_pass_type(BL::RenderPass b_pass)
 
 static BL::RenderResult begin_render_result(BL::RenderEngine b_engine, int x, int y, int w, int h, const char *layername)
 {
-       RenderResult *rrp = RE_engine_begin_result((RenderEngine*)b_engine.ptr.data, x, y, w, h, layername);
-       PointerRNA rrptr;
-       RNA_pointer_create(NULL, &RNA_RenderResult, rrp, &rrptr);
-       return BL::RenderResult(rrptr);
+       return b_engine.begin_result(x, y, w, h, layername);
 }
 
 static void end_render_result(BL::RenderEngine b_engine, BL::RenderResult b_rr, bool cancel = false)
 {
-       RE_engine_end_result((RenderEngine*)b_engine.ptr.data, (RenderResult*)b_rr.ptr.data, (int)cancel);
+       b_engine.end_result(b_rr, (int)cancel);
 }
 
 void BlenderSession::do_write_update_render_tile(RenderTile& rtile, bool do_update_only)
@@ -335,16 +332,16 @@ void BlenderSession::do_write_update_render_result(BL::RenderResult b_rr, BL::Re
 
                        /* copy pixels */
                        if(buffers->get_pass_rect(pass_type, exposure, rtile.sample, components, &pixels[0]))
-                               rna_RenderPass_rect_set(&b_pass.ptr, &pixels[0]);
+                               b_pass.rect(&pixels[0]);
                }
        }
 
        /* copy combined pass */
        if(buffers->get_pass_rect(PASS_COMBINED, exposure, rtile.sample, 4, &pixels[0]))
-               rna_RenderLayer_rect_set(&b_rlay.ptr, &pixels[0]);
+               b_rlay.rect(&pixels[0]);
 
        /* tag result as updated */
-       RE_engine_update_result((RenderEngine*)b_engine.ptr.data, (RenderResult*)b_rr.ptr.data);
+       b_engine.update_result(b_rr);
 }
 
 void BlenderSession::write_render_result(BL::RenderResult b_rr, BL::RenderLayer b_rlay, RenderTile& rtile)
@@ -496,11 +493,11 @@ void BlenderSession::update_status_progress()
                status += " | " + substatus;
 
        if(status != last_status) {
-               RE_engine_update_stats((RenderEngine*)b_engine.ptr.data, "", (timestatus + status).c_str());
+               b_engine.update_stats("", (timestatus + status).c_str());
                last_status = status;
        }
        if(progress != last_progress) {
-               RE_engine_update_progress((RenderEngine*)b_engine.ptr.data, progress);
+               b_engine.update_progress(progress);
                last_progress = progress;
        }
 }
@@ -508,7 +505,7 @@ void BlenderSession::update_status_progress()
 void BlenderSession::tag_update()
 {
        /* tell blender that we want to get another update callback */
-       engine_tag_update((RenderEngine*)b_engine.ptr.data);
+       b_engine.tag_update();
 }
 
 void BlenderSession::tag_redraw()
@@ -520,13 +517,13 @@ void BlenderSession::tag_redraw()
 
                /* offline render, redraw if timeout passed */
                if(time_dt() - last_redraw_time > 1.0) {
-                       engine_tag_redraw((RenderEngine*)b_engine.ptr.data);
+                       b_engine.tag_redraw();
                        last_redraw_time = time_dt();
                }
        }
        else {
                /* tell blender that we want to redraw */
-               engine_tag_redraw((RenderEngine*)b_engine.ptr.data);
+               b_engine.tag_redraw();
        }
 }
 
@@ -534,7 +531,7 @@ void BlenderSession::test_cancel()
 {
        /* test if we need to cancel rendering */
        if(background)
-               if(RE_engine_test_break((RenderEngine*)b_engine.ptr.data))
+               if(b_engine.test_break())
                        session->progress.set_cancel("Cancelled");
 }
 
index da8f30ea169745d056cd1dfc1f1c2b3f00fc91f0..079320e909ca5be7513610c99243c8663e919f9f 100644 (file)
  * todo: clean this up ... */
 
 extern "C" {
-
-struct RenderEngine;
-struct RenderResult;
-
-ID *rna_Object_to_mesh(void *_self, void *reports, void *scene, int apply_modifiers, int settings);
-void rna_Main_meshes_remove(void *bmain, void *reports, void *mesh);
-void rna_Object_create_duplilist(void *ob, void *reports, void *sce, int settings);
-void rna_Object_free_duplilist(void *ob);
-void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values);
-void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values);
-struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h, const char *layername);
-void RE_engine_update_result(struct RenderEngine *engine, struct RenderResult *result);
-void RE_engine_end_result(struct RenderEngine *engine, struct RenderResult *result, int cancel);
-int RE_engine_test_break(struct RenderEngine *engine);
-void RE_engine_update_stats(struct RenderEngine *engine, const char *stats, const char *info);
-void RE_engine_update_progress(struct RenderEngine *engine, float progress);
-void engine_tag_redraw(void *engine);
-void engine_tag_update(void *engine);
-int rna_Object_is_modified(void *ob, void *scene, int settings);
-int rna_Object_is_deform_modified(void *ob, void *scene, int settings);
 void BLI_timestr(double _time, char *str);
-void rna_ColorRamp_eval(void *coba, float position, float color[4]);
-void rna_Scene_frame_set(void *scene, int frame, float subframe);
 void BKE_image_user_frame_calc(void *iuser, int cfra, int fieldnr);
 void BKE_image_user_file_path(void *iuser, void *ima, char *path);
 }
@@ -61,10 +39,7 @@ CCL_NAMESPACE_BEGIN
 
 static inline BL::Mesh object_to_mesh(BL::Object self, BL::Scene scene, bool apply_modifiers, bool render)
 {
-       ID *data = rna_Object_to_mesh(self.ptr.data, NULL, scene.ptr.data, apply_modifiers, (render)? 2: 1);
-       PointerRNA ptr;
-       RNA_id_pointer_create(data, &ptr);
-       return BL::Mesh(ptr);
+       return self.to_mesh(NULL, scene, apply_modifiers, (render)? 2: 1);
 }
 
 static inline void colorramp_to_array(BL::ColorRamp ramp, float4 *data, int size)
@@ -72,34 +47,37 @@ static inline void colorramp_to_array(BL::ColorRamp ramp, float4 *data, int size
        for(int i = 0; i < size; i++) {
                float color[4];
 
-               rna_ColorRamp_eval(ramp.ptr.data, i/(float)(size-1), color);
+               ramp.evaluate(i/(float)(size-1), color);
                data[i] = make_float4(color[0], color[1], color[2], color[3]);
        }
 }
 
 static inline void object_remove_mesh(BL::BlendData data, BL::Mesh mesh)
 {
-       rna_Main_meshes_remove(data.ptr.data, NULL, mesh.ptr.data);
+       /* TODO: BlendData.meshes ideally should be also a subclass of BlendDataMeshes */
+       BL::BlendDataMeshes mesh_data(data.ptr);
+
+       mesh_data.remove(NULL, mesh);
 }
 
 static inline void object_create_duplilist(BL::Object self, BL::Scene scene)
 {
-       rna_Object_create_duplilist(self.ptr.data, NULL, scene.ptr.data, 2);
+       self.dupli_list_create(NULL, scene, 2);
 }
 
 static inline void object_free_duplilist(BL::Object self)
 {
-       rna_Object_free_duplilist(self.ptr.data);
+       self.dupli_list_clear();
 }
 
 static inline bool BKE_object_is_modified(BL::Object self, BL::Scene scene, bool preview)
 {
-       return rna_Object_is_modified(self.ptr.data, scene.ptr.data, (preview)? (1<<0): (1<<1))? true: false;
+       return self.is_modified(scene, (preview)? (1<<0): (1<<1))? true: false;
 }
 
 static inline bool BKE_object_is_deform_modified(BL::Object self, BL::Scene scene, bool preview)
 {
-       return rna_Object_is_deform_modified(self.ptr.data, scene.ptr.data, (preview)? (1<<0): (1<<1))? true: false;
+       return self.is_deform_modified(scene, (preview)? (1<<0): (1<<1))? true: false;
 }
 
 static inline string image_user_file_path(BL::ImageUser iuser, BL::Image ima, int cfra)
@@ -112,7 +90,7 @@ static inline string image_user_file_path(BL::ImageUser iuser, BL::Image ima, in
 
 static inline void scene_frame_set(BL::Scene scene, int frame)
 {
-       rna_Scene_frame_set(scene.ptr.data, frame, 0.0f);
+       scene.frame_set(frame, 0.0f);
 }
 
 /* Utilities */
index fb4e739b8abdc9351585e7f60153488aa9983b61..d30ef97fa8ee19a6213126ec8ac2212e6bad74ea 100644 (file)
@@ -61,7 +61,6 @@
 /* Replace if different */
 #define TMP_EXT ".tmp"
 
-
 /* copied from BLI_file_older */
 #include <sys/stat.h>
 static int file_older(const char *file1, const char *file2)
@@ -76,6 +75,22 @@ static int file_older(const char *file1, const char *file2)
 }
 static const char *makesrna_path = NULL;
 
+/* forward declarations */
+static void rna_generate_static_parameter_prototypes(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc,
+                                                     const char *name_override, int close_prototype);
+
+/* helpers */
+#define WRITE_COMMA { \
+               if (!first) \
+                       fprintf(f, ", "); \
+               first = 0; \
+       } (void)0
+
+#define WRITE_PARAM(param) { \
+               WRITE_COMMA; \
+               fprintf(f, param); \
+       }
+
 static int replace_if_different(char *tmpfile, const char *dep_files[])
 {
        /* return 0;  *//* use for testing had edited rna */
@@ -212,6 +227,8 @@ static const char *rna_safe_id(const char *id)
                return "default_value";
        else if (strcmp(id, "operator") == 0)
                return "operator_value";
+       else if (strcmp(id, "new") == 0)
+               return "create";
 
        return id;
 }
@@ -322,13 +339,26 @@ static void rna_print_id_get(FILE *f, PropertyDefRNA *UNUSED(dp))
        fprintf(f, "    ID *id= ptr->id.data;\n");
 }
 
+static void rna_construct_function_name(char *buffer, int size, const char *structname, const char *propname, const char *type)
+{
+       snprintf(buffer, size, "%s_%s_%s", structname, propname, type);
+}
+
+static void rna_construct_wrapper_function_name(char *buffer, int size, const char *structname, const char *propname, const char *type)
+{
+       if (type == NULL || type[0] == '\0')
+               snprintf(buffer, size, "%s_%s", structname, propname);
+       else
+               snprintf(buffer, size, "%s_%s_%s", structname, propname, type);
+}
+
 static char *rna_alloc_function_name(const char *structname, const char *propname, const char *type)
 {
        AllocDefRNA *alloc;
        char buffer[2048];
        char *result;
 
-       snprintf(buffer, sizeof(buffer), "%s_%s_%s", structname, propname, type);
+       rna_construct_function_name(buffer, sizeof(buffer), structname, propname, type);
        result = MEM_callocN(sizeof(char) * strlen(buffer) + 1, "rna_alloc_function_name");
        strcpy(result, buffer);
 
@@ -1440,15 +1470,15 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
                {
                        if (!prop->arraydimension) {
                                fprintf(f, "int %sget(PointerRNA *ptr);\n", func);
-                               /*fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func); */
+                               fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func);
                        }
                        else if (prop->arraydimension && prop->totarraylength) {
                                fprintf(f, "void %sget(PointerRNA *ptr, int values[%u]);\n", func, prop->totarraylength);
-                               /*fprintf(f, "void %sset(PointerRNA *ptr, const int values[%d]);\n", func, prop->arraylength); */
+                               fprintf(f, "void %sset(PointerRNA *ptr, const int values[%d]);\n", func, prop->totarraylength);
                        }
                        else {
                                fprintf(f, "void %sget(PointerRNA *ptr, int values[]);\n", func);
-                               /*fprintf(f, "void %sset(PointerRNA *ptr, const int values[]);\n", func); */
+                               fprintf(f, "void %sset(PointerRNA *ptr, const int values[]);\n", func);
                        }
                        break;
                }
@@ -1456,15 +1486,15 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
                {
                        if (!prop->arraydimension) {
                                fprintf(f, "float %sget(PointerRNA *ptr);\n", func);
-                               /*fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func); */
+                               fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func);
                        }
                        else if (prop->arraydimension && prop->totarraylength) {
                                fprintf(f, "void %sget(PointerRNA *ptr, float values[%u]);\n", func, prop->totarraylength);
-                               /*fprintf(f, "void %sset(PointerRNA *ptr, const float values[%d]);\n", func, prop->arraylength); */
+                               fprintf(f, "void %sset(PointerRNA *ptr, const float values[%d]);\n", func, prop->totarraylength);
                        }
                        else {
                                fprintf(f, "void %sget(PointerRNA *ptr, float values[]);\n", func);
-                               /*fprintf(f, "void %sset(PointerRNA *ptr, const float values[]);\n", func); */
+                               fprintf(f, "void %sset(PointerRNA *ptr, const float values[]);", func);
                        }
                        break;
                }
@@ -1485,7 +1515,7 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
                        }
 
                        fprintf(f, "int %sget(PointerRNA *ptr);\n", func);
-                       /*fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func); */
+                       fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func);
 
                        break;
                }
@@ -1499,7 +1529,7 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
                        
                        fprintf(f, "void %sget(PointerRNA *ptr, char *value);\n", func);
                        fprintf(f, "int %slength(PointerRNA *ptr);\n", func);
-                       /*fprintf(f, "void %sset(PointerRNA *ptr, const char *value);\n", func); */
+                       fprintf(f, "void %sset(PointerRNA *ptr, const char *value);\n", func);
 
                        break;
                }
@@ -1521,9 +1551,24 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
                }
        }
 
+       if (prop->getlength) {
+               char funcname[2048];
+               rna_construct_wrapper_function_name(funcname, sizeof(funcname), srna->identifier, prop->identifier, "get_length");
+               fprintf(f, "int %s(PointerRNA *ptr, int *arraylen);\n", funcname);
+       }
+
        fprintf(f, "\n");
 }
 
+static void rna_def_function_funcs_header(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc)
+{
+       FunctionRNA *func = dfunc->func;
+       char funcname[2048];
+
+       rna_construct_wrapper_function_name(funcname, sizeof(funcname), srna->identifier, func->identifier, NULL);
+       rna_generate_static_parameter_prototypes(f, srna, dfunc, funcname, 1);
+}
+
 static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
 {
        PropertyRNA *prop;
@@ -1543,26 +1588,50 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
        switch (prop->type) {
                case PROP_BOOLEAN:
                {
-                       if (!prop->arraydimension)
-                               fprintf(f, "\tinline bool %s(void);", rna_safe_id(prop->identifier));
-                       else if (prop->totarraylength)
-                               fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
+                       if (!prop->arraydimension) {
+                               fprintf(f, "\tinline bool %s(void);\n", rna_safe_id(prop->identifier));
+                               fprintf(f, "\tinline void %s(int value);", rna_safe_id(prop->identifier));
+                       }
+                       else if (prop->totarraylength) {
+                               fprintf(f, "\tinline Array<int, %u> %s(void);\n", prop->totarraylength, rna_safe_id(prop->identifier));
+                               fprintf(f, "\tinline void %s(int values[%u]);", rna_safe_id(prop->identifier), prop->totarraylength);
+                       }
+                       else if (prop->getlength) {
+                               fprintf(f, "\tinline DynamicArray<int> %s(void);\n", rna_safe_id(prop->identifier));
+                               fprintf(f, "\tinline void %s(int values[]);", rna_safe_id(prop->identifier));
+                       }
                        break;
                }
                case PROP_INT:
                {
-                       if (!prop->arraydimension)
-                               fprintf(f, "\tinline int %s(void);", rna_safe_id(prop->identifier));
-                       else if (prop->totarraylength)
-                               fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
+                       if (!prop->arraydimension) {
+                               fprintf(f, "\tinline int %s(void);\n", rna_safe_id(prop->identifier));
+                               fprintf(f, "\tinline void %s(int value);", rna_safe_id(prop->identifier));
+                       }
+                       else if (prop->totarraylength) {
+                               fprintf(f, "\tinline Array<int, %u> %s(void);\n", prop->totarraylength, rna_safe_id(prop->identifier));
+                               fprintf(f, "\tinline void %s(int values[%u]);", rna_safe_id(prop->identifier), prop->totarraylength);
+                       }
+                       else if (prop->getlength) {
+                               fprintf(f, "\tinline DynamicArray<int> %s(void);\n", rna_safe_id(prop->identifier));
+                               fprintf(f, "\tinline void %s(int values[]);", rna_safe_id(prop->identifier));
+                       }
                        break;
                }
                case PROP_FLOAT:
                {
-                       if (!prop->arraydimension)
-                               fprintf(f, "\tinline float %s(void);", rna_safe_id(prop->identifier));
-                       else if (prop->totarraylength)
-                               fprintf(f, "\tinline Array<float, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
+                       if (!prop->arraydimension) {
+                               fprintf(f, "\tinline float %s(void);\n", rna_safe_id(prop->identifier));
+                               fprintf(f, "\tinline void %s(float value);", rna_safe_id(prop->identifier));
+                       }
+                       else if (prop->totarraylength) {
+                               fprintf(f, "\tinline Array<float, %u> %s(void);\n", prop->totarraylength, rna_safe_id(prop->identifier));
+                               fprintf(f, "\tinline void %s(float values[%u]);", rna_safe_id(prop->identifier), prop->totarraylength);
+                       }
+                       else if (prop->getlength) {
+                               fprintf(f, "\tinline DynamicArray<float> %s(void);\n", rna_safe_id(prop->identifier));
+                               fprintf(f, "\tinline void %s(float values[]);", rna_safe_id(prop->identifier));
+                       }
                        break;
                }
                case PROP_ENUM:
@@ -1581,7 +1650,8 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
                                fprintf(f, "\t};\n");
                        }
 
-                       fprintf(f, "\tinline %s_enum %s(void);", rna_safe_id(prop->identifier), rna_safe_id(prop->identifier));
+                       fprintf(f, "\tinline %s_enum %s(void);\n", rna_safe_id(prop->identifier), rna_safe_id(prop->identifier));
+                       fprintf(f, "\tinline void %s(%s_enum value);", rna_safe_id(prop->identifier), rna_safe_id(prop->identifier));
                        break;
                }
                case PROP_STRING:
@@ -1616,6 +1686,97 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
        fprintf(f, "\n");
 }
 
+static const char *rna_parameter_type_cpp_name(PropertyRNA *prop)
+{
+       if (prop->type == PROP_POINTER) {
+               /* for cpp api we need to use RNA structures names for pointers */
+               PointerPropertyRNA *pprop = (PointerPropertyRNA *) prop;
+
+               return (const char *) pprop->type;
+       }
+       else {
+               return rna_parameter_type_name(prop);
+       }
+}
+
+static void rna_def_struct_function_prototype_cpp(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc,
+                                                  const char *namespace, int close_prototype)
+{
+       PropertyDefRNA *dp;
+       FunctionRNA *func = dfunc->func;
+
+       int first = 1;
+       const char *retval_type = "void";
+
+       if (func->c_ret) {
+               dp = rna_find_parameter_def(func->c_ret);
+               retval_type = rna_parameter_type_cpp_name(dp->prop);
+       }
+
+       if (namespace && namespace[0])
+               fprintf(f, "\tinline %s %s::%s(", retval_type, namespace, rna_safe_id(func->identifier));
+       else
+               fprintf(f, "\tinline %s %s(", retval_type, rna_safe_id(func->identifier));
+
+       if (func->flag & FUNC_USE_MAIN)
+               WRITE_PARAM("void *main");
+
+       if (func->flag & FUNC_USE_CONTEXT)
+               WRITE_PARAM("Context C");
+
+       if (func->flag & FUNC_USE_REPORTS)
+               WRITE_PARAM("void *reports");
+
+       for (dp = dfunc->cont.properties.first; dp; dp = dp->next) {
+               int type, flag, pout;
+               const char *ptrstr;
+
+               if (dp->prop == func->c_ret)
+                       continue;
+
+               type = dp->prop->type;
+               flag = dp->prop->flag;
+               pout = (flag & PROP_OUTPUT);
+
+               if (type == PROP_POINTER)
+                       ptrstr = "";
+               else if (type == PROP_POINTER || dp->prop->arraydimension)
+                       ptrstr = "*";
+               else if (type == PROP_STRING && (flag & PROP_THICK_WRAP))
+                       ptrstr = "";
+               else
+                       ptrstr = pout ? "*" : "";
+
+               WRITE_COMMA;
+
+               if (flag & PROP_DYNAMIC)
+                       fprintf(f, "int %s%s_len, ", (flag & PROP_OUTPUT) ? "*" : "", dp->prop->identifier);
+
+               if (!(flag & PROP_DYNAMIC) && dp->prop->arraydimension)
+                       fprintf(f, "%s %s[%u]", rna_parameter_type_cpp_name(dp->prop),
+                               rna_safe_id(dp->prop->identifier), dp->prop->totarraylength);
+               else
+                       fprintf(f, "%s %s%s", rna_parameter_type_cpp_name(dp->prop),
+                               ptrstr, rna_safe_id(dp->prop->identifier));
+       }
+
+       fprintf(f, ")");
+       if (close_prototype)
+               fprintf(f, ";\n");
+}
+
+static void rna_def_struct_function_header_cpp(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc)
+{
+       FunctionRNA *func = dfunc->func;
+
+       if (!dfunc->call)
+               return;
+
+       fprintf(f, "\n\t/* %s */\n", func->description);
+
+       rna_def_struct_function_prototype_cpp(f, srna, dfunc, NULL, 1);
+}
+
 static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
 {
        PropertyRNA *prop;
@@ -1633,6 +1794,9 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
                        else if (prop->totarraylength)
                                fprintf(f, "\tBOOLEAN_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength,
                                        rna_safe_id(prop->identifier));
+                       else if (prop->getlength)
+                               fprintf(f, "\tBOOLEAN_DYNAMIC_ARRAY_PROPERTY(%s, %s)", srna->identifier,
+                                       rna_safe_id(prop->identifier));
                        break;
                }
                case PROP_INT:
@@ -1642,6 +1806,9 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
                        else if (prop->totarraylength)
                                fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength,
                                        rna_safe_id(prop->identifier));
+                       else if (prop->getlength)
+                               fprintf(f, "\tINT_DYNAMIC_ARRAY_PROPERTY(%s, %s)", srna->identifier,
+                                       rna_safe_id(prop->identifier));
                        break;
                }
                case PROP_FLOAT:
@@ -1651,6 +1818,9 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
                        else if (prop->totarraylength)
                                fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength,
                                        rna_safe_id(prop->identifier));
+                       else if (prop->getlength)
+                               fprintf(f, "\tFLOAT_DYNAMIC_ARRAY_PROPERTY(%s, %s)", srna->identifier,
+                                       rna_safe_id(prop->identifier));
                        break;
                }
                case PROP_ENUM:
@@ -1695,6 +1865,178 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
        fprintf(f, "\n");
 }
 
+static void rna_def_struct_function_call_impl_cpp(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc)
+{
+       PropertyDefRNA *dp;
+       StructDefRNA *dsrna;
+       FunctionRNA *func = dfunc->func;
+       char funcname[2048];
+
+       int first = 1;
+
+       rna_construct_wrapper_function_name(funcname, sizeof(funcname), srna->identifier, func->identifier, NULL);
+
+       fprintf(f, "%s(", funcname);
+
+       dsrna = rna_find_struct_def(srna);
+
+       if (func->flag & FUNC_USE_SELF_ID)
+               WRITE_PARAM("(::ID *) ptr.id.data");
+
+       if ((func->flag & FUNC_NO_SELF) == 0) {
+               WRITE_COMMA;
+               if (dsrna->dnaname) fprintf(f, "(::%s *) this->ptr.data", dsrna->dnaname);
+               else fprintf(f, "(::%s *) this->ptr.data", srna->identifier);
+       }
+
+       if (func->flag & FUNC_USE_MAIN)
+               WRITE_PARAM("(::Main *) main");
+
+       if (func->flag & FUNC_USE_CONTEXT)
+               WRITE_PARAM("(::bContext *) C.ptr.data");
+
+       if (func->flag & FUNC_USE_REPORTS)
+               WRITE_PARAM("(::ReportList *) reports");
+
+       dp = dfunc->cont.properties.first;
+       for (; dp; dp = dp->next) {
+               if (dp->prop == func->c_ret)
+                       continue;
+
+               WRITE_COMMA;
+
+               if (dp->prop->flag & PROP_DYNAMIC)
+                       fprintf(f, "%s_len, ", dp->prop->identifier);
+
+               if (dp->prop->type == PROP_POINTER)
+                       fprintf(f, "(::%s *) %s.ptr.data", rna_parameter_type_name(dp->prop), rna_safe_id(dp->prop->identifier));
+               else
+                       fprintf(f, "%s", rna_safe_id(dp->prop->identifier));
+       }
+
+       fprintf(f, ");\n");
+}
+
+static void rna_def_struct_function_impl_cpp(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc)
+{
+       PropertyDefRNA *dp;
+       PointerPropertyRNA *pprop;
+
+       FunctionRNA *func = dfunc->func;
+
+       if (!dfunc->call)
+               return;
+
+       rna_def_struct_function_prototype_cpp(f, srna, dfunc, srna->identifier, 0);
+
+       fprintf(f, " {\n");
+
+       if (func->c_ret) {
+               dp = rna_find_parameter_def(func->c_ret);
+
+               if (dp->prop->type == PROP_POINTER) {
+                       pprop = (PointerPropertyRNA *) dp->prop;
+
+                       fprintf(f, "\t\tPointerRNA ptr;\n");
+
+                       if ((dp->prop->flag & PROP_RNAPTR) == 0) {
+                               StructRNA *ret_srna = rna_find_struct((const char *) pprop->type);
+                               fprintf(f, "\t\t::%s *retdata = ", rna_parameter_type_name(dp->prop));
+                               rna_def_struct_function_call_impl_cpp(f, srna, dfunc);
+                               if (ret_srna->flag & STRUCT_ID)
+                                       fprintf(f, "\t\tRNA_id_pointer_create((::ID *) retdata, &ptr);\n");
+                               else
+                                       fprintf(f, "\t\tRNA_pointer_create(NULL, &RNA_%s, retdata, &ptr);\n", (const char *) pprop->type);
+                       }
+                       else {
+                               fprintf(f, "\t\tptr = ");
+                               rna_def_struct_function_call_impl_cpp(f, srna, dfunc);
+                       }
+
+                       fprintf(f, "\t\treturn %s(ptr);\n", (const char *) pprop->type);
+               }
+               else {
+                       fprintf(f, "\t\treturn ");
+                       rna_def_struct_function_call_impl_cpp(f, srna, dfunc);
+               }
+       }
+       else {
+               fprintf(f, "\t\t");
+               rna_def_struct_function_call_impl_cpp(f, srna, dfunc);
+       }
+
+       fprintf(f, "\t}\n\n");
+}
+
+static void rna_def_property_wrapper_funcs(FILE *f, StructDefRNA *dsrna, PropertyDefRNA *dp)
+{
+       if (dp->prop->getlength) {
+               char funcname[2048];
+               rna_construct_wrapper_function_name(funcname, sizeof(funcname), dsrna->srna->identifier, dp->prop->identifier, "get_length");
+               fprintf(f, "int %s(PointerRNA *ptr, int *arraylen)\n", funcname);
+               fprintf(f, "{\n");
+               fprintf(f, "\treturn %s(ptr, arraylen);\n", rna_function_string(dp->prop->getlength));
+               fprintf(f, "}\n\n");
+       }
+}
+
+static void rna_def_function_wrapper_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA *dfunc)
+{
+       StructRNA *srna = dsrna->srna;
+       FunctionRNA *func = dfunc->func;
+       PropertyDefRNA *dparm;
+
+       int first;
+       char funcname[2048];
+
+       if (!dfunc->call)
+               return;
+
+       rna_construct_wrapper_function_name(funcname, sizeof(funcname), srna->identifier, func->identifier, NULL);
+
+       rna_generate_static_parameter_prototypes(f, srna, dfunc, funcname, 0);
+
+       fprintf(f, "\n{\n");
+
+       if (func->c_ret)
+               fprintf(f, "\treturn %s(", dfunc->call);
+       else
+               fprintf(f, "\t%s(", dfunc->call);
+
+       first = 1;
+
+       if (func->flag & FUNC_USE_SELF_ID)
+               WRITE_PARAM("_selfid");
+
+       if ((func->flag & FUNC_NO_SELF) == 0)
+               WRITE_PARAM("_self");
+
+       if (func->flag & FUNC_USE_MAIN)
+               WRITE_PARAM("bmain");
+
+       if (func->flag & FUNC_USE_CONTEXT)
+               WRITE_PARAM("C");
+
+       if (func->flag & FUNC_USE_REPORTS)
+               WRITE_PARAM("reports");
+
+       dparm = dfunc->cont.properties.first;
+       for (; dparm; dparm = dparm->next) {
+               if (dparm->prop == func->c_ret)
+                       continue;
+
+               WRITE_COMMA;
+
+               if (dparm->prop->flag & PROP_DYNAMIC)
+                       fprintf(f, "%s_len, %s", dparm->prop->identifier, dparm->prop->identifier);
+               else
+                       fprintf(f, "%s", rna_safe_id(dparm->prop->identifier));
+       }
+
+       fprintf(f, ");\n");
+       fprintf(f, "}\n\n");
+}
+
 static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA *dfunc)
 {
        StructRNA *srna;
@@ -2110,7 +2452,7 @@ static void rna_generate_function_prototypes(BlenderRNA *brna, StructRNA *srna,
                fprintf(f, "\n");
 }
 
-static void rna_generate_static_parameter_prototypes(BlenderRNA *UNUSED(brna), StructRNA *srna, FunctionDefRNA *dfunc, FILE *f)
+static void rna_generate_static_parameter_prototypes(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc, const char *name_override, int close_prototype)
 {
        FunctionRNA *func;
        PropertyDefRNA *dparm;
@@ -2141,7 +2483,10 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *UNUSED(brna), S
                fprintf(f, "void ");
 
        /* function name */
-       fprintf(f, "%s(", dfunc->call);
+       if (name_override == NULL || name_override[0] == '\0')
+               fprintf(f, "%s(", dfunc->call);
+       else
+               fprintf(f, "%s(", name_override);
 
        first = 1;
 
@@ -2150,7 +2495,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *UNUSED(brna), S
                fprintf(f, "struct ID *_selfid");
                first = 0;
        }
-       
+
        if ((func->flag & FUNC_NO_SELF) == 0) {
                if (!first) fprintf(f, ", ");
                if (dsrna->dnaname) fprintf(f, "struct %s *_self", dsrna->dnaname);
@@ -2203,17 +2548,19 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *UNUSED(brna), S
 
                if (!(flag & PROP_DYNAMIC) && dparm->prop->arraydimension)
                        fprintf(f, "%s%s %s[%u]", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop),
-                               dparm->prop->identifier, dparm->prop->totarraylength);
+                               rna_safe_id(dparm->prop->identifier), dparm->prop->totarraylength);
                else
                        fprintf(f, "%s%s %s%s", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop),
-                               ptrstr, dparm->prop->identifier);
+                               ptrstr, rna_safe_id(dparm->prop->identifier));
 
        }
 
-       fprintf(f, ");\n");
+       fprintf(f, ")");
+       if (close_prototype)
+               fprintf(f, ";\n");
 }
 
-static void rna_generate_static_function_prototypes(BlenderRNA *brna, StructRNA *srna, FILE *f)
+static void rna_generate_static_function_prototypes(BlenderRNA *UNUSED(brna), StructRNA *srna, FILE *f)
 {
        FunctionRNA *func;
        FunctionDefRNA *dfunc;
@@ -2228,7 +2575,52 @@ static void rna_generate_static_function_prototypes(BlenderRNA *brna, StructRNA
                                first = 0;
                        }
 
-                       rna_generate_static_parameter_prototypes(brna, srna, dfunc, f);
+                       rna_generate_static_parameter_prototypes(f, srna, dfunc, NULL, 1);
+               }
+       }
+
+       fprintf(f, "\n");
+}
+
+static void rna_generate_struct_prototypes(FILE *f, StructRNA *srna)
+{
+       StructDefRNA *ds;
+       PropertyDefRNA *dp;
+       FunctionDefRNA *dfunc;
+       const char *structures[2048];
+       int all_structures = 0;
+
+       /* structures definitions */
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+               srna = ds->srna;
+
+               for (dfunc = ds->functions.first; dfunc; dfunc = dfunc->cont.next) {
+                       if (dfunc->call) {
+                               for (dp = dfunc->cont.properties.first; dp; dp = dp->next) {
+                                       if (dp->prop->type == PROP_POINTER) {
+                                               int a, found = 0;
+                                               const char *struct_name = rna_parameter_type_name(dp->prop);
+
+                                               for (a = 0; a < all_structures; a++) {
+                                                       if (strcmp(struct_name, structures[a]) == 0) {
+                                                               found = 1;
+                                                               break;
+                                                       }
+                                               }
+
+                                               if (found == 0) {
+                                                       fprintf(f, "struct %s;\n", struct_name);
+
+                                                       if (all_structures >= sizeof(structures) / sizeof(structures[0])) {
+                                                               printf("Array size to store all structures names is too small\n");
+                                                               exit(1);
+                                                       }
+
+                                                       structures[all_structures++] = struct_name;
+                                               }
+                                       }
+                               }
+                       }
                }
        }
 
@@ -2794,8 +3186,13 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
 
        for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
                if (!filename || ds->filename == filename) {
-                       for (dfunc = ds->functions.first; dfunc; dfunc = dfunc->cont.next)
+                       for (dp = ds->cont.properties.first; dp; dp = dp->next)
+                               rna_def_property_wrapper_funcs(f, ds, dp);
+
+                       for (dfunc = ds->functions.first; dfunc; dfunc = dfunc->cont.next) {
+                               rna_def_function_wrapper_funcs(f, ds, dfunc);
                                rna_def_function_funcs(f, ds, dfunc);
+                       }
 
                        rna_generate_static_function_prototypes(brna, ds->srna, f);
                }
@@ -2819,6 +3216,7 @@ static void rna_generate_header(BlenderRNA *UNUSED(brna), FILE *f)
        StructDefRNA *ds;
        PropertyDefRNA *dp;
        StructRNA *srna;
+       FunctionDefRNA *dfunc;
 
        fprintf(f, "\n#ifndef __RNA_BLENDER_H__\n");
        fprintf(f, "#define __RNA_BLENDER_H__\n\n");
@@ -2856,6 +3254,9 @@ static void rna_generate_header(BlenderRNA *UNUSED(brna), FILE *f)
 
                for (dp = ds->cont.properties.first; dp; dp = dp->next)
                        rna_def_property_funcs_header(f, ds->srna, dp);
+
+               for (dfunc = ds->functions.first; dfunc; dfunc = dfunc->cont.next)
+                       rna_def_function_funcs_header(f, ds->srna, dfunc);
        }
 
        fprintf(f, "#ifdef __cplusplus\n}\n#endif\n\n");
@@ -2871,28 +3272,68 @@ static const char *cpp_classes = ""
 "namespace BL {\n"
 "\n"
 "#define BOOLEAN_PROPERTY(sname, identifier) \\\n"
-"      inline bool sname::identifier(void) { return sname##_##identifier##_get(&ptr)? true: false; }\n"
+"      inline bool sname::identifier(void) { return sname##_##identifier##_get(&ptr)? true: false; } \\\n"
+"      inline void sname::identifier(int value) { sname##_##identifier##_set(&ptr, value); }\n"
 "\n"
 "#define BOOLEAN_ARRAY_PROPERTY(sname, size, identifier) \\\n"
 "      inline Array<int,size> sname::identifier(void) \\\n"
-"              { Array<int, size> ar; sname##_##identifier##_get(&ptr, ar.data); return ar; }\n"
+"              { Array<int, size> ar; sname##_##identifier##_get(&ptr, ar.data); return ar; } \\\n"
+"      inline void sname::identifier(int values[size]) \\\n"
+"              { sname##_##identifier##_set(&ptr, values); } \\\n"
+"\n"
+"#define BOOLEAN_DYNAMIC_ARRAY_PROPERTY(sname, identifier) \\\n"
+"      inline DynamicArray<int> sname::identifier(void) { \\\n"
+"              int arraylen[3]; \\\n"
+"              int len = sname##_##identifier##_get_length(&ptr, arraylen); \\\n"
+"              DynamicArray<int> ar(len); \\\n"
+"              sname##_##identifier##_get(&ptr, ar.data); \\\n"
+"              return ar; } \\\n"
+"      inline void sname::identifier(int values[]) \\\n"
+"              { sname##_##identifier##_set(&ptr, values); } \\\n"
 "\n"
 "#define INT_PROPERTY(sname, identifier) \\\n"
-"      inline int sname::identifier(void) { return sname##_##identifier##_get(&ptr); }\n"
+"      inline int sname::identifier(void) { return sname##_##identifier##_get(&ptr); } \\\n"
+"      inline void sname::identifier(int value) { sname##_##identifier##_set(&ptr, value); }\n"
 "\n"
 "#define INT_ARRAY_PROPERTY(sname, size, identifier) \\\n"
 "      inline Array<int,size> sname::identifier(void) \\\n"
-"              { Array<int, size> ar; sname##_##identifier##_get(&ptr, ar.data); return ar; }\n"
+"              { Array<int, size> ar; sname##_##identifier##_get(&ptr, ar.data); return ar; } \\\n"
+"      inline void sname::identifier(int values[size]) \\\n"
+"              { sname##_##identifier##_set(&ptr, values); } \\\n"
+"\n"
+"#define INT_DYNAMIC_ARRAY_PROPERTY(sname, identifier) \\\n"
+"      inline DynamicArray<int> sname::identifier(void) { \\\n"
+"              int arraylen[3]; \\\n"
+"              int len = sname##_##identifier##_get_length(&ptr, arraylen); \\\n"
+"              DynamicArray<int> ar(len); \\\n"
+"              sname##_##identifier##_get(&ptr, ar.data); \\\n"
+"              return ar; } \\\n"
+"      inline void sname::identifier(int values[]) \\\n"
+"              { sname##_##identifier##_set(&ptr, values); } \\\n"
 "\n"
 "#define FLOAT_PROPERTY(sname, identifier) \\\n"
-"      inline float sname::identifier(void) { return sname##_##identifier##_get(&ptr); }\n"
+"      inline float sname::identifier(void) { return sname##_##identifier##_get(&ptr); } \\\n"
+"      inline void sname::identifier(float value) { sname##_##identifier##_set(&ptr, value); }\n"
 "\n"
 "#define FLOAT_ARRAY_PROPERTY(sname, size, identifier) \\\n"
 "      inline Array<float,size> sname::identifier(void) \\\n"
-"              { Array<float, size> ar; sname##_##identifier##_get(&ptr, ar.data); return ar; }\n"
+"              { Array<float, size> ar; sname##_##identifier##_get(&ptr, ar.data); return ar; } \\\n"
+"      inline void sname::identifier(float values[size]) \\\n"
+"              { sname##_##identifier##_set(&ptr, values); } \\\n"
+"\n"
+"#define FLOAT_DYNAMIC_ARRAY_PROPERTY(sname, identifier) \\\n"
+"      inline DynamicArray<float> sname::identifier(void) { \\\n"
+"              int arraylen[3]; \\\n"
+"              int len = sname##_##identifier##_get_length(&ptr, arraylen); \\\n"
+"              DynamicArray<float> ar(len); \\\n"
+"              sname##_##identifier##_get(&ptr, ar.data); \\\n"
+"              return ar; } \\\n"
+"      inline void sname::identifier(float values[]) \\\n"
+"              { sname##_##identifier##_set(&ptr, values); } \\\n"
 "\n"
 "#define ENUM_PROPERTY(type, sname, identifier) \\\n"
-"      inline sname::type sname::identifier(void) { return (type)sname##_##identifier##_get(&ptr); }\n"
+"      inline sname::type sname::identifier(void) { return (type)sname##_##identifier##_get(&ptr); } \\\n"
+"      inline void sname::identifier(sname::type value) { sname##_##identifier##_set(&ptr, value); }\n"
 "\n"
 "#define STRING_PROPERTY(sname, identifier) \\\n"
 "      inline std::string sname::identifier(void) { \\\n"
@@ -2926,7 +3367,7 @@ static const char *cpp_classes = ""
 "public:\n"
 "      T data[Tsize];\n"
 "\n"
-"   Array() {}\n"
+"      Array() {}\n"
 "      Array(const Array<T, Tsize>& other) { memcpy(data, other.data, sizeof(T) * Tsize); }\n"
 "      const Array<T, Tsize>& operator=(const Array<T, Tsize>& other) { memcpy(data, other.data, sizeof(T) * Tsize); "
 "return *this; }\n"
@@ -2934,6 +3375,30 @@ static const char *cpp_classes = ""
 "      operator T*() { return data; }\n"
 "};\n"
 "\n"
+"template<typename T>\n"
+"class DynamicArray {\n"
+"public:\n"
+"      T *data;\n"
+"      int length;\n"
+"\n"
+"      DynamicArray() : data(NULL), length(0) {}\n"
+"      DynamicArray(int new_length) : data(NULL), length(new_length) { data = (float*)malloc(sizeof(T) * new_length); }\n"
+"      DynamicArray(const DynamicArray<T>& other) { copy_from(other); }\n"
+"      const DynamicArray<T>& operator=(const DynamicArray<T>& other) { copy_from(other); return *this; }\n"
+"\n"
+"      ~DynamicArray() { if(data) free(data); }\n"
+"\n"
+"      operator T*() { return data; }\n"
+"\n"
+"protected:\n"
+"      void copy_from(const DynamicArray<T>& other) {\n"
+"              if(data) free(data);\n"
+"              data = (float*)malloc(sizeof(T) * other.length);\n"
+"              memcpy(data, other.data, sizeof(T) * other.length);\n"
+"              length = other.length;\n"
+"      }\n"
+"};\n"
+"\n"
 "typedef void (*TBeginFunc)(CollectionPropertyIterator *iter, PointerRNA *ptr);\n"
 "typedef void (*TNextFunc)(CollectionPropertyIterator *iter);\n"
 "typedef void (*TEndFunc)(CollectionPropertyIterator *iter);\n"
@@ -2987,6 +3452,7 @@ static void rna_generate_header_cpp(BlenderRNA *UNUSED(brna), FILE *f)
        StructDefRNA *ds;
        PropertyDefRNA *dp;
        StructRNA *srna;
+       FunctionDefRNA *dfunc;
 
        fprintf(f, "\n#ifndef __RNA_BLENDER_CPP_H__\n");
        fprintf(f, "#define __RNA_BLENDER_CPP_H__\n\n");
@@ -3024,17 +3490,39 @@ static void rna_generate_header_cpp(BlenderRNA *UNUSED(brna), FILE *f)
 
                for (dp = ds->cont.properties.first; dp; dp = dp->next)
                        rna_def_property_funcs_header_cpp(f, ds->srna, dp);
+
+               fprintf(f, "\n");
+               for (dfunc = ds->functions.first; dfunc; dfunc = dfunc->cont.next)
+                       rna_def_struct_function_header_cpp(f, srna, dfunc);
+
                fprintf(f, "};\n\n");
        }
 
+       fprintf(f, "} /* namespace BL */\n");
 
+       fprintf(f, "\n");
        fprintf(f, "/**************** Implementation ****************/\n");
+       fprintf(f, "\n");
+
+       fprintf(f, "/* Structure prototypes */\n\n");
+       fprintf(f, "extern \"C\" {\n");
+       rna_generate_struct_prototypes(f, srna);
+       fprintf(f, "}\n\n");
+
+       fprintf(f, "namespace BL {\n");
 
        for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+               srna = ds->srna;
+
                for (dp = ds->cont.properties.first; dp; dp = dp->next)
                        rna_def_property_funcs_impl_cpp(f, ds->srna, dp);
 
                fprintf(f, "\n");
+
+               for (dfunc = ds->functions.first; dfunc; dfunc = dfunc->cont.next)
+                       rna_def_struct_function_impl_cpp(f, srna, dfunc);
+
+               fprintf(f, "\n");
        }
 
        fprintf(f, "}\n\n#endif /* __RNA_BLENDER_CPP_H__ */\n\n");
index d898a5ac5c7e6dd5f799a000bf56393b068fbfc8..c5f1ac748fabe240b6d5e33e438adf77b39db7a3 100644 (file)
@@ -314,7 +314,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
        }
 }
 
-void rna_ColorRamp_eval(struct ColorBand *coba, float position, float color[4])
+static void rna_ColorRamp_eval(struct ColorBand *coba, float position, float color[4])
 {
        do_colorband(coba, position, color);
 }
index ffc78ef8ca4d9187c8368d6182989f7647c1568e..6520f22fbf56adab482622e935da59748989e3fc 100644 (file)
@@ -407,19 +407,8 @@ int rna_IDMaterials_assign_int(struct PointerRNA *ptr, int key, const struct Poi
 
 
 /* Internal functions that cycles uses so we need to declare (tsk tsk) */
-struct Mesh *rna_Object_to_mesh(struct Object *ob, struct ReportList *reports, struct Scene *sce, int apply_modifiers, int settings);
-void rna_Main_meshes_remove(struct Main *bmain, struct ReportList *reports, struct Mesh *mesh);
-void rna_Object_create_duplilist(struct Object *ob, struct ReportList *reports, struct Scene *sce, int settings);
-void rna_Object_free_duplilist(struct Object *ob);
 void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values);
 void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values);
-int  rna_Object_is_modified(struct Object *ob, struct Scene *scene, int settings);
-int  rna_Object_is_deform_modified(struct Object *ob, struct Scene *scene, int settings);
-void rna_ColorRamp_eval(struct ColorBand *coba, float position, float color[4]);
-void rna_Scene_frame_set(struct Scene *scene, int frame, float subframe);
-
-void engine_tag_redraw(struct RenderEngine *engine);
-void engine_tag_update(struct RenderEngine *engine);
 
 #endif /* __RNA_INTERNAL_H__ */
 
index 329f1273588d441f98513cc018fd66d94078ca08..0da2693046f16910a21f5d39602b2552129062a4 100644 (file)
@@ -247,7 +247,7 @@ static Mesh *rna_Main_meshes_new(Main *UNUSED(bmain), const char *name)
        id_us_min(&me->id);
        return me;
 }
-void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh)
+static void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh)
 {
        if (ID_REAL_USERS(mesh) <= 0)
                BKE_libblock_free(&bmain->mesh, mesh);
index 3204dc8e6bc9904be12df3cb0bd9f82743017f34..b8d8f0fb190bfa43182af2c5f30f4670a92ef0a4 100644 (file)
@@ -74,7 +74,7 @@
 
 /* copied from Mesh_getFromObject and adapted to RNA interface */
 /* settings: 0 - preview, 1 - render */
-Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_modifiers, int settings)
+static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_modifiers, int settings)
 {
        Mesh *tmpmesh;
        Curve *tmpcu = NULL, *copycu;
@@ -340,7 +340,7 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e
                dupli_render_particle_set(scene, go->ob, level + 1, enable);
 }
 /* When no longer needed, duplilist should be freed with Object.free_duplilist */
-void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce, int settings)
+static void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce, int settings)
 {
        int for_render = settings == eModifierMode_Render;
 
@@ -364,7 +364,7 @@ void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce, in
        /* ob->duplilist should now be freed with Object.free_duplilist */
 }
 
-void rna_Object_free_duplilist(Object *ob)
+static void rna_Object_free_duplilist(Object *ob)
 {
        if (ob->duplilist) {
                free_object_duplilist(ob->duplilist);
@@ -522,12 +522,12 @@ static void rna_ObjectBase_layers_from_view(Base *base, View3D *v3d)
        base->lay = base->object->lay = v3d->lay;
 }
 
-int rna_Object_is_modified(Object *ob, Scene *scene, int settings)
+static int rna_Object_is_modified(Object *ob, Scene *scene, int settings)
 {
        return BKE_object_is_modified(scene, ob) & settings;
 }
 
-int rna_Object_is_deform_modified(Object *ob, Scene *scene, int settings)
+static int rna_Object_is_deform_modified(Object *ob, Scene *scene, int settings)
 {
        return BKE_object_is_deform_modified(scene, ob) & settings;
 }
index 736753894d16e254fa2fd05818dce4f34a5810a7..4b4018433b3c6d212fddcba1a5275d412656932d 100644 (file)
 
 /* RenderEngine Callbacks */
 
-void engine_tag_redraw(RenderEngine *engine)
+static void engine_tag_redraw(RenderEngine *engine)
 {
        engine->flag |= RE_ENGINE_DO_DRAW;
 }
 
-void engine_tag_update(RenderEngine *engine)
+static void engine_tag_update(RenderEngine *engine)
 {
        engine->flag |= RE_ENGINE_DO_UPDATE;
 }
index cdf7ac5e68fce2991f27a28fab76a00463b889a8..10efc7a94a7e6f02a02c34b21df02cff1d5f992a 100644 (file)
@@ -53,7 +53,7 @@
 
 
 
-void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
+static void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
 {
        scene->r.cfra = frame;
        scene->r.subframe = subframe;