Ejemplo n.º 1
0
 [DllImport("AlembicExporter")] public static extern void        aeAddTime(aeContext ctx, float time, int tsi = 1); // relevant only if timeSamplingType is acyclic
Ejemplo n.º 2
0
        /// <summary>
        /// Starts a recording session.
        /// </summary>
        /// <returns>True if succeeded, false otherwise.</returns>
        public bool BeginRecording()
        {
            if (m_recording)
            {
                Debug.LogWarning("AlembicRecorder: already recording");
                return(false);
            }
            if (m_settings.Scope == ExportScope.TargetBranch && TargetBranch == null)
            {
                Debug.LogWarning("AlembicRecorder: target object is not set");
                return(false);
            }


            {
                var dir = Path.GetDirectoryName(m_settings.OutputPath);
                if (!Directory.Exists(dir))
                {
                    try
                    {
                        Directory.CreateDirectory(dir);
                    }
                    catch (Exception)
                    {
                        Debug.LogWarning("AlembicRecorder: Failed to create directory " + dir);
                        return(false);
                    }
                }
            }

            // create context and open archive
            m_ctx = aeContext.Create();
            if (m_ctx.self == IntPtr.Zero)
            {
                Debug.LogWarning("AlembicRecorder: failed to create context");
                return(false);
            }

            m_ctx.SetConfig(m_settings.ExportOptions);
            if (!m_ctx.OpenArchive(m_settings.OutputPath))
            {
                Debug.LogWarning("AlembicRecorder: failed to open file " + m_settings.OutputPath);
                m_ctx.Destroy();
                return(false);
            }

            m_root                         = new RootCapturer(this, m_ctx.topObject);
            m_nodes                        = new Dictionary <int, CaptureNode>();
            m_newNodes                     = new List <CaptureNode>();
            m_iidToRemove                  = new List <int>();
            m_lastTimeSamplingIndex        = 1;
            m_startFrameOfLastTimeSampling = 0;

            // create capturers
            SetupCapturerTable();

            m_recording  = true;
            m_time       = m_timePrev = 0.0f;
            m_frameCount = 0;

            if (m_settings.ExportOptions.TimeSamplingType == TimeSamplingType.Uniform && m_settings.FixDeltaTime)
            {
                Time.maximumDeltaTime = (1.0f / m_settings.ExportOptions.FrameRate);
            }

            Debug.Log("AlembicRecorder: start " + m_settings.OutputPath);
            return(true);
        }
Ejemplo n.º 3
0
 [DllImport("AlembicExporter")] public static extern aeObject    aeGetTopObject(aeContext ctx);
Ejemplo n.º 4
0
 [DllImport("AlembicExporter")] public static extern int         aeAddTimeSampling(aeContext ctx, float start_time);
Ejemplo n.º 5
0
 [DllImport("AlembicExporter")] public static extern void        aeDestroyContext(aeContext ctx);
Ejemplo n.º 6
0
 [DllImport("AlembicExporter")] public static extern bool        aeOpenArchive(aeContext ctx, string path);
Ejemplo n.º 7
0
 [DllImport("AlembicExporter")] public static extern int         aeAddTimeSampling(aeContext ctx, float start_time);
Ejemplo n.º 8
0
 [DllImport("AlembicExporter")] public static extern void        aeAddTime(aeContext ctx, float time, int tsi = 1); // relevant only if timeSamplingType is acyclic
Ejemplo n.º 9
0
 [DllImport("AlembicExporter")] public static extern bool        aeOpenArchive(aeContext ctx, string path);
Ejemplo n.º 10
0
 [DllImport("AlembicExporter")] public static extern aeObject    aeGetTopObject(aeContext ctx);
Ejemplo n.º 11
0
 [DllImport("AlembicExporter")] public static extern void        aeDestroyContext(aeContext ctx);
Ejemplo n.º 12
0
 // relevant only if timeSamplingType is acyclic. if tsi==-1, add time to all time samplings.
 [DllImport("AlembicExporter")] public static extern void        aeAddTime(aeContext ctx, float time, int tsi = -1);
Ejemplo n.º 13
0
 [DllImport("AlembicExporter")] public static extern void        aeSetConfig(aeContext ctx, ref aeConfig conf);
Ejemplo n.º 14
0
 // relevant only if timeSamplingType is acyclic. if tsi==-1, add time to all time samplings.
 [DllImport("AlembicExporter")] public static extern void        aeAddTime(aeContext ctx, float time, int tsi = -1);
Ejemplo n.º 15
0
 [DllImport("AlembicExporter")] public static extern void        aeSetConfig(aeContext ctx, ref aeConfig conf);