Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_render.c
| Show First 20 Lines • Show All 414 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| #else /* RNA_RUNTIME */ | #else /* RNA_RUNTIME */ | ||||
| static void rna_def_render_engine(BlenderRNA *brna) | static void rna_def_render_engine(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | |||||
| srna = RNA_def_struct(brna, "RenderEngine", NULL); | srna = RNA_def_struct(brna, "RenderEngine", NULL); | ||||
| RNA_def_struct_sdna(srna, "RenderEngine"); | RNA_def_struct_sdna(srna, "RenderEngine"); | ||||
| RNA_def_struct_ui_text(srna, "Render Engine", "Render engine"); | RNA_def_struct_ui_text(srna, "Render Engine", "Render engine"); | ||||
| RNA_def_struct_refine_func(srna, "rna_RenderEngine_refine"); | RNA_def_struct_refine_func(srna, "rna_RenderEngine_refine"); | ||||
| RNA_def_struct_register_funcs(srna, "rna_RenderEngine_register", "rna_RenderEngine_unregister", | RNA_def_struct_register_funcs(srna, "rna_RenderEngine_register", "rna_RenderEngine_unregister", | ||||
| "rna_RenderEngine_instance"); | "rna_RenderEngine_instance"); | ||||
| /* final render callbacks */ | /* final render callbacks */ | ||||
| func = RNA_def_function(srna, "update", NULL); | func = RNA_def_function(srna, "update", NULL); | ||||
| RNA_def_function_ui_description(func, "Export scene data for render"); | RNA_def_function_ui_description(func, "Export scene data for render"); | ||||
| RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); | RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); | ||||
| RNA_def_pointer(func, "data", "BlendData", "", ""); | RNA_def_pointer(func, "data", "BlendData", "", ""); | ||||
| RNA_def_pointer(func, "scene", "Scene", "", ""); | RNA_def_pointer(func, "scene", "Scene", "", ""); | ||||
| func = RNA_def_function(srna, "render", NULL); | func = RNA_def_function(srna, "render", NULL); | ||||
| RNA_def_function_ui_description(func, "Render scene into an image"); | RNA_def_function_ui_description(func, "Render scene into an image"); | ||||
| RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); | RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); | ||||
| RNA_def_pointer(func, "scene", "Scene", "", ""); | RNA_def_pointer(func, "scene", "Scene", "", ""); | ||||
| func = RNA_def_function(srna, "bake", NULL); | func = RNA_def_function(srna, "bake", NULL); | ||||
| RNA_def_function_ui_description(func, "Bake passes"); | RNA_def_function_ui_description(func, "Bake passes"); | ||||
| RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); | RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); | ||||
| prop = RNA_def_pointer(func, "scene", "Scene", "", ""); | parm = RNA_def_pointer(func, "scene", "Scene", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_pointer(func, "object", "Object", "", ""); | parm = RNA_def_pointer(func, "object", "Object", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_enum(func, "pass_type", rna_enum_bake_pass_type_items, 0, "Pass", "Pass to bake"); | parm = RNA_def_enum(func, "pass_type", rna_enum_bake_pass_type_items, 0, "Pass", "Pass to bake"); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_int(func, "pass_filter", 0, 0, INT_MAX, "Pass Filter", "Filter to combined, diffuse, glossy, transmission and subsurface passes", 0, INT_MAX); | parm = RNA_def_int(func, "pass_filter", 0, 0, INT_MAX, "Pass Filter", "Filter to combined, diffuse, glossy, transmission and subsurface passes", 0, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_int(func, "object_id", 0, 0, INT_MAX, "Object Id", "Id of the current object being baked in relation to the others", 0, INT_MAX); | parm = RNA_def_int(func, "object_id", 0, 0, INT_MAX, "Object Id", "Id of the current object being baked in relation to the others", 0, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_pointer(func, "pixel_array", "BakePixel", "", ""); | parm = RNA_def_pointer(func, "pixel_array", "BakePixel", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_int(func, "num_pixels", 0, 0, INT_MAX, "Number of Pixels", "Size of the baking batch", 0, INT_MAX); | parm = RNA_def_int(func, "num_pixels", 0, 0, INT_MAX, "Number of Pixels", "Size of the baking batch", 0, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_int(func, "depth", 0, 0, INT_MAX, "Pixels depth", "Number of channels", 1, INT_MAX); | parm = RNA_def_int(func, "depth", 0, 0, INT_MAX, "Pixels depth", "Number of channels", 1, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* TODO, see how array size of 0 works, this shouldnt be used */ | /* TODO, see how array size of 0 works, this shouldnt be used */ | ||||
| prop = RNA_def_pointer(func, "result", "AnyType", "", ""); | parm = RNA_def_pointer(func, "result", "AnyType", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* viewport render callbacks */ | /* viewport render callbacks */ | ||||
| func = RNA_def_function(srna, "view_update", NULL); | func = RNA_def_function(srna, "view_update", NULL); | ||||
| RNA_def_function_ui_description(func, "Update on data changes for viewport render"); | RNA_def_function_ui_description(func, "Update on data changes for viewport render"); | ||||
| RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); | RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); | ||||
| RNA_def_pointer(func, "context", "Context", "", ""); | RNA_def_pointer(func, "context", "Context", "", ""); | ||||
| func = RNA_def_function(srna, "view_draw", NULL); | func = RNA_def_function(srna, "view_draw", NULL); | ||||
| RNA_def_function_ui_description(func, "Draw viewport render"); | RNA_def_function_ui_description(func, "Draw viewport render"); | ||||
| RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); | RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); | ||||
| RNA_def_pointer(func, "context", "Context", "", ""); | RNA_def_pointer(func, "context", "Context", "", ""); | ||||
| /* shader script callbacks */ | /* shader script callbacks */ | ||||
| func = RNA_def_function(srna, "update_script_node", NULL); | func = RNA_def_function(srna, "update_script_node", NULL); | ||||
| RNA_def_function_ui_description(func, "Compile shader script node"); | RNA_def_function_ui_description(func, "Compile shader script node"); | ||||
| RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); | RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); | ||||
| prop = RNA_def_pointer(func, "node", "Node", "", ""); | parm = RNA_def_pointer(func, "node", "Node", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_RNAPTR); | RNA_def_parameter_flags(parm, 0, PARM_RNAPTR); | ||||
| /* tag for redraw */ | /* tag for redraw */ | ||||
| func = RNA_def_function(srna, "tag_redraw", "engine_tag_redraw"); | func = RNA_def_function(srna, "tag_redraw", "engine_tag_redraw"); | ||||
| RNA_def_function_ui_description(func, "Request redraw for viewport rendering"); | RNA_def_function_ui_description(func, "Request redraw for viewport rendering"); | ||||
| /* tag for update */ | /* tag for update */ | ||||
| func = RNA_def_function(srna, "tag_update", "engine_tag_update"); | func = RNA_def_function(srna, "tag_update", "engine_tag_update"); | ||||
| RNA_def_function_ui_description(func, "Request update call for viewport rendering"); | RNA_def_function_ui_description(func, "Request update call for viewport rendering"); | ||||
| func = RNA_def_function(srna, "begin_result", "RE_engine_begin_result"); | func = RNA_def_function(srna, "begin_result", "RE_engine_begin_result"); | ||||
| RNA_def_function_ui_description(func, "Create render result to write linear floating point render layers and passes"); | RNA_def_function_ui_description(func, "Create render result to write linear floating point render layers and passes"); | ||||
| prop = RNA_def_int(func, "x", 0, 0, INT_MAX, "X", "", 0, INT_MAX); | parm = RNA_def_int(func, "x", 0, 0, INT_MAX, "X", "", 0, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_int(func, "y", 0, 0, INT_MAX, "Y", "", 0, INT_MAX); | parm = RNA_def_int(func, "y", 0, 0, INT_MAX, "Y", "", 0, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_int(func, "w", 0, 0, INT_MAX, "Width", "", 0, INT_MAX); | parm = RNA_def_int(func, "w", 0, 0, INT_MAX, "Width", "", 0, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_int(func, "h", 0, 0, INT_MAX, "Height", "", 0, INT_MAX); | parm = RNA_def_int(func, "h", 0, 0, INT_MAX, "Height", "", 0, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_string(func, "layer", NULL, 0, "Layer", "Single layer to get render result for"); /* NULL ok here */ | RNA_def_string(func, "layer", NULL, 0, "Layer", "Single layer to get render result for"); /* NULL ok here */ | ||||
| RNA_def_string(func, "view", NULL, 0, "View", "Single view to get render result for"); /* NULL ok here */ | RNA_def_string(func, "view", NULL, 0, "View", "Single view to get render result for"); /* NULL ok here */ | ||||
| prop = RNA_def_pointer(func, "result", "RenderResult", "Result", ""); | parm = RNA_def_pointer(func, "result", "RenderResult", "Result", ""); | ||||
| RNA_def_function_return(func, prop); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "update_result", "RE_engine_update_result"); | func = RNA_def_function(srna, "update_result", "RE_engine_update_result"); | ||||
| RNA_def_function_ui_description(func, "Signal that pixels have been updated and can be redrawn in the user interface"); | RNA_def_function_ui_description(func, "Signal that pixels have been updated and can be redrawn in the user interface"); | ||||
| prop = RNA_def_pointer(func, "result", "RenderResult", "Result", ""); | parm = RNA_def_pointer(func, "result", "RenderResult", "Result", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "end_result", "RE_engine_end_result"); | func = RNA_def_function(srna, "end_result", "RE_engine_end_result"); | ||||
| RNA_def_function_ui_description(func, "All pixels in the render result have been set and are final"); | RNA_def_function_ui_description(func, "All pixels in the render result have been set and are final"); | ||||
| prop = RNA_def_pointer(func, "result", "RenderResult", "Result", ""); | parm = RNA_def_pointer(func, "result", "RenderResult", "Result", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_boolean(func, "cancel", 0, "Cancel", "Don't mark tile as done, don't merge results unless forced"); | RNA_def_boolean(func, "cancel", 0, "Cancel", "Don't mark tile as done, don't merge results unless forced"); | ||||
| RNA_def_boolean(func, "do_merge_results", 0, "Merge Results", "Merge results even if cancel=true"); | RNA_def_boolean(func, "do_merge_results", 0, "Merge Results", "Merge results even if cancel=true"); | ||||
| func = RNA_def_function(srna, "test_break", "RE_engine_test_break"); | func = RNA_def_function(srna, "test_break", "RE_engine_test_break"); | ||||
| RNA_def_function_ui_description(func, "Test if the render operation should been canceled, this is a fast call that should be used regularly for responsiveness"); | RNA_def_function_ui_description(func, "Test if the render operation should been canceled, this is a fast call that should be used regularly for responsiveness"); | ||||
| prop = RNA_def_boolean(func, "do_break", 0, "Break", ""); | parm = RNA_def_boolean(func, "do_break", 0, "Break", ""); | ||||
| RNA_def_function_return(func, prop); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "active_view_get", "RE_engine_active_view_get"); | func = RNA_def_function(srna, "active_view_get", "RE_engine_active_view_get"); | ||||
| prop = RNA_def_string(func, "view", NULL, 0, "View", "Single view active"); | parm = RNA_def_string(func, "view", NULL, 0, "View", "Single view active"); | ||||
| RNA_def_function_return(func, prop); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "active_view_set", "RE_engine_active_view_set"); | func = RNA_def_function(srna, "active_view_set", "RE_engine_active_view_set"); | ||||
| RNA_def_string(func, "view", NULL, 0, "View", "Single view to set as active"); /* NULL ok here */ | parm = RNA_def_string(func, "view", NULL, 0, "View", "Single view to set as active"); /* NULL ok here */ | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "camera_shift_x", "RE_engine_get_camera_shift_x"); | func = RNA_def_function(srna, "camera_shift_x", "RE_engine_get_camera_shift_x"); | ||||
| prop = RNA_def_pointer(func, "camera", "Object", "", ""); | parm = RNA_def_pointer(func, "camera", "Object", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_boolean(func, "use_spherical_stereo", 0, "Spherical Stereo", ""); | RNA_def_boolean(func, "use_spherical_stereo", 0, "Spherical Stereo", ""); | ||||
| prop = RNA_def_float(func, "shift_x", 0.0f, 0.0f, FLT_MAX, "Shift X", "", 0.0f, FLT_MAX); | parm = RNA_def_float(func, "shift_x", 0.0f, 0.0f, FLT_MAX, "Shift X", "", 0.0f, FLT_MAX); | ||||
| RNA_def_function_return(func, prop); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "camera_model_matrix", "RE_engine_get_camera_model_matrix"); | func = RNA_def_function(srna, "camera_model_matrix", "RE_engine_get_camera_model_matrix"); | ||||
| prop = RNA_def_pointer(func, "camera", "Object", "", ""); | parm = RNA_def_pointer(func, "camera", "Object", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_boolean(func, "use_spherical_stereo", 0, "Spherical Stereo", ""); | RNA_def_boolean(func, "use_spherical_stereo", 0, "Spherical Stereo", ""); | ||||
| prop = RNA_def_float_matrix(func, "r_model_matrix", 4, 4, NULL, 0.0f, 0.0f, "Model Matrix", "Normalized camera model matrix", 0.0f, 0.0f); | parm = RNA_def_float_matrix(func, "r_model_matrix", 4, 4, NULL, 0.0f, 0.0f, "Model Matrix", "Normalized camera model matrix", 0.0f, 0.0f); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "use_spherical_stereo", "RE_engine_get_spherical_stereo"); | func = RNA_def_function(srna, "use_spherical_stereo", "RE_engine_get_spherical_stereo"); | ||||
| prop = RNA_def_pointer(func, "camera", "Object", "", ""); | parm = RNA_def_pointer(func, "camera", "Object", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_boolean(func, "use_spherical_stereo", 0, "Spherical Stereo", ""); | parm = RNA_def_boolean(func, "use_spherical_stereo", 0, "Spherical Stereo", ""); | ||||
| RNA_def_function_return(func, prop); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "update_stats", "RE_engine_update_stats"); | func = RNA_def_function(srna, "update_stats", "RE_engine_update_stats"); | ||||
| RNA_def_function_ui_description(func, "Update and signal to redraw render status text"); | RNA_def_function_ui_description(func, "Update and signal to redraw render status text"); | ||||
| prop = RNA_def_string(func, "stats", NULL, 0, "Stats", ""); | parm = RNA_def_string(func, "stats", NULL, 0, "Stats", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_string(func, "info", NULL, 0, "Info", ""); | parm = RNA_def_string(func, "info", NULL, 0, "Info", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "frame_set", "RE_engine_frame_set"); | func = RNA_def_function(srna, "frame_set", "RE_engine_frame_set"); | ||||
| RNA_def_function_ui_description(func, "Evaluate scene at a different frame (for motion blur)"); | RNA_def_function_ui_description(func, "Evaluate scene at a different frame (for motion blur)"); | ||||
| prop = RNA_def_int(func, "frame", 0, INT_MIN, INT_MAX, "Frame", "", INT_MIN, INT_MAX); | parm = RNA_def_int(func, "frame", 0, INT_MIN, INT_MAX, "Frame", "", INT_MIN, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_float(func, "subframe", 0.0f, 0.0f, 1.0f, "Subframe", "", 0.0f, 1.0f); | parm = RNA_def_float(func, "subframe", 0.0f, 0.0f, 1.0f, "Subframe", "", 0.0f, 1.0f); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "update_progress", "RE_engine_update_progress"); | func = RNA_def_function(srna, "update_progress", "RE_engine_update_progress"); | ||||
| RNA_def_function_ui_description(func, "Update progress percentage of render"); | RNA_def_function_ui_description(func, "Update progress percentage of render"); | ||||
| prop = RNA_def_float(func, "progress", 0, 0.0f, 1.0f, "", "Percentage of render that's done", 0.0f, 1.0f); | parm = RNA_def_float(func, "progress", 0, 0.0f, 1.0f, "", "Percentage of render that's done", 0.0f, 1.0f); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "update_memory_stats", "RE_engine_update_memory_stats"); | func = RNA_def_function(srna, "update_memory_stats", "RE_engine_update_memory_stats"); | ||||
| RNA_def_function_ui_description(func, "Update memory usage statistics"); | RNA_def_function_ui_description(func, "Update memory usage statistics"); | ||||
| RNA_def_float(func, "memory_used", 0, 0.0f, FLT_MAX, "", "Current memory usage in megabytes", 0.0f, FLT_MAX); | RNA_def_float(func, "memory_used", 0, 0.0f, FLT_MAX, "", "Current memory usage in megabytes", 0.0f, FLT_MAX); | ||||
| RNA_def_float(func, "memory_peak", 0, 0.0f, FLT_MAX, "", "Peak memory usage in megabytes", 0.0f, FLT_MAX); | RNA_def_float(func, "memory_peak", 0, 0.0f, FLT_MAX, "", "Peak memory usage in megabytes", 0.0f, FLT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | |||||
| func = RNA_def_function(srna, "report", "RE_engine_report"); | func = RNA_def_function(srna, "report", "RE_engine_report"); | ||||
| RNA_def_function_ui_description(func, "Report info, warning or error messages"); | RNA_def_function_ui_description(func, "Report info, warning or error messages"); | ||||
| prop = RNA_def_enum_flag(func, "type", rna_enum_wm_report_items, 0, "Type", ""); | parm = RNA_def_enum_flag(func, "type", rna_enum_wm_report_items, 0, "Type", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_string(func, "message", NULL, 0, "Report Message", ""); | parm = RNA_def_string(func, "message", NULL, 0, "Report Message", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "error_set", "RE_engine_set_error_message"); | func = RNA_def_function(srna, "error_set", "RE_engine_set_error_message"); | ||||
| RNA_def_function_ui_description(func, "Set error message displaying after the render is finished"); | RNA_def_function_ui_description(func, "Set error message displaying after the render is finished"); | ||||
| prop = RNA_def_string(func, "message", NULL, 0, "Report Message", ""); | parm = RNA_def_string(func, "message", NULL, 0, "Report Message", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "bind_display_space_shader", "engine_bind_display_space_shader"); | func = RNA_def_function(srna, "bind_display_space_shader", "engine_bind_display_space_shader"); | ||||
| RNA_def_function_ui_description(func, "Bind GLSL fragment shader that converts linear colors to display space colors using scene color management settings"); | RNA_def_function_ui_description(func, "Bind GLSL fragment shader that converts linear colors to display space colors using scene color management settings"); | ||||
| prop = RNA_def_pointer(func, "scene", "Scene", "", ""); | parm = RNA_def_pointer(func, "scene", "Scene", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "unbind_display_space_shader", "engine_unbind_display_space_shader"); | func = RNA_def_function(srna, "unbind_display_space_shader", "engine_unbind_display_space_shader"); | ||||
| RNA_def_function_ui_description(func, "Unbind GLSL display space shader, must always be called after binding the shader"); | RNA_def_function_ui_description(func, "Unbind GLSL display space shader, must always be called after binding the shader"); | ||||
| func = RNA_def_function(srna, "support_display_space_shader", "engine_support_display_space_shader"); | func = RNA_def_function(srna, "support_display_space_shader", "engine_support_display_space_shader"); | ||||
| RNA_def_function_ui_description(func, "Test if GLSL display space shader is supported for the combination of graphics card and scene settings"); | RNA_def_function_ui_description(func, "Test if GLSL display space shader is supported for the combination of graphics card and scene settings"); | ||||
| prop = RNA_def_pointer(func, "scene", "Scene", "", ""); | parm = RNA_def_pointer(func, "scene", "Scene", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| prop = RNA_def_boolean(func, "supported", 0, "Supported", ""); | parm = RNA_def_boolean(func, "supported", 0, "Supported", ""); | ||||
| RNA_def_function_return(func, prop); | RNA_def_function_return(func, parm); | ||||
| RNA_define_verify_sdna(0); | RNA_define_verify_sdna(0); | ||||
| prop = RNA_def_property(srna, "is_animation", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "is_animation", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_ANIMATION); | RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_ANIMATION); | ||||
| prop = RNA_def_property(srna, "is_preview", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "is_preview", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_PREVIEW); | RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_PREVIEW); | ||||
| ▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | static void rna_def_render_engine(BlenderRNA *brna) | ||||
| RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); | RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); | ||||
| RNA_define_verify_sdna(1); | RNA_define_verify_sdna(1); | ||||
| } | } | ||||
| static void rna_def_render_result(BlenderRNA *brna) | static void rna_def_render_result(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | |||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| srna = RNA_def_struct(brna, "RenderResult", NULL); | srna = RNA_def_struct(brna, "RenderResult", NULL); | ||||
| RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes"); | RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes"); | ||||
| func = RNA_def_function(srna, "load_from_file", "RE_result_load_from_file"); | func = RNA_def_function(srna, "load_from_file", "RE_result_load_from_file"); | ||||
| RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file"); | RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_string_file_name(func, "filename", NULL, FILE_MAX, "File Name", | parm = RNA_def_string_file_name(func, "filename", NULL, FILE_MAX, "File Name", | ||||
| "Filename to load into this render tile, must be no smaller than " | "Filename to load into this render tile, must be no smaller than " | ||||
| "the render result"); | "the render result"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_define_verify_sdna(0); | RNA_define_verify_sdna(0); | ||||
| parm = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_PIXEL); | prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_PIXEL); | ||||
| RNA_def_property_int_sdna(parm, NULL, "rectx"); | RNA_def_property_int_sdna(prop, NULL, "rectx"); | ||||
| RNA_def_property_clear_flag(parm, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| parm = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL); | prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL); | ||||
| RNA_def_property_int_sdna(parm, NULL, "recty"); | RNA_def_property_int_sdna(prop, NULL, "recty"); | ||||
| RNA_def_property_clear_flag(parm, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| parm = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_struct_type(parm, "RenderLayer"); | RNA_def_property_struct_type(prop, "RenderLayer"); | ||||
| RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", | RNA_def_property_collection_funcs(prop, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", | ||||
| "rna_iterator_listbase_end", "rna_iterator_listbase_get", | "rna_iterator_listbase_end", "rna_iterator_listbase_get", | ||||
| NULL, NULL, NULL, NULL); | NULL, NULL, NULL, NULL); | ||||
| parm = RNA_def_property(srna, "views", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "views", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_struct_type(parm, "RenderView"); | RNA_def_property_struct_type(prop, "RenderView"); | ||||
| RNA_def_property_collection_funcs(parm, "rna_RenderResult_views_begin", "rna_iterator_listbase_next", | RNA_def_property_collection_funcs(prop, "rna_RenderResult_views_begin", "rna_iterator_listbase_next", | ||||
| "rna_iterator_listbase_end", "rna_iterator_listbase_get", | "rna_iterator_listbase_end", "rna_iterator_listbase_get", | ||||
| NULL, NULL, NULL, NULL); | NULL, NULL, NULL, NULL); | ||||
| RNA_define_verify_sdna(1); | RNA_define_verify_sdna(1); | ||||
| } | } | ||||
| static void rna_def_render_view(BlenderRNA *brna) | static void rna_def_render_view(BlenderRNA *brna) | ||||
| { | { | ||||
| Show All 23 Lines | static void rna_def_render_passes(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| RNA_def_property_srna(cprop, "RenderPasses"); | RNA_def_property_srna(cprop, "RenderPasses"); | ||||
| srna = RNA_def_struct(brna, "RenderPasses", NULL); | srna = RNA_def_struct(brna, "RenderPasses", NULL); | ||||
| RNA_def_struct_sdna(srna, "RenderLayer"); | RNA_def_struct_sdna(srna, "RenderLayer"); | ||||
| RNA_def_struct_ui_text(srna, "Render Passes", "Collection of render passes"); | RNA_def_struct_ui_text(srna, "Render Passes", "Collection of render passes"); | ||||
| func = RNA_def_function(srna, "find_by_type", "rna_RenderPass_find_by_type"); | func = RNA_def_function(srna, "find_by_type", "rna_RenderPass_find_by_type"); | ||||
| RNA_def_function_ui_description(func, "Get the render pass for a given type and view"); | RNA_def_function_ui_description(func, "Get the render pass for a given type and view"); | ||||
| parm = RNA_def_enum(func, "pass_type", rna_enum_render_pass_type_items, SCE_PASS_COMBINED, "Pass", ""); | parm = RNA_def_enum(func, "pass_type", rna_enum_render_pass_type_items, SCE_PASS_COMBINED, "Pass", ""); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_string(func, "view", NULL, 0, "View", "Render view to get pass from"); /* NULL ok here */ | parm = RNA_def_string(func, "view", NULL, 0, "View", "Render view to get pass from"); /* NULL ok here */ | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_pointer(func, "render_pass", "RenderPass", "", "The matching render pass"); | parm = RNA_def_pointer(func, "render_pass", "RenderPass", "", "The matching render pass"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| } | } | ||||
| static void rna_def_render_layer(BlenderRNA *brna) | static void rna_def_render_layer(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | |||||
| srna = RNA_def_struct(brna, "RenderLayer", NULL); | srna = RNA_def_struct(brna, "RenderLayer", NULL); | ||||
| RNA_def_struct_ui_text(srna, "Render Layer", ""); | RNA_def_struct_ui_text(srna, "Render Layer", ""); | ||||
| func = RNA_def_function(srna, "load_from_file", "RE_layer_load_from_file"); | func = RNA_def_function(srna, "load_from_file", "RE_layer_load_from_file"); | ||||
| RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file"); | RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| prop = RNA_def_string(func, "filename", NULL, 0, "Filename", | parm = RNA_def_string(func, "filename", NULL, 0, "Filename", | ||||
| "Filename to load into this render tile, must be no smaller than the renderlayer"); | "Filename to load into this render tile, must be no smaller than the renderlayer"); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X", | RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X", | ||||
| "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX); | "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX); | ||||
| RNA_def_int(func, "y", 0, 0, INT_MAX, "Offset Y", | RNA_def_int(func, "y", 0, 0, INT_MAX, "Offset Y", | ||||
| "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX); | "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX); | ||||
| RNA_define_verify_sdna(0); | RNA_define_verify_sdna(0); | ||||
| rna_def_render_layer_common(srna, 0); | rna_def_render_layer_common(srna, 0); | ||||
| ▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines | |||||