diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-09-18 15:32:21 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-09-18 15:32:21 +0300 |
commit | cac756a92aaec5ccc8ddb95c021dcf79d12cc588 (patch) | |
tree | 256378022a995491400e284faeeb5c63d66bf031 /source/blender | |
parent | 95373e274908615df2e5dbf6243b055ff2c39518 (diff) |
UI: Move render display type to Preferences
Moves the render display type (to choose between rendering in a new
window, in a fullscreen area, in an Image Editor, etc) from the scene to
the preferences.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/versioning_userdef.c | 1 | ||||
-rw-r--r-- | source/blender/editors/render/render_view.c | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 10 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 23 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 28 |
5 files changed, 41 insertions, 27 deletions
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index 739dc32d1fe..c1c398c32d0 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -620,6 +620,7 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef) */ { /* pass */ + userdef->render_display_type = USER_RENDER_DISPLAY_WINDOW; } if (userdef->pixelsize == 0.0f) { diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c index d92cd13628b..6873495e962 100644 --- a/source/blender/editors/render/render_view.c +++ b/source/blender/editors/render/render_view.c @@ -139,11 +139,11 @@ ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports) SpaceImage *sima; bool area_was_image = false; - if (scene->r.displaymode == R_OUTPUT_NONE) { + if (U.render_display_type == USER_RENDER_DISPLAY_NONE) { return NULL; } - if (scene->r.displaymode == R_OUTPUT_WINDOW) { + if (U.render_display_type == USER_RENDER_DISPLAY_WINDOW) { int sizex = 30 * UI_DPI_FAC + (scene->r.xsch * scene->r.size) / 100; int sizey = 60 * UI_DPI_FAC + (scene->r.ysch * scene->r.size) / 100; @@ -164,7 +164,7 @@ ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports) sa = CTX_wm_area(C); } - else if (scene->r.displaymode == R_OUTPUT_SCREEN) { + else if (U.render_display_type == USER_RENDER_DISPLAY_SCREEN) { sa = CTX_wm_area(C); /* if the active screen is already in fullscreen mode, skip this and diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 86c2b2f09a8..22da2a86054 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -814,7 +814,8 @@ typedef struct UserDef { char viewport_aa; - char _pad5[6]; + char render_display_type; /* eUserpref_RenderDisplayType */ + char _pad5[5]; struct WalkNavigation walk_navigation; @@ -1202,6 +1203,13 @@ typedef enum eUserpref_FactorDisplay { USER_FACTOR_AS_PERCENTAGE = 1, } eUserpref_FactorDisplay; +typedef enum eUserpref_RenderDisplayType { + USER_RENDER_DISPLAY_NONE = 0, + USER_RENDER_DISPLAY_SCREEN = 1, + USER_RENDER_DISPLAY_AREA = 2, + USER_RENDER_DISPLAY_WINDOW = 3 +} eUserpref_RenderDisplayType; + typedef enum eUserpref_TempSpaceDisplayType { USER_TEMP_SPACE_DISPLAY_FULLSCREEN, USER_TEMP_SPACE_DISPLAY_WINDOW, diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 1cf4a33c5c9..d82fd64b193 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -5509,22 +5509,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static const EnumPropertyItem display_mode_items[] = { - {R_OUTPUT_SCREEN, - "SCREEN", - 0, - "Full Screen", - "Images are rendered in a maximized Image Editor"}, - {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in an Image Editor"}, - {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in a new window"}, - {R_OUTPUT_NONE, - "NONE", - 0, - "Keep User Interface", - "Images are rendered without changing the user interface"}, - {0, NULL, 0, NULL, NULL}, - }; - /* Bake */ static const EnumPropertyItem bake_mode_items[] = { //{RE_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"}, @@ -5921,13 +5905,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna) "(this solves anti-aliasing issues with compositing)"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode"); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_enum_items(prop, display_mode_items); - RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed"); - RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - prop = RNA_def_property(srna, "use_lock_interface", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "use_lock_interface", 1); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 94f800c82a9..5b75bca89f3 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -4044,6 +4044,29 @@ static void rna_def_userdef_view(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; + static const EnumPropertyItem render_display_types[] = { + {USER_RENDER_DISPLAY_NONE, + "NONE", + 0, + "Keep User Interface", + "Images are rendered without changing the user interface"}, + {USER_RENDER_DISPLAY_SCREEN, + "SCREEN", + 0, + "Full Screen", + "Images are rendered in a maximized Image Editor"}, + {USER_RENDER_DISPLAY_AREA, + "AREA", + 0, + "Image Editor", + "Images are rendered in an Image Editor"}, + {USER_RENDER_DISPLAY_WINDOW, + "WINDOW", + 0, + "New Window", + "Images are rendered in a new window"}, + {0, NULL, 0, NULL, NULL}, + }; static const EnumPropertyItem temp_space_display_types[] = { {USER_TEMP_SPACE_DISPLAY_FULLSCREEN, "SCREEN", /* Could be FULLSCREEN, but keeping it consistent with render_display_types */ @@ -4282,6 +4305,11 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Header Position", "Default header position for new space-types"); RNA_def_property_update(prop, 0, "rna_userdef_screen_update_header_default"); + prop = RNA_def_property(srna, "render_display_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, render_display_types); + RNA_def_property_ui_text( + prop, "Render Display Type", "Default location where rendered images will be displayed in"); + static const EnumPropertyItem text_hinting_items[] = { {0, "AUTO", 0, "Auto", ""}, {USER_TEXT_HINTING_NONE, "NONE", 0, "None", ""}, |