/// <summary> /// Ensure each layer path is expressed in the USD sub layer stack of the given scene, /// creating the sublayer USD files if needed. /// </summary> public void SaveLayerStack(Scene scene, string[] layerStack) { if (scene == null) { throw new NullReferenceException("Null scene provided to SaveLayerStack"); } SdfSubLayerProxy subLayers = scene.Stage.GetRootLayer().GetSubLayerPaths(); for (int i = 0; i < m_layerStack.Length; i++) { string absoluteLayerPath = m_layerStack[i]; string relativeLayerPath = ImporterBase.MakeRelativePath(scene.FilePath, absoluteLayerPath); if (!System.IO.File.Exists(absoluteLayerPath)) { var newSubLayer = Scene.Create(absoluteLayerPath); SetupNewSubLayer(scene, newSubLayer); newSubLayer.Save(); newSubLayer.Close(); } if (subLayers.Count(relativeLayerPath) == 0) { subLayers.push_back(relativeLayerPath); } } scene.Save(); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SdfSubLayerProxy obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }