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.
This commit is contained in:
@@ -465,7 +465,6 @@ class TOPBAR_MT_render(Menu):
|
||||
|
||||
layout.operator("render.view_show", text="View Render")
|
||||
layout.operator("render.play_rendered_anim", text="View Animation")
|
||||
layout.prop_menu_enum(rd, "display_mode", text="Display Mode")
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
||||
@@ -265,6 +265,25 @@ class USERPREF_PT_interface_editors(PreferencePanel, Panel):
|
||||
flow.prop(view, "factor_display_type")
|
||||
|
||||
|
||||
class USERPREF_PT_interface_temporary_windows(PreferencePanel, Panel):
|
||||
bl_label = "Temporary Windows"
|
||||
bl_parent_id = "USERPREF_PT_interface_editors"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
prefs = context.preferences
|
||||
return (prefs.active_section == 'INTERFACE')
|
||||
|
||||
def draw_props(self, context, layout):
|
||||
prefs = context.preferences
|
||||
view = prefs.view
|
||||
|
||||
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
||||
|
||||
flow.prop(view, "render_display_type", text="Render in")
|
||||
|
||||
|
||||
class USERPREF_PT_interface_menus(Panel):
|
||||
bl_space_type = 'PREFERENCES'
|
||||
bl_region_type = 'WINDOW'
|
||||
@@ -2119,6 +2138,7 @@ classes = (
|
||||
|
||||
USERPREF_PT_interface_display,
|
||||
USERPREF_PT_interface_editors,
|
||||
USERPREF_PT_interface_temporary_windows,
|
||||
USERPREF_PT_interface_translation,
|
||||
USERPREF_PT_interface_text,
|
||||
USERPREF_PT_interface_menus,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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", ""},
|
||||
|
||||
Reference in New Issue
Block a user