Beispiel #1
0
        private void ReadAnimation()
        {
            var animationType = (AnimationType)_reader.ReadInt32();

            var animation = new Animation(_model, animationType);

            _model.Animations.Add(animation);

            if (_modelFormat >= ModelFormat.Emf3)
            {
                var ignoredModelPartsCount = _reader.ReadInt32();
                for (var i = 0; i < ignoredModelPartsCount; i++)
                {
                    var ignoredModelPartId = _reader.ReadInt32();
                    var modelPart = _model.ModelParts.Single(x => x.Id == ignoredModelPartId);
                    animation.Ignore(modelPart);
                }
            }

            var keyframeCount = _reader.ReadInt32();
            for (var i = 0; i < keyframeCount; i++)
            {
                ReadAnimationKeyframe(animation);
            }
        }