From d326e83cc7ff9a507d7fbd8909a82b1233e3f7d7 Mon Sep 17 00:00:00 2001 From: Herbert Crepaz Date: Tue, 15 Oct 2019 10:08:03 +0300 Subject: [PATCH] Add system and libraries information to render log This fixes issue #313. --- .../appleseedrenderer/appleseedrenderer.cpp | 11 ++- src/appleseed-max-impl/utilities.cpp | 84 +++++++++++++++++++ src/appleseed-max-impl/utilities.h | 13 +++ 3 files changed, 105 insertions(+), 3 deletions(-) diff --git a/src/appleseed-max-impl/appleseedrenderer/appleseedrenderer.cpp b/src/appleseed-max-impl/appleseedrenderer/appleseedrenderer.cpp index 8a653c4..07d3b8c 100644 --- a/src/appleseed-max-impl/appleseedrenderer/appleseedrenderer.cpp +++ b/src/appleseed-max-impl/appleseedrenderer/appleseedrenderer.cpp @@ -54,6 +54,7 @@ // appleseed.foundation headers. #include "foundation/image/canvasproperties.h" #include "foundation/image/image.h" +#include "foundation/platform/system.h" #include "foundation/platform/thread.h" #include "foundation/platform/types.h" #include "foundation/utility/autoreleaseptr.h" @@ -1072,9 +1073,6 @@ void AppleseedRendererPBlockAccessor::Set( AppleseedRendererClassDesc g_appleseed_renderer_classdesc; asf::auto_release_ptr g_dialog_log_target; -#if MAX_RELEASE < 19000 -AppleseedRECompatible g_appleseed_renderelement_compatible; -#endif AppleseedRendererPBlockAccessor g_pblock_accessor; ParamBlockDesc2 g_param_block_desc( @@ -2157,7 +2155,13 @@ int AppleseedRenderer::Render( } if (!m_rend_params.inMtlEdit || m_settings.m_log_material_editor_messages) + { create_log_window(); + print_appleseed_library_information(); + print_appleseed_library_features(); + print_third_party_libraries_information(); + asf::System::print_information(asr::global_logger()); + } if (renderer_settings.m_enable_noise_seed) { @@ -2238,6 +2242,7 @@ int AppleseedRenderer::Render( if (progress_cb) progress_cb->SetTitle(L"Rendering..."); + if (m_settings.m_low_priority_mode) { asf::ProcessPriorityContext background_context( diff --git a/src/appleseed-max-impl/utilities.cpp b/src/appleseed-max-impl/utilities.cpp index 52d0717..a1e2183 100644 --- a/src/appleseed-max-impl/utilities.cpp +++ b/src/appleseed-max-impl/utilities.cpp @@ -41,6 +41,8 @@ #include "renderer/api/texture.h" // appleseed.foundation headers. +#include "foundation/core/appleseed.h" +#include "foundation/core/thirdparties.h" #include "foundation/image/canvasproperties.h" #include "foundation/image/tile.h" #include "foundation/utility/searchpaths.h" @@ -68,6 +70,88 @@ namespace asf = foundation; namespace asr = renderer; +const char* to_enabled_disabled(const bool value) +{ + return value ? "enabled" : "disabled"; +} + +void print_appleseed_library_information() +{ + RENDERER_LOG_INFO( + "appleseed for Autodesk 3ds Max using %s version %s, %s configuration\n" + "compiled on %s at %s using %s version %s\n" + "copyright (c) 2010-2013 Francois Beaune, Jupiter Jazz Limited\n" + "copyright (c) 2014-2019 The appleseedhq Organization\n" + "this software is released under the MIT license (https://opensource.org/licenses/MIT).\n" + "visit https://appleseedhq.net/ for additional information and resources.", + asf::Appleseed::get_lib_name(), + asf::Appleseed::get_lib_version(), + asf::Appleseed::get_lib_configuration(), + asf::Appleseed::get_lib_compilation_date(), + asf::Appleseed::get_lib_compilation_time(), + asf::Compiler::get_compiler_name(), + asf::Compiler::get_compiler_version()); +} + +void print_appleseed_library_features() +{ + const bool WithDisneyMaterial = +#ifdef APPLESEED_WITH_DISNEY_MATERIAL + true; +#else + false; +#endif + + const bool WithEmbree = +#ifdef APPLESEED_WITH_EMBREE + true; +#else + false; +#endif + + const bool WithSpectralSupport = +#ifdef APPLESEED_WITH_SPECTRAL_SUPPORT + true; +#else + false; +#endif + + const bool WithGPUSupport = +#ifdef APPLESEED_WITH_GPU + true; +#else + false; +#endif + + RENDERER_LOG_INFO( + "library features:\n" + " Instruction sets %s\n" + " Disney material with SeExpr %s\n" + " Embree %s\n" + " Spectral support %s\n" + " GPU support %s", + asf::Appleseed::get_lib_cpu_features(), + to_enabled_disabled(WithDisneyMaterial), + to_enabled_disabled(WithEmbree), + to_enabled_disabled(WithSpectralSupport), + to_enabled_disabled(WithGPUSupport)); +} + +void print_third_party_libraries_information() +{ + const asf::LibraryVersionArray versions = asf::ThirdParties::get_versions(); + RENDERER_LOG_INFO("third party libraries:\n"); + for (size_t i = 0, e = versions.size(); i < e; ++i) + { + const asf::APIStringPair& version = versions[i]; + const char* lib_name = version.m_first.c_str(); + const char* lib_version = version.m_second.c_str(); + const size_t lib_name_length = std::strlen(lib_name); + const std::string spacing(30 - lib_name_length, ' '); + RENDERER_LOG_INFO(" %s%s%s", lib_name, spacing.c_str(), lib_version); + } +} + void update_map_buttons(IParamMap2* param_map) { if (param_map == nullptr) diff --git a/src/appleseed-max-impl/utilities.h b/src/appleseed-max-impl/utilities.h index 9a6ebb4..0d5afe8 100644 --- a/src/appleseed-max-impl/utilities.h +++ b/src/appleseed-max-impl/utilities.h @@ -130,6 +130,19 @@ std::string insert_procedural_texture_and_instance( renderer::ParamArray texture_instance_params = renderer::ParamArray()); +// +// Version information functions. +// + +void print_appleseed_library_information(); + +void print_appleseed_library_features(); + +const char* to_enabled_disabled(const bool value); + +void print_third_party_libraries_information(); + + // // Implementation. //