public void ProcessRecording()
        {
            if (!m_recording)
            {
                return;
            }

            float begin_time = Time.realtimeSinceStartup;

            m_ctx.MarkFrameBegin();
            m_ctx.AddTime(m_time);
            foreach (var recorder in m_capturers)
            {
                recorder.Capture();
            }
            m_ctx.MarkFrameEnd();

            m_time += Time.deltaTime;
            ++m_frameCount;

            m_elapsed = Time.realtimeSinceStartup - begin_time;
            if (m_settings.detailedLog)
            {
                Debug.Log("AlembicRecorder: frame " + m_frameCount + " (" + (m_elapsed * 1000.0f) + " ms)");
            }
        }
Esempio n. 2
0
        void ProcessCapture()
        {
            if (!m_recording || Time.frameCount == m_prevFrame)
            {
                return;
            }
            m_prevFrame = Time.frameCount;
            if (m_captureOnStart && m_ignoreFirstFrame && m_firstFrame)
            {
                m_firstFrame = false;
                return;
            }

            float begin_time = Time.realtimeSinceStartup;

            m_ctx.MarkFrameBegin();
            m_ctx.AddTime(m_time);
            foreach (var recorder in m_capturers)
            {
                recorder.Capture();
            }
            m_ctx.MarkFrameEnd();
            m_time += Time.deltaTime;
            ++m_frameCount;

            m_elapsed = Time.realtimeSinceStartup - begin_time;
            if (m_detailedLog)
            {
                Debug.Log("AlembicExporter: frame " + m_frameCount + " (" + (m_elapsed * 1000.0f) + " ms)");
            }

            if (m_maxCaptureFrame > 0 && m_frameCount >= m_maxCaptureFrame)
            {
                EndCapture();
            }
        }
        public void ProcessRecording()
        {
            if (!m_recording)
            {
                return;
            }

            float begin_time = Time.realtimeSinceStartup;

            // check if there are new GameObjects to capture
            UpdateCaptureNodes();
            if (m_frameCount > 0 && m_newNodes.Count > 0)
            {
                // add invisible sample
                m_ctx.MarkFrameBegin();
                foreach (var node in m_newNodes)
                {
                    node.MarkForceInvisible();
                    node.Capture();
                }
                m_ctx.MarkFrameEnd();
            }
            m_newNodes.Clear();

            // do capture
            m_ctx.MarkFrameBegin();
            m_ctx.AddTime(m_time);
            foreach (var kvp in m_nodes)
            {
                var node = kvp.Value;
                node.Capture();
                if (node.transform == null)
                {
                    m_iidToRemove.Add(node.instanceID);
                }
            }
            m_ctx.MarkFrameEnd();

            // remove deleted GameObjects
            foreach (int iid in m_iidToRemove)
            {
                m_nodes.Remove(iid);
            }
            m_iidToRemove.Clear();

            // advance time
            ++m_frameCount;
            m_timePrev = m_time;
            switch (m_settings.conf.timeSamplingType)
            {
            case aeTimeSamplingType.Uniform:
                m_time = (1.0f / m_settings.conf.frameRate) * m_frameCount;
                break;

            case aeTimeSamplingType.Acyclic:
                m_time += Time.deltaTime;
                break;
            }
            m_elapsed = Time.realtimeSinceStartup - begin_time;

            // wait maximumDeltaTime if timeSamplingType is uniform
            if (m_settings.conf.timeSamplingType == aeTimeSamplingType.Uniform && m_settings.fixDeltaTime)
            {
                AbcAPI.aeWaitMaxDeltaTime();
            }

            if (m_settings.detailedLog)
            {
                Debug.Log("AlembicRecorder: frame " + m_frameCount + " (" + (m_elapsed * 1000.0f) + " ms)");
            }
        }