Skip to content

Commit

Permalink
Merge pull request #5421 from ericmehl/fix-goboUSD
Browse files Browse the repository at this point in the history
LightFilterVisualiser : Support USD lights
  • Loading branch information
johnhaddon authored Aug 11, 2023
2 parents 4349d9e + c21709b commit e4b098c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
1.3.x.x (relative to 1.3.1.0)
=======

Improvements
------------

- Viewer : Added visualisation of light filters for USD lights.

Fixes
-----

- Viewer : Fixed crash when visualising lights with a light filter intended for a different renderer.


1.3.1.0 (relative to 1.3.0.0)
=======
Expand Down
11 changes: 11 additions & 0 deletions src/GafferScene/IECoreGLPreview/LightFilterVisualiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ Visualisations LightFilterVisualiser::allVisualisations( const IECore::CompoundO
boost::split( tokens, attributeName, boost::is_any_of(":") );
const IECoreScene::ShaderNetwork *lightShaderNetwork = attributes->member<IECoreScene::ShaderNetwork>( tokens.front() + ":light" );

// If the light is a USD light, the renderer-specific `lightShaderNetwork` won't be valid
if( !lightShaderNetwork )
{
lightShaderNetwork = attributes->member<IECoreScene::ShaderNetwork>( "light" );
}

if( !lightShaderNetwork )
{
continue;
}

// It's possible that we found a light filter defined in world space
// that isn't assigned to a light just yet. If we found a filter in
// light space it must have a valid light shader, though.
Expand Down

0 comments on commit e4b098c

Please sign in to comment.