Skip to content

Commit

Permalink
USDShaderTest : Work around UsdPreviewSurface token outputs
Browse files Browse the repository at this point in the history
With the update to USD 24.08, these outputs now being created as StringPlugs. This temporary workaround keeps the tests passing while we consider alternative approaches.
  • Loading branch information
murraystevenson committed Aug 28, 2024
1 parent 65b0fe6 commit 32a24e8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/GafferUSDTest/USDShaderTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

import imath

import pxr.Usd

import IECore
import IECoreScene

Expand Down Expand Up @@ -80,6 +82,7 @@ def __assertShaderLoads( self, name, expectedParameters, expectedOutputs ) :

def testLoadUsdPreviewSurface( self ) :

legacyUsdVersion = pxr.Usd.GetVersion()[1] <= 23
self.__assertShaderLoads(
"UsdPreviewSurface",
[
Expand All @@ -99,8 +102,8 @@ def testLoadUsdPreviewSurface( self ) :
( "occlusion", Gaffer.FloatPlug, 1 ),
],
[
( "surface", Gaffer.Plug, None ),
( "displacement", Gaffer.Plug, None ),
( "surface", Gaffer.Plug if legacyUsdVersion else Gaffer.StringPlug, None if legacyUsdVersion else "" ),
( "displacement", Gaffer.Plug if legacyUsdVersion else Gaffer.StringPlug, None if legacyUsdVersion else "" ),
]
)

Expand Down

0 comments on commit 32a24e8

Please sign in to comment.