Skip to content

Commit e541ae2

Browse files
authored
Exposed the html report file in the render settings reader / render delegate (#2253)
1 parent 4564d20 commit e541ae2

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed

libs/common/constant_strings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ ASTR2(primvars_arnold_light, "primvars:arnold:light");
8484
ASTR2(log_file, "log:file");
8585
ASTR2(log_verbosity, "log:verbosity");
8686
ASTR2(profile_file, "profile:file");
87+
ASTR2(report_file, "report:file");
8788
ASTR2(stats_file, "stats:file");
8889
ASTR2(stats_mode, "stats:mode");
8990
ASTR2(outputs_color, "outputs:color");

libs/common/rendersettings_utils.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ TF_DEFINE_PRIVATE_TOKENS(_tokens,
4848
((colorManagerEntry, "arnold:color_manager:node_entry"))
4949
((logFile, "arnold:global:log:file"))
5050
((logVerbosity, "arnold:global:log:verbosity"))
51+
((reportFile, "arnold:global:report:file"))
5152
((statsFile, "arnold:global:stats:file"))
5253
((statsMode, "arnold:global:stats:mode"))
5354
((profileFile, "arnold:global:profile:file"))
@@ -873,6 +874,15 @@ AtNode* ReadRenderSettings(const UsdPrim &renderSettingsPrim, ArnoldAPIAdapter &
873874
}
874875
}
875876

877+
// html report file
878+
if (UsdAttribute reportFileAttr = renderSettingsPrim.GetAttribute(_tokens->reportFile)) {
879+
VtValue reportFileValue;
880+
if (reportFileAttr.Get(&reportFileValue, time.frame)) {
881+
const std::string reportFile = VtValueGetString(reportFileValue);
882+
AiReportSetFileName(reportFile.c_str());
883+
}
884+
}
885+
876886
// stats file
877887
if (UsdAttribute statsFileAttr = renderSettingsPrim.GetAttribute(_tokens->statsFile)) {
878888
VtValue statsFileValue;

libs/render_delegate/config.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ TF_DEFINE_ENV_SETTING(HDARNOLD_interactive_fps_min, "5.0", "Minimum fps for prog
9898

9999
TF_DEFINE_ENV_SETTING(HDARNOLD_profile_file, "", "Output file for profiling information.");
100100

101+
TF_DEFINE_ENV_SETTING(HDARNOLD_report_file, "", "Output file for the Arnold HTML report file");
102+
101103
TF_DEFINE_ENV_SETTING(HDARNOLD_stats_file, "", "Output file for stats information.");
102104

103105
TF_DEFINE_ENV_SETTING(HDARNOLD_texture_searchpath, "", "Texture search path.");
@@ -118,6 +120,7 @@ HdArnoldConfig::HdArnoldConfig()
118120
log_file = TfGetEnvSetting(HDARNOLD_log_file);
119121
log_flags_console = TfGetEnvSetting(HDARNOLD_log_flags_console);
120122
log_flags_file = TfGetEnvSetting(HDARNOLD_log_flags_file);
123+
report_file = TfGetEnvSetting(HDARNOLD_report_file);
121124
stats_file = TfGetEnvSetting(HDARNOLD_stats_file);
122125
threads = TfGetEnvSetting(HDARNOLD_threads);
123126
AA_samples = TfGetEnvSetting(HDARNOLD_AA_samples);

libs/render_delegate/config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ struct HdArnoldConfig {
163163
///
164164
std::string profile_file; ///< Output file for profiling data.
165165

166+
/// Use HDARNOLD_report_file to set the value.
167+
///
168+
std::string report_file; ///< Output file for html report data.
169+
166170
/// Use HDARNOLD_stats_file to set the value.
167171
///
168172
std::string stats_file; ///< Output file for stats data.

libs/render_delegate/render_delegate.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ const SupportedRenderSettings& _GetSupportedRenderSettings()
335335
{str::t_ignore_smoothing, {"Ignore Smoothing"}},
336336
{str::t_ignore_sss, {"Ignore SubSurface Scattering"}},
337337
{str::t_ignore_operators, {"Ignore Operators"}},
338+
// HTML Report Settings
339+
{str::t_report_file, {"HTML Report Path", config.report_file}},
338340
// Log Settings
339341
{str::t_log_verbosity, {"Log Verbosity (0-5)", config.log_verbosity}},
340342
{str::t_log_file, {"Log File Path", config.log_file}},
@@ -691,6 +693,11 @@ void HdArnoldRenderDelegate::_SetRenderSetting(const TfToken& _key, const VtValu
691693
_logFile = value.UncheckedGet<std::string>();
692694
AiMsgSetLogFileName(_logFile.c_str());
693695
}
696+
} else if (key == str::t_report_file) {
697+
if (value.IsHolding<std::string>()) {
698+
_reportFile = value.UncheckedGet<std::string>();
699+
AiReportSetFileName(_reportFile.c_str());
700+
}
694701
} else if (key == str::t_stats_file) {
695702
if (value.IsHolding<std::string>()) {
696703
_statsFile = value.UncheckedGet<std::string>();
@@ -983,6 +990,8 @@ VtValue HdArnoldRenderDelegate::GetRenderSetting(const TfToken& _key) const
983990
return VtValue(ArnoldUsdGetLogVerbosityFromFlags(_verbosityLogFlags));
984991
} else if (key == str::t_log_file) {
985992
return VtValue(_logFile);
993+
} else if (key == str::t_report_file) {
994+
return VtValue(_reportFile);
986995
} else if (key == str::t_stats_file) {
987996
return VtValue(_statsFile);
988997
} else if (key == str::t_stats_mode) {

libs/render_delegate/render_delegate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ class HdArnoldRenderDelegate final : public HdRenderDelegate {
766766
AtNode* _procParent = nullptr;
767767
AtSessionMode _renderSessionType = AI_SESSION_INTERACTIVE;
768768
std::string _logFile;
769+
std::string _reportFile;
769770
std::string _statsFile;
770771
AtStatsMode _statsMode;
771772
std::string _profileFile;

0 commit comments

Comments
 (0)