diff --git a/render_delegate/constant_strings.h b/render_delegate/constant_strings.h index 43db6bc862..f914ae3966 100644 --- a/render_delegate/constant_strings.h +++ b/render_delegate/constant_strings.h @@ -283,6 +283,7 @@ ASTR(tflip); ASTR(translation); ASTR(thread_priority); ASTR(threads); +ASTR(total_progress); ASTR(useSpecularWorkflow); ASTR(user_data_float); ASTR(user_data_int); diff --git a/render_delegate/render_delegate.cpp b/render_delegate/render_delegate.cpp index d055ee1af5..c594ccdab0 100644 --- a/render_delegate/render_delegate.cpp +++ b/render_delegate/render_delegate.cpp @@ -58,6 +58,7 @@ TF_DEFINE_PRIVATE_TOKENS(_tokens, (arnold) (openvdbAsset) ((arnoldGlobal, "arnold:global:")) + (percentDone) ); // clang-format on @@ -513,6 +514,16 @@ HdRenderSettingDescriptorList HdArnoldRenderDelegate::GetRenderSettingDescriptor return ret; } +VtDictionary HdArnoldRenderDelegate::GetRenderStats() const +{ + VtDictionary stats; + + float total_progress = 100.0f; + AiRenderGetHintFlt(str::total_progress, total_progress); + stats[_tokens->percentDone] = total_progress; + return stats; +} + HdResourceRegistrySharedPtr HdArnoldRenderDelegate::GetResourceRegistry() const { return _resourceRegistry; } HdRenderPassSharedPtr HdArnoldRenderDelegate::CreateRenderPass( diff --git a/render_delegate/render_delegate.h b/render_delegate/render_delegate.h index df0c26ee38..2bf8fc9eb2 100755 --- a/render_delegate/render_delegate.h +++ b/render_delegate/render_delegate.h @@ -98,6 +98,11 @@ class HdArnoldRenderDelegate final : public HdRenderDelegate { /// possible Render Settings. HDARNOLD_API HdRenderSettingDescriptorList GetRenderSettingDescriptors() const override; + /// Returns an open-format dictionary of render statistics + /// + /// @return VtDictionary holding the render stats. + HDARNOLD_API + VtDictionary GetRenderStats() const override; /// Gets the Resource Registry. /// /// @return Pointer to the shared HdResourceRegistry.