Exemplo n.º 1
0
        public void usdiUnload()
        {
            if (!m_ctx)
            {
                return;
            }

            usdiWaitAsyncUpdateTask();
            m_asyncUpdate = null;

            int c = m_schemas.Count;

            for (int i = 0; i < c; ++i)
            {
                m_schemas[i].usdiOnUnload();
            }

            m_schemas.Clear();
            m_schemaLUT.Clear();

            usdi.usdiDestroyContext(m_ctx);
            m_ctx = default(usdi.Context);

            usdiLog("UsdStream: unloaded " + m_path.GetFullPath());
        }
Exemplo n.º 2
0
        bool usdiLoad(DataPath path)
        {
            usdiUnload();

            m_path          = path;
            m_path.readOnly = true;
            m_ctx           = usdi.usdiCreateContext();

            var fullpath = m_path.GetFullPath();

            if (!usdi.usdiOpen(m_ctx, fullpath))
            {
                usdi.usdiDestroyContext(m_ctx);
                m_ctx = default(usdi.Context);
                usdiLog("UsdStream: failed to load " + fullpath);
                return(false);
            }

            // apply variant selections
            if (usdiApplyVarianceSelections())
            {
                usdi.usdiRebuildSchemaTree(m_ctx);
            }
            usdiApplyImportConfig(true);

            usdiConstructTrees();

            // fill sample data with initial time
            m_requestForceUpdate = true;
            usdiAsyncUpdate(m_time);
            usdiUpdate(m_time);

            usdiLog("UsdStream: loaded " + fullpath);
            return(true);
        }
Exemplo n.º 3
0
        public bool BeginCapture()
        {
            if (m_recording)
            {
                Debug.Log("UsdExporter: already started");
                return(false);
            }

            // create context and open archive
            m_ctx = usdi.usdiCreateContext();
            if (!usdi.usdiCreateStage(m_ctx, m_outputPath))
            {
                Debug.LogError("UsdExporter: failed to create " + m_outputPath);
                usdi.usdiDestroyContext(m_ctx);
                m_ctx = default(usdi.Context);
                return(false);
            }
            ApplyExportConfig();

            // create capturers
            ConstructCaptureTree();

            m_recording = true;
            //m_time = m_conf.startTime;
            m_frameCount = 0;

            Debug.Log("UsdExporter: start " + m_outputPath);
            return(true);
        }
Exemplo n.º 4
0
        public void EndCapture()
        {
            if (!m_recording)
            {
                return;
            }

            FlushUSD();
            m_capturers.Clear();
            usdi.usdiDestroyContext(m_ctx); // flush archive
            m_ctx        = default(usdi.Context);
            m_recording  = false;
            m_time       = 0.0f;
            m_frameCount = 0;

            Debug.Log("UsdExporter: end: " + m_outputPath);
        }
Exemplo n.º 5
0
 public abstract void CreateUSDObject(usdi.Context ctx, usdi.Schema parent);