Skip to content

Commit cfcd628

Browse files
committed
Fix CC test in preparation in independant variant switching
1 parent fbf3061 commit cfcd628

1 file changed

Lines changed: 18 additions & 19 deletions

File tree

test/lib/testComponentVariant.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
import unittest
3333

34-
3534
class ComponentVariantTestCase(unittest.TestCase):
3635
'''
3736
Verify switching component variants on a USD scene.
@@ -146,34 +145,34 @@ def testSwitchVariantFromComponent(self):
146145
# Continuous forwarding happens on the next idle.
147146
cmds.flushIdleQueue()
148147

149-
# TODO FIXME BUG: currently, the EF does not correctly forward the variant switch
150-
# when it happens on a component sub-prim. Currently, all existing
151-
# variant selections are overwritten by the last one. The correct
152-
# behavior should be that the two variant selections are independent
153-
# and can be switched separately, and that both of them are correctly
154-
# forwarded. Change the test to verify the correct behavior once the
155-
# bug is fixed.
156-
# self.verifyChildren(varyingItem, [ufeCubePathStr])
157-
self.verifyChildren(varyingItem, [ufeSpherePathStr])
148+
import AdskUsdComponentCreator as cc
149+
ccSupportsIndependentVariantSwitching = cc.__version_info__ >= (0, 4, 3)
150+
151+
if ccSupportsIndependentVariantSwitching:
152+
self.verifyChildren(varyingItem, [ufeCubePathStr])
153+
else:
154+
# the EF does not correctly forward the variant switch
155+
# when it happens on a component sub-prim.
156+
self.verifyChildren(varyingItem, [ufeSpherePathStr])
158157
self.verifyColor(stage, usdVaryingPathStr + '.' + colorAttributeName, (0.1, 0.8, 0.1))
159158

160159
# Undo: sphere is back.
161160
cmds.undo()
162161

163-
self.verifyChildren(varyingItem, [ufeCubePathStr])
162+
if ccSupportsIndependentVariantSwitching:
163+
self.verifyChildren(varyingItem, [ufeSpherePathStr])
164+
else:
165+
self.verifyChildren(varyingItem, [ufeCubePathStr])
164166
self.verifyColor(stage, usdVaryingPathStr + '.' + colorAttributeName, (0.8, 0.1, 0.1))
165167

166168
# Redo: cube is back.
167169
cmds.redo()
168170

169-
# TODO FIXME BUG: currently, the EF does not correctly forward the variant switch
170-
# when it happens on a component sub-prim. Currently, all existing
171-
# variant selections are overwritten by the last one. The correct
172-
# behavior should be that the two variant selections are independent
173-
# and can be switched separately, and that both of them are correctly
174-
# forwarded. Change the test to verify the correct behavior once the
175-
# bug is fixed.
176-
self.verifyChildren(varyingItem, [ufeSpherePathStr])
171+
if ccSupportsIndependentVariantSwitching:
172+
self.verifyChildren(varyingItem, [ufeCubePathStr])
173+
else:
174+
self.verifyChildren(varyingItem, [ufeSpherePathStr])
175+
177176
self.verifyColor(stage, usdVaryingPathStr + '.' + colorAttributeName, (0.1, 0.8, 0.1))
178177

179178

0 commit comments

Comments
 (0)