Changeset View
Standalone View
source/blender/makesrna/intern/rna_render.c
| Context not available. | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_path_util.h" | #include "BLI_path_util.h" | ||||
| #include "BLO_readfile.h" | |||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| Context not available. | |||||
| et->view_draw = (have_function[4]) ? engine_view_draw : NULL; | et->view_draw = (have_function[4]) ? engine_view_draw : NULL; | ||||
| et->update_script_node = (have_function[5]) ? engine_update_script_node : NULL; | et->update_script_node = (have_function[5]) ? engine_update_script_node : NULL; | ||||
| /* load preview file */ | |||||
| if (strlen(et->preview_filepath)) { | |||||
campbellbarton: *picky*, can do `if (*et->preview_filepath) {...}` | |||||
| et->preview_main = BLO_load_main_from_file(et->preview_filepath); | |||||
sergeyUnsubmitted Not Done Inline ActionsNot sure it's really safe to do here. Tending to think of on-demand loading, so background rendering doesn't spend time on this. But it could be tricky. Maybe @Campbell Barton (campbellbarton) has strong opinion here. sergey: Not sure it's really safe to do here. Tending to think of on-demand loading, so background… | |||||
bdancerAuthorUnsubmitted Not Done Inline ActionsThis is here because preview loading should be as fast as possible, so the idea was to init the scene on RenderEngine class registration. bdancer: This is here because preview loading should be as fast as possible, so the idea was to init the… | |||||
sergeyUnsubmitted Not Done Inline ActionsAlso meaning slower blender startup time because of loading previews .blend which users probably wound't need. sergey: Also meaning slower blender startup time because of loading previews .blend which users… | |||||
campbellbartonUnsubmitted Not Done Inline ActionsAgree this should be done on demand, or at least not when registering. campbellbarton: Agree this should be done on demand, or at least not when registering. | |||||
| } | |||||
| BLI_addtail(&R_engines, et); | BLI_addtail(&R_engines, et); | ||||
| return et->ext.srna; | return et->ext.srna; | ||||
| Context not available. | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_PREVIEW); | RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_PREVIEW); | ||||
| RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); | RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); | ||||
| prop = RNA_def_property(srna, "bl_preview_filepath", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "type->preview_filepath"); | |||||
| RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); | |||||
| prop = RNA_def_property(srna, "bl_use_postprocess", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "bl_use_postprocess", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", RE_USE_POSTPROCESS); | RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", RE_USE_POSTPROCESS); | ||||
| RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); | RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); | ||||
| Context not available. | |||||
*picky*, can do if (*et->preview_filepath) {...}