Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAYA-128783 - Material api: hasMaterial UFE version check #3066

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/mayaUsd/ufe/UsdMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ std::vector<Ufe::SceneItem::Ptr> UsdMaterial::getMaterials() const
return materials;
}

#if (UFE_PREVIEW_VERSION_NUM >= 5002)
#if (UFE_PREVIEW_VERSION_NUM >= 5003)

bool UsdMaterial::hasMaterial() const
{
Expand Down
2 changes: 1 addition & 1 deletion lib/mayaUsd/ufe/UsdMaterial.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class MAYAUSD_CORE_PUBLIC UsdMaterial : public Ufe::Material

std::vector<Ufe::SceneItem::Ptr> getMaterials() const override;

#if (UFE_PREVIEW_VERSION_NUM >= 5002)
#if (UFE_PREVIEW_VERSION_NUM >= 5003)
bool hasMaterial() const override;
#endif

Expand Down
8 changes: 4 additions & 4 deletions test/lib/ufe/testMaterial.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _StartTest(self, testName):

# methods:
# - getMaterials
# - hasMaterial (since UFE version 0.5.2 , or '5002')
# - hasMaterial (since UFE version 0.5.3 , or '5003')

def testUsdNoMaterial(self):
"""
Expand All @@ -88,7 +88,7 @@ def testUsdNoMaterial(self):
materials = materialInterface.getMaterials()
self.assertEqual(len(materials), 0)

if(os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') >= '5002'):
if(os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') >= '5003'):
hasAnyMaterial = materialInterface.hasMaterial()
self.assertFalse(hasAnyMaterial)

Expand All @@ -108,7 +108,7 @@ def testUsdSingleMaterial(self):
materials = materialInterface.getMaterials()
self.assertEqual(len(materials), 1)

if(os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') >= '5002'):
if(os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') >= '5003'):
hasAnyMaterial = materialInterface.hasMaterial()
self.assertTrue(hasAnyMaterial)

Expand All @@ -128,7 +128,7 @@ def testUsdMultipleMaterials(self):
materials = materialInterface.getMaterials()
self.assertEqual(len(materials), 2)

if(os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') >= '5002'):
if(os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') >= '5003'):
hasAnyMaterial = materialInterface.hasMaterial()
self.assertTrue(hasAnyMaterial)

Expand Down