Example #1
0
        public bool AbcLoad(bool createMissingNodes, bool initialImport)
        {
            m_time    = 0.0f;
            m_context = aiContext.Create(m_abcTreeRoot.gameObject.GetInstanceID());

            var settings = m_streamDesc.Settings;

            m_config.swapHandedness        = settings.SwapHandedness;
            m_config.flipFaces             = settings.FlipFaces;
            m_config.aspectRatio           = GetAspectRatio(settings.CameraAspectRatio);
            m_config.scaleFactor           = settings.ScaleFactor;
            m_config.normalsMode           = settings.Normals;
            m_config.tangentsMode          = settings.Tangents;
            m_config.interpolateSamples    = settings.InterpolateSamples;
            m_config.importPointPolygon    = settings.ImportPointPolygon;
            m_config.importLinePolygon     = settings.ImportLinePolygon;
            m_config.importTrianglePolygon = settings.ImportTrianglePolygon;

            m_context.SetConfig(ref m_config);
            m_loaded = m_context.Load(m_streamDesc.PathToAbc);

            if (m_loaded)
            {
                UpdateAbcTree(m_context, m_abcTreeRoot, m_time, createMissingNodes, initialImport);
                s_streams.Add(this);
            }
            else
            {
                Debug.LogError("failed to load alembic at " + m_streamDesc.PathToAbc);
            }

            return(m_loaded);
        }
        // returns false if the context needs to be recovered.
        public bool AbcUpdateBegin(double time)
        {
            if (m_streamInterupted)
            {
                return(true);
            }
            if (!abcIsValid || !m_loaded)
            {
                return(false);
            }

            m_time = time;
            m_context.SetConfig(ref m_config);
            AbcBeforeUpdateSamples(m_abcTreeRoot);
            m_context.UpdateSamples(m_time);
            return(true);
        }
Example #3
0
        // returns false if the context needs to be recovered.
        public bool AbcUpdateBegin(double time)
        {
            if (m_streamInterupted)
            {
                return(true);
            }
            if (!abcIsValid || !m_loaded)
            {
                return(false);
            }

            m_time = time;
            m_context.SetConfig(ref m_config);
            AbcBeforeUpdateSamples(m_abcTreeRoot);

            var updateJob = new UpdateSamplesJob {
                context = m_context, time = m_time
            };

            udateJobHandle = updateJob.Schedule();
            return(true);
        }