diff --git a/CMakeLists.txt b/CMakeLists.txt index 718a251e4..75e87d474 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,9 @@ SET(CMAKE_POLICY_DEFAULT_CMP0092 NEW) CMAKE_MINIMUM_REQUIRED( VERSION 3.22 ) +# Experimental USD importer: disabled, need to opt-in +option(ASSIMP_BUILD_USD_VERBOSE_LOGS "Enable verbose USD import debug logging" off) + # Disabled importers: m3d for 5.1 or later ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_IMPORTER) ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_EXPORTER) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 67eb55ddc..dcc6bd22f 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -935,6 +935,9 @@ SOURCE_GROUP( Extra FILES ${Extra_SRCS}) # USD/USDA/USDC/USDZ support # tinyusdz IF (NOT ASSIMP_BUILD_NO_USD_IMPORTER) + if (ASSIMP_BUILD_USD_VERBOSE_LOGS) + ADD_DEFINITIONS( -DASSIMP_USD_VERBOSE_LOGS) + endif () # Use CMAKE_CURRENT_SOURCE_DIR which provides assimp-local path (CMAKE_SOURCE_DIR is # relative to top-level/main project) set(Tinyusdz_BASE_ABSPATH "${CMAKE_CURRENT_SOURCE_DIR}/../contrib/tinyusdz") diff --git a/contrib/tinyusdz/assimp_tinyusdz_logging.inc b/contrib/tinyusdz/assimp_tinyusdz_logging.inc index 08ea5d5bd..d1e8dd2b6 100644 --- a/contrib/tinyusdz/assimp_tinyusdz_logging.inc +++ b/contrib/tinyusdz/assimp_tinyusdz_logging.inc @@ -29,6 +29,7 @@ #if defined(TINYUSDZ_LOCAL_DEBUG_PRINT) #if defined(__ANDROID__) +#if defined(ASSIMP_USD_VERBOSE_LOGS) // Works well but _extremely_ verbose #define DCOUT(x) \ do { \ @@ -37,14 +38,16 @@ << std::to_string(__LINE__) << " " << x << "\n"; \ TINYUSDZLOGE("tinyusdz", "%s", ss.str().c_str()); \ } while (false) +#else // defined(ASSIMP_USD_VERBOSE_LOGS) // Silent version -//#define DCOUT(x) \ -// do { \ -// std::stringstream ss; \ -// ss << __FILE__ << ":" << __func__ << ":" \ -// << std::to_string(__LINE__) << " " << x << "\n"; \ -// } while (false) -#else +#define DCOUT(x) \ + do { \ + std::stringstream ss; \ + ss << __FILE__ << ":" << __func__ << ":" \ + << std::to_string(__LINE__) << " " << x << "\n"; \ + } while (false) +#endif // defined(ASSIMP_USD_VERBOSE_LOGS) +#else // defined(__ANDROID__) #define DCOUT(x) \ do { \ std::cout << __FILE__ << ":" << __func__ << ":" \