/// <summary> /// Constructs a new scene at the given file path. If the file exists, it is erased, if /// the file is in use or cannot be created, an exception is thrown. /// </summary> public static Scene Create(string filePath) { var stage = UsdStage.CreateNew(filePath); if (stage == null) { throw new ApplicationException("Failed to create: " + filePath); } var scene = new Scene(stage); scene.UpAxis = UpAxes.Y; return(scene); }
public static void MemoryTest() { const int kCount = 100; for (int i = 0; i < kCount; i++) { UsdStage s = UsdStage.CreateInMemory(); if (s == null) { throw new Exception("Init Stage failed"); } s.Dispose(); string tmpName = GetTempFile(); UsdStage ss = UsdStage.CreateNew(tmpName); if (ss == null) { throw new Exception("Init Stage failed"); } ss.Dispose(); System.IO.File.Delete(tmpName); } }