diff --git a/src/appleseed-max-impl/appleseedrenderer/appleseedrenderer.rc b/src/appleseed-max-impl/appleseedrenderer/appleseedrenderer.rc index c8734bb..4d379ee 100644 --- a/src/appleseed-max-impl/appleseedrenderer/appleseedrenderer.rc +++ b/src/appleseed-max-impl/appleseedrenderer/appleseedrenderer.rc @@ -119,7 +119,7 @@ BEGIN "SpinnerControl",WS_TABSTOP,84,79,6,10 END -IDD_FORMVIEW_RENDERERPARAMS_SYSTEM DIALOGEX 0, 0, 200, 73 +IDD_FORMVIEW_RENDERERPARAMS_SYSTEM DIALOGEX 0, 0, 200, 87 STYLE DS_SETFONT | WS_CHILD | WS_VISIBLE FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN @@ -134,6 +134,8 @@ BEGIN CONTROL "Open Log",IDC_BUTTON_LOG,"CustButton",WS_TABSTOP,110,20,42,12 CONTROL "Log material slots rendering",IDC_CHECK_LOG_MATERIAL_EDITOR, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,0,38,197,10 + CONTROL "Render Stamp",IDC_CHECK_RENDER_STAMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,0,73,59,10 + CONTROL "Render Stamp Format",IDC_TEXT_RENDER_STAMP,"CustEdit",WS_TABSTOP,61,73,137,10 END IDD_DIALOG_LOG DIALOGEX 150, 150, 364, 197 diff --git a/src/appleseed-max-impl/appleseedrenderer/appleseedrendererparamdlg.cpp b/src/appleseed-max-impl/appleseedrenderer/appleseedrendererparamdlg.cpp index 35ea6bf..46242e4 100644 --- a/src/appleseed-max-impl/appleseedrenderer/appleseedrendererparamdlg.cpp +++ b/src/appleseed-max-impl/appleseedrenderer/appleseedrendererparamdlg.cpp @@ -683,6 +683,7 @@ namespace HWND m_rollup; ICustEdit* m_text_renderingthreads; ISpinnerControl* m_spinner_renderingthreads; + ICustEdit* m_text_render_stamp; AppleseedRenderer* m_renderer; SystemPanel( @@ -706,6 +707,7 @@ namespace { ReleaseISpinner(m_spinner_renderingthreads); ReleaseICustEdit(m_text_renderingthreads); + ReleaseICustEdit(m_text_render_stamp); m_rend_params->DeleteRollupPage(m_rollup); } @@ -726,6 +728,17 @@ namespace CheckDlgButton(hwnd, IDC_CHECK_LOW_PRIORITY_MODE, m_settings.m_low_priority_mode ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwnd, IDC_CHECK_USE_MAX_PROCEDURAL_MAPS, m_settings.m_use_max_procedural_maps ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwnd, IDC_CHECK_LOG_MATERIAL_EDITOR, m_settings.m_log_material_editor_messages ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_CHECK_RENDER_STAMP, m_settings.m_enable_render_stamp? BST_CHECKED : BST_UNCHECKED); + + m_text_render_stamp = GetICustEdit(GetDlgItem(hwnd, IDC_TEXT_RENDER_STAMP)); + m_text_render_stamp->SetText(m_settings.m_render_stamp_format); + + enable_disable_controls(); + } + + void enable_disable_controls() + { + m_text_render_stamp->Enable(m_settings.m_enable_render_stamp); } virtual INT_PTR CALLBACK dialog_proc( @@ -736,6 +749,17 @@ namespace { switch (umsg) { + case WM_CUSTEDIT_ENTER: + switch (LOWORD(wparam)) + { + case IDC_TEXT_RENDER_STAMP: + m_text_render_stamp->GetText(m_settings.m_render_stamp_format); + return TRUE; + + default: + return FALSE; + } + case WM_COMMAND: switch (LOWORD(wparam)) { @@ -768,6 +792,11 @@ namespace } break; + case IDC_CHECK_RENDER_STAMP: + m_settings.m_enable_render_stamp = IsDlgButtonChecked(hwnd, IDC_CHECK_RENDER_STAMP) == BST_CHECKED; + enable_disable_controls(); + return TRUE; + default: return FALSE; } diff --git a/src/appleseed-max-impl/appleseedrenderer/datachunks.h b/src/appleseed-max-impl/appleseedrenderer/datachunks.h index d3daf06..0ac325e 100644 --- a/src/appleseed-max-impl/appleseedrenderer/datachunks.h +++ b/src/appleseed-max-impl/appleseedrenderer/datachunks.h @@ -63,3 +63,5 @@ const USHORT ChunkSettingsSystem = 0x1400; const USHORT ChunkSettingsSystemRenderingThreads = 0x1410; const USHORT ChunkSettingsSystemLowPriorityMode = 0x1420; const USHORT ChunkSettingsSystemUseMaxProceduralMaps = 0x1430; +const USHORT ChunkSettingsSystemEnableRenderStamp = 0x1440; +const USHORT ChunkSettingsSystemRenderStampString = 0x1450; diff --git a/src/appleseed-max-impl/appleseedrenderer/projectbuilder.cpp b/src/appleseed-max-impl/appleseedrenderer/projectbuilder.cpp index 9646c19..5a44127 100644 --- a/src/appleseed-max-impl/appleseedrenderer/projectbuilder.cpp +++ b/src/appleseed-max-impl/appleseedrenderer/projectbuilder.cpp @@ -1436,7 +1436,9 @@ namespace .insert("tile_size", asf::Vector2i(settings.m_tile_size)) .insert("color_space", "linear_rgb") .insert("filter", "blackman-harris") - .insert("filter_size", 1.5), + .insert("filter_size", 1.5) + .insert("enable_render_stamp", settings.m_enable_render_stamp) + .insert("render_stamp_format", wide_to_utf8(settings.m_render_stamp_format)), aovs)); if (rend_params.rendType == RENDTYPE_REGION) diff --git a/src/appleseed-max-impl/appleseedrenderer/renderersettings.cpp b/src/appleseed-max-impl/appleseedrenderer/renderersettings.cpp index 8953528..9fb86ce 100644 --- a/src/appleseed-max-impl/appleseedrenderer/renderersettings.cpp +++ b/src/appleseed-max-impl/appleseedrenderer/renderersettings.cpp @@ -71,6 +71,9 @@ namespace const int log_open_mode = load_system_setting(L"LogOpenMode", static_cast(DialogLogTarget::OpenMode::Errors)); m_log_open_mode = static_cast(log_open_mode); m_log_material_editor_messages = load_system_setting(L"LogMaterialEditorMessages", false); + + m_enable_render_stamp = false; + m_render_stamp_format = L"appleseed {lib-version} | Time: {render-time}"; } }; } @@ -245,6 +248,14 @@ bool RendererSettings::save(ISave* isave) const isave->BeginChunk(ChunkSettingsSystemUseMaxProceduralMaps); success &= write(isave, m_use_max_procedural_maps); isave->EndChunk(); + + isave->BeginChunk(ChunkSettingsSystemEnableRenderStamp); + success &= write(isave, m_enable_render_stamp); + isave->EndChunk(); + + isave->BeginChunk(ChunkSettingsSystemRenderStampString); + success &= write(isave, m_render_stamp_format); + isave->EndChunk(); isave->EndChunk(); @@ -469,6 +480,14 @@ IOResult RendererSettings::load_system_settings(ILoad* iload) case ChunkSettingsSystemUseMaxProceduralMaps: result = read(iload, &m_use_max_procedural_maps); break; + + case ChunkSettingsSystemEnableRenderStamp: + result = read(iload, &m_enable_render_stamp); + break; + + case ChunkSettingsSystemRenderStampString: + result = read(iload, &m_render_stamp_format); + break; } if (result != IO_OK) diff --git a/src/appleseed-max-impl/appleseedrenderer/renderersettings.h b/src/appleseed-max-impl/appleseedrenderer/renderersettings.h index 75be609..db2073a 100644 --- a/src/appleseed-max-impl/appleseedrenderer/renderersettings.h +++ b/src/appleseed-max-impl/appleseedrenderer/renderersettings.h @@ -95,6 +95,8 @@ class RendererSettings bool m_use_max_procedural_maps; DialogLogTarget::OpenMode m_log_open_mode; bool m_log_material_editor_messages; + bool m_enable_render_stamp; + MSTR m_render_stamp_format; // Apply these settings to a given project. void apply(renderer::Project& project) const; diff --git a/src/appleseed-max-impl/appleseedrenderer/resource.h b/src/appleseed-max-impl/appleseedrenderer/resource.h index f5a45b6..b5e3bee 100644 --- a/src/appleseed-max-impl/appleseedrenderer/resource.h +++ b/src/appleseed-max-impl/appleseedrenderer/resource.h @@ -53,6 +53,9 @@ #define IDC_STATIC_LOG 602 #define IDC_BUTTON_LOG 603 #define IDC_EDIT_LOG 604 +#define IDC_CHECK_RENDER_STAMP 605 +#define IDC_TEXT_RENDER_STAMP 606 + #define ID_ACCELERATOR_LOG_CTRL_A 40001 // Next default values for new objects