diff --git a/SConstruct b/SConstruct index 6d6220daa0..2fbd0a41f1 100755 --- a/SConstruct +++ b/SConstruct @@ -259,7 +259,7 @@ if env['COMPILER'] in ['gcc', 'clang']: if env['WARN_LEVEL'] == 'none': env.Append(CCFLAGS = Split('-w')) else: - env.Append(CCFLAGS = Split('-Wall -Wsign-compare')) + env.Append(CCFLAGS = Split('-Wall -Wsign-compare -Wno-deprecated-register -Wno-undefined-var-template -Wno-unused-local-typedef')) if env['WARN_LEVEL'] == 'strict': env.Append(CCFLAGS = Split('-Werror')) diff --git a/render_delegate/render_delegate.cpp b/render_delegate/render_delegate.cpp index 9d0ed8b9dd..8ea93a812f 100755 --- a/render_delegate/render_delegate.cpp +++ b/render_delegate/render_delegate.cpp @@ -56,6 +56,7 @@ PXR_NAMESPACE_OPEN_SCOPE TF_DEFINE_PRIVATE_TOKENS(_tokens, (arnold) (openvdbAsset) + ((arnoldGlobal, "arnold:global:")) ); // clang-format on @@ -295,6 +296,11 @@ void _CheckForIntValue(const VtValue& value, F&& f) } } +void _RemoveArnoldGlobalPrefix(const TfToken& key, TfToken& key_new) +{ + key_new = TfStringStartsWith(key, _tokens->arnoldGlobal) ? TfToken{key.GetText() + _tokens->arnoldGlobal.size()} : key; +} + } // namespace std::mutex HdArnoldRenderDelegate::_mutexResourceRegistry; @@ -378,8 +384,11 @@ const TfTokenVector& HdArnoldRenderDelegate::GetSupportedSprimTypes() const { re const TfTokenVector& HdArnoldRenderDelegate::GetSupportedBprimTypes() const { return _SupportedBprimTypes(); } -void HdArnoldRenderDelegate::_SetRenderSetting(const TfToken& key, const VtValue& _value) +void HdArnoldRenderDelegate::_SetRenderSetting(const TfToken& _key, const VtValue& _value) { + TfToken key; + _RemoveArnoldGlobalPrefix(_key, key); + // Currently usdview can return double for floats, so until it's fixed // we have to convert doubles to float. auto value = _value.IsHolding() ? VtValue(static_cast(_value.UncheckedGet())) : _value; @@ -441,15 +450,18 @@ void HdArnoldRenderDelegate::SetRenderSetting(const TfToken& key, const VtValue& _SetRenderSetting(key, value); } -VtValue HdArnoldRenderDelegate::GetRenderSetting(const TfToken& key) const +VtValue HdArnoldRenderDelegate::GetRenderSetting(const TfToken& _key) const { + TfToken key; + _RemoveArnoldGlobalPrefix(_key, key); + if (key == str::t_enable_gpu_rendering) { return VtValue(AiNodeGetStr(_options, str::render_device) == str::GPU); } else if (key == str::t_enable_progressive_render) { bool v = true; AiRenderGetHintBool(str::progressive, v); return VtValue(v); - } else if (key == str::progressive_min_AA_samples) { + } else if (key == str::t_progressive_min_AA_samples) { int v = -4; AiRenderGetHintInt(str::progressive_min_AA_samples, v); return VtValue(v); diff --git a/render_delegate/render_delegate.h b/render_delegate/render_delegate.h index 35f5091f12..df0c26ee38 100755 --- a/render_delegate/render_delegate.h +++ b/render_delegate/render_delegate.h @@ -91,7 +91,7 @@ class HdArnoldRenderDelegate final : public HdRenderDelegate { /// @param key Name of the Render Setting to get. /// @return Value of the Render Setting. HDARNOLD_API - VtValue GetRenderSetting(const TfToken& key) const override; + VtValue GetRenderSetting(const TfToken& _key) const override; /// Gets the list of Render Setting descriptors. /// /// @return std::vector holding HdRenderSettingDescriptor for all the @@ -198,7 +198,7 @@ class HdArnoldRenderDelegate final : public HdRenderDelegate { /// /// @return Name of the preferred material network. HDARNOLD_API - TfToken GetMaterialNetworkSelector() const; + TfToken GetMaterialNetworkSelector() const override; /// Suffixes Node names with the Render Delegate's paths. /// /// @param name Name of the Node. @@ -240,7 +240,7 @@ class HdArnoldRenderDelegate final : public HdRenderDelegate { HdArnoldRenderDelegate(const HdArnoldRenderDelegate&) = delete; HdArnoldRenderDelegate& operator=(const HdArnoldRenderDelegate&) = delete; - void _SetRenderSetting(const TfToken& key, const VtValue& value); + void _SetRenderSetting(const TfToken& _key, const VtValue& value); /// Mutex for the shared Resource Registry. static std::mutex _mutexResourceRegistry; diff --git a/render_delegate/render_pass.h b/render_delegate/render_pass.h index 6eacc9c358..fb7703bbee 100755 --- a/render_delegate/render_pass.h +++ b/render_delegate/render_pass.h @@ -65,7 +65,7 @@ class HdArnoldRenderPass : public HdRenderPass { /// Returns true if the render has converged. /// /// @return True if the render has converged. - bool IsConverged() const { return _isConverged; } + bool IsConverged() const override { return _isConverged; } protected: /// Executing the Render Pass.