Пример #1
0
        public void AbcLoad(bool createMissingNodes)
        {
            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.turnQuadEdges         = settings.turnQuadEdges;
            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(Application.streamingAssetsPath + m_streamDesc.pathToAbc);

            if (m_loaded)
            {
                UpdateAbcTree(m_context, m_abcTreeRoot, m_time, createMissingNodes);
                AlembicStream.s_streams.Add(this);
            }
            else
            {
                Debug.LogError("failed to load alembic at " + Application.streamingAssetsPath + m_streamDesc.pathToAbc);
            }
        }
Пример #2
0
        public void AbcLoad()
        {
            m_time    = 0.0f;
            m_context = aiContext.Create(m_abcTreeRoot.linkedGameObj.GetInstanceID());

            var settings = m_streamDesc.settings;

            m_config.swapHandedness     = settings.swapHandedness;
            m_config.swapFaceWinding    = settings.swapFaceWinding;
            m_config.aspectRatio        = GetAspectRatio(settings.cameraAspectRatio);
            m_config.scaleFactor        = settings.scaleFactor;
            m_config.normalsMode        = settings.normals;
            m_config.tangentsMode       = settings.tangents;
            m_config.turnQuadEdges      = settings.turnQuadEdges;
            m_config.interpolateSamples = settings.interpolateSamples;
#if UNITY_2017_3_OR_NEWER
            m_config.splitUnit = 0x7fffffff;
#else
            m_config.splitUnit = 65000;
#endif
            m_context.SetConfig(ref m_config);
            m_loaded = m_context.Load(Application.streamingAssetsPath + m_streamDesc.pathToAbc);

            if (m_loaded)
            {
                UpdateAbcTree(m_context, m_abcTreeRoot, m_time);
                AlembicStream.s_streams.Add(this);
            }
            else
            {
                Debug.LogError("failed to load alembic at " + Application.streamingAssetsPath + m_streamDesc.pathToAbc);
            }
        }
Пример #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);
            m_context.UpdateSamples(m_time);
            return(true);
        }