Skip to content

Commit

Permalink
Merge pull request #5655 from johnhaddon/shaderViewContextFix
Browse files Browse the repository at this point in the history
ShaderView : Scope correct context when computing shader
  • Loading branch information
johnhaddon authored Feb 2, 2024
2 parents 76c7350 + 64f0efd commit 56f7513
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
1.3.x.x (relative to 1.3.11.0)
=======

Fixes
-----

- Viewer : Fixed context handling bug in the shader view (#5654).

1.3.11.0 (relative to 1.3.10.0)
========
Expand Down
6 changes: 5 additions & 1 deletion src/GafferSceneUI/ShaderView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ const GafferImage::Display *ShaderView::display() const

std::string ShaderView::shaderPrefix() const
{
IECore::ConstCompoundObjectPtr attributes = inPlug<ShaderPlug>()->attributes();
IECore::ConstCompoundObjectPtr attributes;
{
Context::Scope scope( getContext() );
attributes = inPlug<ShaderPlug>()->attributes();
}
const char *shaders[] = { "surface", "displacement", "shader", nullptr };
for( IECore::CompoundObject::ObjectMap::const_iterator it = attributes->members().begin(), eIt = attributes->members().end(); it != eIt; ++it )
{
Expand Down

0 comments on commit 56f7513

Please sign in to comment.