Changeset View
Standalone View
source/blender/makesrna/intern/rna_render.c
| Context not available. | |||||
| #include "RE_engine.h" | #include "RE_engine.h" | ||||
| #include "RE_pipeline.h" | #include "RE_pipeline.h" | ||||
| #include "RE_render_ext.h" | |||||
| EnumPropertyItem render_pass_type_items[] = { | EnumPropertyItem render_pass_type_items[] = { | ||||
| {SCE_PASS_COMBINED, "COMBINED", 0, "Combined", ""}, | {SCE_PASS_COMBINED, "COMBINED", 0, "Combined", ""}, | ||||
| Context not available. | |||||
| /* setup dummy engine & engine type to store static properties in */ | /* setup dummy engine & engine type to store static properties in */ | ||||
| dummyengine.type = &dummyet; | dummyengine.type = &dummyet; | ||||
| dummyet.flag |= RE_USE_SHADING_NODES_CUSTOM; | dummyet.flag |= RE_USE_SHADING_NODES_CUSTOM | RE_USE_RENDER_ENGINE_CUSTOM; | ||||
| RNA_pointer_create(NULL, &RNA_RenderEngine, &dummyengine, &dummyptr); | RNA_pointer_create(NULL, &RNA_RenderEngine, &dummyengine, &dummyptr); | ||||
| /* validate the python class */ | /* validate the python class */ | ||||
| Context not available. | |||||
| et->update = (have_function[0]) ? engine_update : NULL; | et->update = (have_function[0]) ? engine_update : NULL; | ||||
| et->render = (have_function[1]) ? engine_render : NULL; | et->render = (have_function[1]) ? engine_render : NULL; | ||||
| et->bake = (have_function[2]) ? engine_bake : NULL; | et->bake = (have_function[2]) ? engine_bake : NULL; | ||||
| et->view_update = (have_function[3]) ? engine_view_update : NULL; | |||||
| et->view_draw = (have_function[4]) ? engine_view_draw : NULL; | if (et->flag && et->flag & RE_USE_RENDER_ENGINE_CUSTOM) { | ||||
sergey: This seems arbitrary to me, it's like telling: hey, i've got new fancy render engine, but in… | |||||
a.romanovAuthorUnsubmitted Not Done Inline ActionsHere should be the code that uses Cycles/BI. So this is shortcoming. The main reason for this patch is that current glsl-render has lots of unsupported visual effects, which can be visualized only with BI (Halo, reflections, Environment (btw, we've made a patch for Viewport in this case), Procedural textures etc). So, for example, our engine supports several of these features and users can check them only in BI, and it's not very comfortable to switch renderer every time. When feature viewport is out, there won't be need in such measures actually :) a.romanov: Here should be the code that uses Cycles/BI. So this is shortcoming.
The main reason for this… | |||||
sergeyUnsubmitted Not Done Inline ActionsIn your case you'll want to fall back to BI's drawing, someone else might want to fallback to Cycles or something else. Decision of which callback to use is rather arbitrary and am not really happy with it. It's more like you're trying to subclass a render engine and override only few of the callbacks. Perhaps more proper way to go for things like this would be to make it possible to delegate those calls to BI renderer. sergey: In your case you'll want to fall back to BI's drawing, someone else might want to fallback to… | |||||
a.romanovAuthorUnsubmitted Not Done Inline ActionsThanks for the tip. a.romanov: Thanks for the tip.
I will investigate this approach. | |||||
| et->view_update = (have_function[3]) ? engine_view_update : NULL; | |||||
| et->view_draw = (have_function[4]) ? engine_view_draw : NULL; | |||||
| } | |||||
| else { | |||||
| et->view_update = render_view3d_update; | |||||
| et->view_draw = render_view3d_draw; | |||||
| } | |||||
| et->update_script_node = (have_function[5]) ? engine_update_script_node : NULL; | et->update_script_node = (have_function[5]) ? engine_update_script_node : NULL; | ||||
| BLI_addtail(&R_engines, et); | BLI_addtail(&R_engines, et); | ||||
| Context not available. | |||||
| RNA_def_property_boolean_default(prop, true); | RNA_def_property_boolean_default(prop, true); | ||||
| RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); | RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); | ||||
| prop = RNA_def_property(srna, "bl_use_render_engine_custom", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_RENDER_ENGINE_CUSTOM); | |||||
| RNA_def_property_boolean_default(prop, true); | |||||
| RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); | |||||
| prop = RNA_def_property(srna, "bl_use_exclude_layers", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "bl_use_exclude_layers", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_EXCLUDE_LAYERS); | RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_EXCLUDE_LAYERS); | ||||
| RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); | RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); | ||||
| Context not available. | |||||
This seems arbitrary to me, it's like telling: hey, i've got new fancy render engine, but in fact it renders everything as Blender Internal.
What's the point of this?