The geometry in this scene is a grid of grids. The top-level grid is made up of USD proxy shape nodes. Each of those proxy shape nodes references a USD file that contains a single Mesh prim that is a grid of cubes. This single cube grid mesh is the result of combining the grid of cube asset meshes referenced from the "ModelRefs" test below. The camera in the scene is positioned in a side view. """ self._testName = 'CombinedMesh' self._RunPerfTest() def testPerfGridOfCubeGridsModelRefs(self): """ Tests selection correctness and performance with a grid of proxy shape nodes. The geometry in this scene is a grid of grids. The top-level grid is made up of USD proxy shape nodes. Each of those proxy shape nodes references a USD file with many references to a "CubeModel" asset USD file. This results in equivalent geometry but a higher prim/mesh count than the "CombinedMesh" test above. The camera in the scene is positioned in a side view. """ self._testName = 'ModelRefs' self._RunPerfTest() if __name__ == '__main__': fixturesUtils.runTests(globals())
sessionLayer = stage.GetSessionLayer() sessionLayer.customLayerData = { 'variant_fallbacks': json.dumps(customVariantFallbacks) } # restore default pxr.Usd.Stage.SetGlobalVariantFallbacks(defaultGlobalVariantFallbacks) # create the proxy node with stage cache id proxyName = cmds.AL_usdmaya_ProxyShapeImport( stageId=stageCacheId.ToLongInt())[0] proxyShape = AL.usdmaya.ProxyShape.getByName(proxyName) return proxyShape, proxyName def test_fromSessionLayer(self): # this will create a C++ type of: std::vector<VtValue> custom = {'geo': ['sphere']} proxyShape, proxyName = self._prepSessionLayer(custom) # the "sphere" variant prim should be loaded prim = proxyShape.getUsdStage().GetPrimAtPath( '/root/GEO/sphere1/sphereShape1') self.assertTrue(prim.IsValid()) # the custom variant fallback should be saved to the attribute savedAttrValue = cmds.getAttr(proxyName + '.variantFallbacks') self.assertEqual(savedAttrValue, json.dumps(custom)) if __name__ == "__main__": fixturesUtils.runTests(globals(), verbosity=2)