Blender V2.61 - r43446

rna_render.c

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * Contributor(s): Blender Foundation (2009)
00019  *
00020  * ***** END GPL LICENSE BLOCK *****
00021  */
00022 
00028 #include <stdlib.h>
00029 
00030 #include "DNA_scene_types.h"
00031 
00032 #include "RNA_define.h"
00033 #include "RNA_enum_types.h"
00034 
00035 #include "rna_internal.h"
00036 
00037 #include "RE_engine.h"
00038 #include "RE_pipeline.h"
00039 
00040 #include "BKE_utildefines.h"
00041 
00042 #ifdef RNA_RUNTIME
00043 
00044 #include "MEM_guardedalloc.h"
00045 
00046 #include "RNA_access.h"
00047 
00048 #include "BKE_context.h"
00049 #include "BKE_report.h"
00050 
00051 /* RenderEngine Callbacks */
00052 
00053 void engine_tag_redraw(RenderEngine *engine)
00054 {
00055     engine->flag |= RE_ENGINE_DO_DRAW;
00056 }
00057 
00058 void engine_tag_update(RenderEngine *engine)
00059 {
00060     engine->flag |= RE_ENGINE_DO_UPDATE;
00061 }
00062 
00063 static void engine_update(RenderEngine *engine, Main *bmain, Scene *scene)
00064 {
00065     extern FunctionRNA rna_RenderEngine_update_func;
00066     PointerRNA ptr;
00067     ParameterList list;
00068     FunctionRNA *func;
00069 
00070     RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
00071     func= &rna_RenderEngine_update_func;
00072 
00073     RNA_parameter_list_create(&list, &ptr, func);
00074     RNA_parameter_set_lookup(&list, "data", &bmain);
00075     RNA_parameter_set_lookup(&list, "scene", &scene);
00076     engine->type->ext.call(NULL, &ptr, func, &list);
00077 
00078     RNA_parameter_list_free(&list);
00079 }
00080 
00081 static void engine_render(RenderEngine *engine, struct Scene *scene)
00082 {
00083     extern FunctionRNA rna_RenderEngine_render_func;
00084     PointerRNA ptr;
00085     ParameterList list;
00086     FunctionRNA *func;
00087 
00088     RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
00089     func= &rna_RenderEngine_render_func;
00090 
00091     RNA_parameter_list_create(&list, &ptr, func);
00092     RNA_parameter_set_lookup(&list, "scene", &scene);
00093     engine->type->ext.call(NULL, &ptr, func, &list);
00094 
00095     RNA_parameter_list_free(&list);
00096 }
00097 
00098 static void engine_view_update(RenderEngine *engine, const struct bContext *context)
00099 {
00100     extern FunctionRNA rna_RenderEngine_view_update_func;
00101     PointerRNA ptr;
00102     ParameterList list;
00103     FunctionRNA *func;
00104 
00105     RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
00106     func= &rna_RenderEngine_view_update_func;
00107 
00108     RNA_parameter_list_create(&list, &ptr, func);
00109     RNA_parameter_set_lookup(&list, "context", &context);
00110     engine->type->ext.call(NULL, &ptr, func, &list);
00111 
00112     RNA_parameter_list_free(&list);
00113 }
00114 
00115 static void engine_view_draw(RenderEngine *engine, const struct bContext *context)
00116 {
00117     extern FunctionRNA rna_RenderEngine_view_draw_func;
00118     PointerRNA ptr;
00119     ParameterList list;
00120     FunctionRNA *func;
00121 
00122     RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
00123     func= &rna_RenderEngine_view_draw_func;
00124 
00125     RNA_parameter_list_create(&list, &ptr, func);
00126     RNA_parameter_set_lookup(&list, "context", &context);
00127     engine->type->ext.call(NULL, &ptr, func, &list);
00128 
00129     RNA_parameter_list_free(&list);
00130 }
00131 
00132 /* RenderEngine registration */
00133 
00134 static void rna_RenderEngine_unregister(Main *UNUSED(bmain), StructRNA *type)
00135 {
00136     RenderEngineType *et= RNA_struct_blender_type_get(type);
00137 
00138     if(!et)
00139         return;
00140     
00141     RNA_struct_free_extension(type, &et->ext);
00142     BLI_freelinkN(&R_engines, et);
00143     RNA_struct_free(&BLENDER_RNA, type);
00144 }
00145 
00146 static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
00147 {
00148     RenderEngineType *et, dummyet = {NULL};
00149     RenderEngine dummyengine= {NULL};
00150     PointerRNA dummyptr;
00151     int have_function[4];
00152 
00153     /* setup dummy engine & engine type to store static properties in */
00154     dummyengine.type= &dummyet;
00155     RNA_pointer_create(NULL, &RNA_RenderEngine, &dummyengine, &dummyptr);
00156 
00157     /* validate the python class */
00158     if(validate(&dummyptr, data, have_function) != 0)
00159         return NULL;
00160 
00161     if(strlen(identifier) >= sizeof(dummyet.idname)) {
00162         BKE_reportf(reports, RPT_ERROR, "registering render engine class: '%s' is too long, maximum length is %d",
00163                                         identifier, (int)sizeof(dummyet.idname));
00164         return NULL;
00165     }
00166 
00167     /* check if we have registered this engine type before, and remove it */
00168     for(et=R_engines.first; et; et=et->next) {
00169         if(strcmp(et->idname, dummyet.idname) == 0) {
00170             if(et->ext.srna)
00171                 rna_RenderEngine_unregister(bmain, et->ext.srna);
00172             break;
00173         }
00174     }
00175     
00176     /* create a new engine type */
00177     et= MEM_callocN(sizeof(RenderEngineType), "python render engine");
00178     memcpy(et, &dummyet, sizeof(dummyet));
00179 
00180     et->ext.srna= RNA_def_struct(&BLENDER_RNA, et->idname, "RenderEngine"); 
00181     et->ext.data= data;
00182     et->ext.call= call;
00183     et->ext.free= free;
00184     RNA_struct_blender_type_set(et->ext.srna, et);
00185 
00186     et->update= (have_function[0])? engine_update: NULL;
00187     et->render= (have_function[1])? engine_render: NULL;
00188     et->view_update= (have_function[2])? engine_view_update: NULL;
00189     et->view_draw= (have_function[3])? engine_view_draw: NULL;
00190 
00191     BLI_addtail(&R_engines, et);
00192 
00193     return et->ext.srna;
00194 }
00195 
00196 static void **rna_RenderEngine_instance(PointerRNA *ptr)
00197 {
00198     RenderEngine *engine = ptr->data;
00199     return &engine->py_instance;
00200 }
00201 
00202 static StructRNA* rna_RenderEngine_refine(PointerRNA *ptr)
00203 {
00204     RenderEngine *engine= (RenderEngine*)ptr->data;
00205     return (engine->type && engine->type->ext.srna)? engine->type->ext.srna: &RNA_RenderEngine;
00206 }
00207 
00208 static void rna_RenderResult_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
00209 {
00210     RenderResult *rr= (RenderResult*)ptr->data;
00211     rna_iterator_listbase_begin(iter, &rr->layers, NULL);
00212 }
00213 
00214 static void rna_RenderLayer_passes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
00215 {
00216     RenderLayer *rl= (RenderLayer*)ptr->data;
00217     rna_iterator_listbase_begin(iter, &rl->passes, NULL);
00218 }
00219 
00220 static int rna_RenderLayer_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
00221 {
00222     RenderLayer *rl= (RenderLayer*)ptr->data;
00223 
00224     length[0]= rl->rectx*rl->recty;
00225     length[1]= 4;
00226 
00227     return length[0]*length[1];
00228 }
00229 
00230 static void rna_RenderLayer_rect_get(PointerRNA *ptr, float *values)
00231 {
00232     RenderLayer *rl= (RenderLayer*)ptr->data;
00233     memcpy(values, rl->rectf, sizeof(float)*rl->rectx*rl->recty*4);
00234 }
00235 
00236 void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values)
00237 {
00238     RenderLayer *rl= (RenderLayer*)ptr->data;
00239     memcpy(rl->rectf, values, sizeof(float)*rl->rectx*rl->recty*4);
00240 }
00241 
00242 static int rna_RenderPass_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
00243 {
00244     RenderPass *rpass= (RenderPass*)ptr->data;
00245 
00246     length[0]= rpass->rectx*rpass->recty;
00247     length[1]= rpass->channels;
00248 
00249     return length[0]*length[1];
00250 }
00251 
00252 static void rna_RenderPass_rect_get(PointerRNA *ptr, float *values)
00253 {
00254     RenderPass *rpass= (RenderPass*)ptr->data;
00255     memcpy(values, rpass->rect, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels);
00256 }
00257 
00258 void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values)
00259 {
00260     RenderPass *rpass= (RenderPass*)ptr->data;
00261     memcpy(rpass->rect, values, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels);
00262 }
00263 
00264 #else // RNA_RUNTIME
00265 
00266 static void rna_def_render_engine(BlenderRNA *brna)
00267 {
00268     StructRNA *srna;
00269     PropertyRNA *prop;
00270     FunctionRNA *func;
00271     
00272     srna= RNA_def_struct(brna, "RenderEngine", NULL);
00273     RNA_def_struct_sdna(srna, "RenderEngine");
00274     RNA_def_struct_ui_text(srna, "Render Engine", "Render engine");
00275     RNA_def_struct_refine_func(srna, "rna_RenderEngine_refine");
00276     RNA_def_struct_register_funcs(srna, "rna_RenderEngine_register", "rna_RenderEngine_unregister", "rna_RenderEngine_instance");
00277 
00278     /* final render callbacks */
00279     func= RNA_def_function(srna, "update", NULL);
00280     RNA_def_function_ui_description(func, "Export scene data for render");
00281     RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
00282     RNA_def_pointer(func, "data", "BlendData", "", "");
00283     RNA_def_pointer(func, "scene", "Scene", "", "");
00284 
00285     func= RNA_def_function(srna, "render", NULL);
00286     RNA_def_function_ui_description(func, "Render scene into an image");
00287     RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
00288     RNA_def_pointer(func, "scene", "Scene", "", "");
00289 
00290     /* viewport render callbacks */
00291     func= RNA_def_function(srna, "view_update", NULL);
00292     RNA_def_function_ui_description(func, "Update on data changes for viewport render");
00293     RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
00294     RNA_def_pointer(func, "context", "Context", "", "");
00295 
00296     func= RNA_def_function(srna, "view_draw", NULL);
00297     RNA_def_function_ui_description(func, "Draw viewport render");
00298     RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
00299     RNA_def_pointer(func, "context", "Context", "", "");
00300 
00301     /* tag for redraw */
00302     RNA_def_function(srna, "tag_redraw", "engine_tag_redraw");
00303     RNA_def_function_ui_description(func, "Request redraw for viewport rendering");
00304 
00305     /* tag for update */
00306     RNA_def_function(srna, "tag_update", "engine_tag_update");
00307     RNA_def_function_ui_description(func, "Request update call for viewport rendering");
00308 
00309     func= RNA_def_function(srna, "begin_result", "RE_engine_begin_result");
00310     prop= RNA_def_int(func, "x", 0, 0, INT_MAX, "X", "", 0, INT_MAX);
00311     RNA_def_property_flag(prop, PROP_REQUIRED);
00312     prop= RNA_def_int(func, "y", 0, 0, INT_MAX, "Y", "", 0, INT_MAX);
00313     RNA_def_property_flag(prop, PROP_REQUIRED);
00314     prop= RNA_def_int(func, "w", 0, 0, INT_MAX, "Width", "", 0, INT_MAX);
00315     RNA_def_property_flag(prop, PROP_REQUIRED);
00316     prop= RNA_def_int(func, "h", 0, 0, INT_MAX, "Height", "", 0, INT_MAX);
00317     RNA_def_property_flag(prop, PROP_REQUIRED);
00318     prop= RNA_def_pointer(func, "result", "RenderResult", "Result", "");
00319     RNA_def_function_return(func, prop);
00320 
00321     func= RNA_def_function(srna, "update_result", "RE_engine_update_result");
00322     prop= RNA_def_pointer(func, "result", "RenderResult", "Result", "");
00323     RNA_def_property_flag(prop, PROP_REQUIRED);
00324 
00325     func= RNA_def_function(srna, "end_result", "RE_engine_end_result");
00326     prop= RNA_def_pointer(func, "result", "RenderResult", "Result", "");
00327     RNA_def_property_flag(prop, PROP_REQUIRED);
00328 
00329     func= RNA_def_function(srna, "test_break", "RE_engine_test_break");
00330     prop= RNA_def_boolean(func, "do_break", 0, "Break", "");
00331     RNA_def_function_return(func, prop);
00332 
00333     func= RNA_def_function(srna, "update_stats", "RE_engine_update_stats");
00334     prop= RNA_def_string(func, "stats", "", 0, "Stats", "");
00335     RNA_def_property_flag(prop, PROP_REQUIRED);
00336     prop= RNA_def_string(func, "info", "", 0, "Info", "");
00337     RNA_def_property_flag(prop, PROP_REQUIRED);
00338 
00339     func= RNA_def_function(srna, "update_progress", "RE_engine_update_progress");
00340     prop= RNA_def_float(func, "progress", 0, 0.0f, 1.0f, "", "Percentage of render that's done", 0.0f, 1.0f);
00341     RNA_def_property_flag(prop, PROP_REQUIRED);
00342 
00343     func= RNA_def_function(srna, "report", "RE_engine_report");
00344     prop= RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
00345     RNA_def_property_flag(prop, PROP_REQUIRED);
00346     prop= RNA_def_string(func, "message", "", 0, "Report Message", "");
00347     RNA_def_property_flag(prop, PROP_REQUIRED);
00348 
00349     RNA_define_verify_sdna(0);
00350 
00351     prop= RNA_def_property(srna, "is_animation", PROP_BOOLEAN, PROP_NONE);
00352     RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_ANIMATION);
00353 
00354     prop= RNA_def_property(srna, "is_preview", PROP_BOOLEAN, PROP_NONE);
00355     RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_PREVIEW);
00356 
00357     /* registration */
00358 
00359     prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
00360     RNA_def_property_string_sdna(prop, NULL, "type->idname");
00361     RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
00362 
00363     prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
00364     RNA_def_property_string_sdna(prop, NULL, "type->name");
00365     RNA_def_property_flag(prop, PROP_REGISTER);
00366 
00367     prop= RNA_def_property(srna, "bl_use_preview", PROP_BOOLEAN, PROP_NONE);
00368     RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_PREVIEW);
00369     RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
00370 
00371     prop= RNA_def_property(srna, "bl_use_postprocess", PROP_BOOLEAN, PROP_NONE);
00372     RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", RE_USE_POSTPROCESS);
00373     RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
00374 
00375     prop= RNA_def_property(srna, "bl_use_shading_nodes", PROP_BOOLEAN, PROP_NONE);
00376     RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_SHADING_NODES);
00377     RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
00378 
00379     RNA_define_verify_sdna(1);
00380 }
00381 
00382 static void rna_def_render_result(BlenderRNA *brna)
00383 {
00384     StructRNA *srna;
00385     FunctionRNA *func;
00386     PropertyRNA *parm;
00387     
00388     srna= RNA_def_struct(brna, "RenderResult", NULL);
00389     RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes");
00390 
00391     func= RNA_def_function(srna, "load_from_file", "RE_result_load_from_file");
00392     RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file");
00393     RNA_def_function_flag(func, FUNC_USE_REPORTS);
00394     parm= RNA_def_string_file_name(func, "filename", "", FILE_MAX, "File Name",
00395                                    "Filename to load into this render tile, must be no smaller than the render result");
00396     RNA_def_property_flag(parm, PROP_REQUIRED);
00397 
00398     RNA_define_verify_sdna(0);
00399 
00400     parm= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
00401     RNA_def_property_int_sdna(parm, NULL, "rectx");
00402     RNA_def_property_clear_flag(parm, PROP_EDITABLE);
00403 
00404     parm= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
00405     RNA_def_property_int_sdna(parm, NULL, "recty");
00406     RNA_def_property_clear_flag(parm, PROP_EDITABLE);
00407 
00408     parm= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
00409     RNA_def_property_struct_type(parm, "RenderLayer");
00410     RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
00411 
00412     RNA_define_verify_sdna(1);
00413 }
00414 
00415 static void rna_def_render_layer(BlenderRNA *brna)
00416 {
00417     StructRNA *srna;
00418     PropertyRNA *prop;
00419     FunctionRNA *func;
00420     
00421     srna= RNA_def_struct(brna, "RenderLayer", NULL);
00422     RNA_def_struct_ui_text(srna, "Render Layer", "");
00423 
00424     func= RNA_def_function(srna, "load_from_file", "RE_layer_load_from_file");
00425     RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file");
00426     RNA_def_function_flag(func, FUNC_USE_REPORTS);
00427     prop= RNA_def_string(func, "filename", "", 0, "Filename",
00428                          "Filename to load into this render tile, must be no smaller than the renderlayer");
00429     RNA_def_property_flag(prop, PROP_REQUIRED);
00430     RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X",
00431                 "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX);
00432     RNA_def_int(func, "y", 0, 0, INT_MAX, "Offset Y",
00433                 "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX);
00434 
00435     RNA_define_verify_sdna(0);
00436 
00437     rna_def_render_layer_common(srna, 0);
00438 
00439     prop= RNA_def_property(srna, "passes", PROP_COLLECTION, PROP_NONE);
00440     RNA_def_property_struct_type(prop, "RenderPass");
00441     RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
00442 
00443     prop= RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
00444     RNA_def_property_flag(prop, PROP_DYNAMIC);
00445     RNA_def_property_multi_array(prop, 2, NULL);
00446     RNA_def_property_dynamic_array_funcs(prop, "rna_RenderLayer_rect_get_length");
00447     RNA_def_property_float_funcs(prop, "rna_RenderLayer_rect_get", "rna_RenderLayer_rect_set", NULL);
00448 
00449     RNA_define_verify_sdna(1);
00450 }
00451 
00452 static void rna_def_render_pass(BlenderRNA *brna)
00453 {
00454     StructRNA *srna;
00455     PropertyRNA *prop;
00456 
00457     static EnumPropertyItem pass_type_items[]= {
00458         {SCE_PASS_COMBINED, "COMBINED", 0, "Combined", ""},
00459         {SCE_PASS_Z, "Z", 0, "Z", ""},
00460         {SCE_PASS_RGBA, "COLOR", 0, "Color", ""},
00461         {SCE_PASS_DIFFUSE, "DIFFUSE", 0, "Diffuse", ""},
00462         {SCE_PASS_SPEC, "SPECULAR", 0, "Specular", ""},
00463         {SCE_PASS_SHADOW, "SHADOW", 0, "Shadow", ""},
00464         {SCE_PASS_AO, "AO", 0, "AO", ""},
00465         {SCE_PASS_REFLECT, "REFLECTION", 0, "Reflection", ""},
00466         {SCE_PASS_NORMAL, "NORMAL", 0, "Normal", ""},
00467         {SCE_PASS_VECTOR, "VECTOR", 0, "Vector", ""},
00468         {SCE_PASS_REFRACT, "REFRACTION", 0, "Refraction", ""},
00469         {SCE_PASS_INDEXOB, "OBJECT_INDEX", 0, "Object Index", ""},
00470         {SCE_PASS_UV, "UV", 0, "UV", ""},
00471         {SCE_PASS_MIST, "MIST", 0, "Mist", ""},
00472         {SCE_PASS_EMIT, "EMIT", 0, "Emit", ""},
00473         {SCE_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""},
00474         {SCE_PASS_INDEXMA, "MATERIAL_INDEX", 0, "Material Index", ""},
00475         {0, NULL, 0, NULL, NULL}};
00476     
00477     srna= RNA_def_struct(brna, "RenderPass", NULL);
00478     RNA_def_struct_ui_text(srna, "Render Pass", "");
00479 
00480     RNA_define_verify_sdna(0);
00481 
00482     prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
00483     RNA_def_property_string_sdna(prop, NULL, "name");
00484     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
00485     RNA_def_struct_name_property(srna, prop);
00486 
00487     prop= RNA_def_property(srna, "channel_id", PROP_STRING, PROP_NONE);
00488     RNA_def_property_string_sdna(prop, NULL, "chan_id");
00489     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
00490 
00491     prop= RNA_def_property(srna, "channels", PROP_INT, PROP_NONE);
00492     RNA_def_property_int_sdna(prop, NULL, "channels");
00493     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
00494 
00495     prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
00496     RNA_def_property_enum_sdna(prop, NULL, "passtype");
00497     RNA_def_property_enum_items(prop, pass_type_items);
00498     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
00499 
00500     prop= RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
00501     RNA_def_property_flag(prop, PROP_DYNAMIC);
00502     RNA_def_property_multi_array(prop, 2, NULL);
00503     RNA_def_property_dynamic_array_funcs(prop, "rna_RenderPass_rect_get_length");
00504     RNA_def_property_float_funcs(prop, "rna_RenderPass_rect_get", "rna_RenderPass_rect_set", NULL);
00505 
00506     RNA_define_verify_sdna(1);
00507 }
00508 
00509 void RNA_def_render(BlenderRNA *brna)
00510 {
00511     rna_def_render_engine(brna);
00512     rna_def_render_result(brna);
00513     rna_def_render_layer(brna);
00514     rna_def_render_pass(brna);
00515 }
00516 
00517 #endif // RNA_RUNTIME
00518