Ejemplo n.º 1
0
        public void EndCapture()
        {
            if (!m_recording)
            {
                return;
            }

            m_capturers.Clear();
            AbcAPI.aeDestroyContext(m_ctx); // flush archive
            m_ctx        = new AbcAPI.aeContext();
            m_recording  = false;
            m_time       = 0.0f;
            m_frameCount = 0;

            Debug.Log("AlembicExporter: end: " + m_outputPath);
        }
Ejemplo n.º 2
0
        public bool BeginCapture()
        {
            if (m_recording)
            {
                Debug.Log("AlembicExporter: already started");
                return(false);
            }

            // create context and open archive
            m_ctx = AbcAPI.aeCreateContext();
            if (m_ctx.ptr == IntPtr.Zero)
            {
                Debug.LogWarning("aeCreateContext() failed");
                return(false);
            }

            AbcAPI.aeSetConfig(m_ctx, ref m_conf);
            if (!AbcAPI.aeOpenArchive(m_ctx, m_outputPath))
            {
                Debug.LogWarning("aeOpenArchive() failed");
                AbcAPI.aeDestroyContext(m_ctx);
                m_ctx = new AbcAPI.aeContext();
                return(false);
            }

            // create capturers
            if (m_preserveTreeStructure)
            {
                CreateCapturers_Tree();
            }
            else
            {
                CreateCapturers_Flat();
            }

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

            if (m_conf.timeSamplingType == AbcAPI.aeTypeSamplingType.Uniform)
            {
                Time.maximumDeltaTime = (1.0f / m_conf.frameRate);
            }

            Debug.Log("AlembicExporter: start " + m_outputPath);
            return(true);
        }