From 27b78c9c94baf6fa43268e851de58da96f7d7123 Mon Sep 17 00:00:00 2001 From: Robert Guetzkow Date: Wed, 13 Jan 2021 11:01:44 +0100 Subject: Compositor: "Save as Render" for the file output node This commit adds the "Save as Render" feature to the file output node, that allows to disable the application of the configured view transform and other color management settings on the image. If disable it uses the standard view transform instead. This feature was originally suggested in T83842 and is part of the color management improvements task in T68926. With this feature it is possible to toggle the application of the color management settings for each input socket of the File Output node individually. Reviewed By: brecht Maniphest Tasks: T68926, T83842 Differential Revision: https://developer.blender.org/D9921 --- source/blender/editors/space_node/drawnode.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 9e07c3d667b..0f02d2165ac 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1884,6 +1884,7 @@ static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, Poi PointerRNA active_input_ptr, op_ptr; uiLayout *row, *col; const bool multilayer = RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_MULTILAYER; + const bool is_exr = RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_OPENEXR; const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0; node_composit_buts_file_output(layout, C, ptr); @@ -1991,8 +1992,15 @@ static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, Poi uiItemL(col, IFACE_("Format:"), ICON_NONE); uiItemR(col, &active_input_ptr, "use_node_format", DEFAULT_FLAGS, NULL, ICON_NONE); + const bool is_socket_exr = RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_OPENEXR; + const bool use_node_format = RNA_boolean_get(&active_input_ptr, "use_node_format"); + + if ((!is_exr && use_node_format) || (!is_socket_exr && !use_node_format)) { + uiItemR(col, &active_input_ptr, "save_as_render", DEFAULT_FLAGS, NULL, ICON_NONE); + } + col = uiLayoutColumn(layout, false); - uiLayoutSetActive(col, RNA_boolean_get(&active_input_ptr, "use_node_format") == false); + uiLayoutSetActive(col, use_node_format == false); uiTemplateImageSettings(col, &imfptr, false); if (is_multiview) { -- cgit v1.2.3