Skip to content

Commit 51b22d9

Browse files
authored
Merge pull request #1356 from johnhaddon/materialBindingsAPI
USDScene : Apply UsdShadeMaterialBindingAPI schema as necessary
2 parents 2ce4270 + 8a1776b commit 51b22d9

File tree

8 files changed

+23
-6
lines changed

8 files changed

+23
-6
lines changed

Changes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
10.4.x.x (relative to 10.4.7.0)
22
========
33

4+
Fixes
5+
-----
6+
7+
- USDScene : The UsdShadeMaterialBindingAPI schema is now applied to all prims with material bindings, making the written files compatible with `USD_SHADE_MATERIAL_BINDING_API_CHECK=strict` mode.
48

59
10.4.7.0 (relative to 10.4.6.0)
610
========

SConstruct

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,6 +3121,7 @@ if doConfigure :
31213121

31223122
usdTestEnv["ENV"]["PYTHONPATH"] += os.pathsep + usdPythonPath
31233123
usdTestEnv["ENV"][testEnv["TEST_LIBRARY_PATH_ENV_VAR"]] += os.pathsep + usdLibPath
3124+
usdTestEnv["ENV"]["USD_SHADE_MATERIAL_BINDING_API_CHECK"] = "strict"
31243125

31253126
# setup pluginInfo for custom file format registration
31263127
testSdfPlugInfo = os.path.join( os.getcwd(), "plugins", "usd", "plugInfo.json" )

contrib/IECoreUSD/src/IECoreUSD/USDScene.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,9 @@ USDScene::~USDScene()
708708
}
709709

710710
// Bind the material to this location
711-
pxr::UsdShadeMaterialBindingAPI( m_location->prim ).Bind( mat, pxr::UsdShadeTokens->fallbackStrength, purpose );
711+
pxr::UsdShadeMaterialBindingAPI::Apply( m_location->prim ).Bind(
712+
mat, pxr::UsdShadeTokens->fallbackStrength, purpose
713+
);
712714
}
713715
}
714716
catch( std::exception &e )

contrib/IECoreUSD/test/IECoreUSD/data/arnoldArrayInputs.usda

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#usda 1.0
22

3-
def Sphere "sphere"
3+
def Sphere "sphere" (
4+
prepend apiSchemas = ["MaterialBindingAPI"]
5+
)
46
{
57
rel material:binding = </rampSurface>
68
}

contrib/IECoreUSD/test/IECoreUSD/data/exposedShaderInput.usda

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
def "model"
44
{
55

6-
def Sphere "sphere"
6+
def Sphere "sphere" (
7+
prepend apiSchemas = ["MaterialBindingAPI"]
8+
)
79
{
810
rel material:binding = </model/materials/material1>
911
}

contrib/IECoreUSD/test/IECoreUSD/data/materialPurpose.usda

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
def "model"
44
{
55

6-
def Sphere "sphere"
6+
def Sphere "sphere" (
7+
prepend apiSchemas = ["MaterialBindingAPI"]
8+
)
79
{
810
rel material:binding = </model/materials/material>
911
rel material:binding:full = </model/materials/fullMaterial>

contrib/IECoreUSD/test/IECoreUSD/data/shaderParentLoc.usda

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#usda 1.0
22

3-
def Xform "shaderLocation"
3+
def Xform "shaderLocation" (
4+
prepend apiSchemas = ["MaterialBindingAPI"]
5+
)
46
{
57
rel material:binding = </shaderLocation/materials/testMat>
68

contrib/IECoreUSD/test/IECoreUSD/data/textureParameters.usda

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
def "model"
44
{
55

6-
def Sphere "sphere"
6+
def Sphere "sphere" (
7+
prepend apiSchemas = ["MaterialBindingAPI"]
8+
)
79
{
810
rel material:binding = </model/materials/textureParameterTest>
911
}

0 commit comments

Comments
 (0)