void OnEnable()
        {
            // Should not be needed...
            bool newPlayerSettings = false;

            if (m_PlaybackSettings == null)
            {
                m_PlaybackSettings = new AlembicPlaybackSettings();
                newPlayerSettings  = true;
            }

            if (_stream == null)
            {
                if (m_StreamDescriptor == null)
                {
                    return;
                }

                _stream = new AlembicStream(gameObject, m_StreamDescriptor.m_ImportSettings, m_PlaybackSettings, m_Diagnotics);
                Stream.AbcLoad(false);

                // Safety net...
                if (newPlayerSettings)
                {
                    m_PlaybackSettings.m_startTime = Stream.AbcStartTime;
                    m_PlaybackSettings.m_endTime   = Stream.AbcEndTime;
                }
            }

            // Re-importing the asset will create a new import settings asset and the stream will be holding on to an old one...
            if (Stream.ImportSettings != m_StreamDescriptor.m_ImportSettings)
            {
                Stream.ImportSettings = m_StreamDescriptor.m_ImportSettings;
            }
        }
Пример #2
0
        public AlembicStream(GameObject rootGo, AlembicImportSettings importSettings, AlembicPlaybackSettings playSettings, AlembicDiagnosticSettings diagSettings)
        {
            _alembicTreeRoot = new AlembicTreeNode()
            {
                stream = this, linkedGameObj = rootGo
            };
            ImportSettings     = importSettings;
            m_playbackSettings = playSettings;
            m_diagSettings     = diagSettings ?? new AlembicDiagnosticSettings();

            AbcAPI.aiEnableFileLog(m_diagSettings.m_logToFile, m_diagSettings.m_logPath);
        }