Skip to content

Commit

Permalink
Implementing GetRenderStats and returning percentage done. (#538)
Browse files Browse the repository at this point in the history
Fixes #537
  • Loading branch information
sirpalee authored Sep 17, 2020
1 parent ecef07c commit 19e9f55
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions render_delegate/constant_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 11 additions & 0 deletions render_delegate/render_delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ TF_DEFINE_PRIVATE_TOKENS(_tokens,
(arnold)
(openvdbAsset)
((arnoldGlobal, "arnold:global:"))
(percentDone)
);
// clang-format on

Expand Down Expand Up @@ -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(
Expand Down
5 changes: 5 additions & 0 deletions render_delegate/render_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 19e9f55

Please sign in to comment.