|
31 | 31 |
|
32 | 32 | import unittest |
33 | 33 |
|
34 | | - |
35 | 34 | class ComponentVariantTestCase(unittest.TestCase): |
36 | 35 | ''' |
37 | 36 | Verify switching component variants on a USD scene. |
@@ -146,34 +145,34 @@ def testSwitchVariantFromComponent(self): |
146 | 145 | # Continuous forwarding happens on the next idle. |
147 | 146 | cmds.flushIdleQueue() |
148 | 147 |
|
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]) |
158 | 157 | self.verifyColor(stage, usdVaryingPathStr + '.' + colorAttributeName, (0.1, 0.8, 0.1)) |
159 | 158 |
|
160 | 159 | # Undo: sphere is back. |
161 | 160 | cmds.undo() |
162 | 161 |
|
163 | | - self.verifyChildren(varyingItem, [ufeCubePathStr]) |
| 162 | + if ccSupportsIndependentVariantSwitching: |
| 163 | + self.verifyChildren(varyingItem, [ufeSpherePathStr]) |
| 164 | + else: |
| 165 | + self.verifyChildren(varyingItem, [ufeCubePathStr]) |
164 | 166 | self.verifyColor(stage, usdVaryingPathStr + '.' + colorAttributeName, (0.8, 0.1, 0.1)) |
165 | 167 |
|
166 | 168 | # Redo: cube is back. |
167 | 169 | cmds.redo() |
168 | 170 |
|
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 | + |
177 | 176 | self.verifyColor(stage, usdVaryingPathStr + '.' + colorAttributeName, (0.1, 0.8, 0.1)) |
178 | 177 |
|
179 | 178 |
|
|
0 commit comments