Пример #1
0
        public ElData ToData()
        {
            baseData = baseData ?? new ElData();
            baseData.Child("AnimationName").SetValues("\"" + this.AnimationName + "\"");
            baseData.Child("AnimationTime").SetValues(this.AnimationTime.ToString());
            baseData.Child("FrameParSecond").SetValues(this.FramesPerSecond.ToString());
            baseData.Child("TransitionTime").SetValues(this.TransitionTime.ToString());
            baseData.Child("Priority").SetValues(this.Priority.ToString());
            baseData.Child("Loop").SetValues(this.Loop.ToString());

            if (this.BoneAnimation.Any())
            {
                baseData.Child("BoneAnimation").Children =
                    this.BoneAnimation.Select(_ => _.ToData())
                    .StartWith(new ElData("TimeKeys")
                {
                    Children = this.BoneAnimationTimeKeys.Select(f => new ElData().SetValues(f.ToString("0.000000"))).ToList(),
                }).ToList();
            }
            else
            {
                baseData.RemoveChildren("BoneAnimation");
            }

            if (this.UVAnimation.Any())
            {
                baseData.Child("UVAnimation").Children =
                    this.UVAnimation.Select(_ => _.ToData())
                    .StartWith(new ElData("TimeKeys")
                {
                    Children = this.UVAnimationTimeKeys.Select(f => new ElData().SetValues(f.ToString("0.000000"))).ToList(),
                }).ToList();
            }
            else
            {
                baseData.RemoveChildren("UVAnimation");
            }

            return(baseData);
        }
Пример #2
0
        public ElData ToData()
        {
            baseData      = baseData ?? new ElData();
            baseData.Name = "Mesh";
            baseData.Child("Name").SetValues("\"" + this.Name + "\"");
            baseData.Child("VertexCount").SetValues(this.Positions.Count.ToString());
            baseData.Child("FaceCount").SetValues(this.VertexIndices.Count.ToString());
            baseData.Child("Positions").Children = this.Positions.Select(_ => new ElData().SetValues(_.Select(f => f.ToString("0.000000")))).ToList();
            baseData.Child("Normals").Children   = this.Normals.Select(_ => new ElData().SetValues(_.Select(f => f.ToString("0.000000")))).ToList();
            baseData.Child("BlendList").Children = this.BlendList.Select(_ => _.ToData()).ToList();

            baseData.RemoveChildren("TextureUV");

            for (int i = 1; i < 9; i++)
            {
                baseData.RemoveChildren("Texture" + i + "UV");
            }

            if (this.TextureUV.Any())
            {
                if (this.TextureUV.Count == 1)
                {
                    baseData.Child("TextureUV").Children = this.TextureUV.First().Value.Select(_ => new ElData().SetValues(_.Select(f => f.ToString("0.000000")))).ToList();
                }
                else
                {
                    foreach (var i in this.TextureUV)
                    {
                        baseData.Child("Texture" + i.Key + "UV").Children = i.Value.Select(_ => new ElData().SetValues(_.Select(f => f.ToString("0.000000")))).ToList();
                    }
                }
            }

            baseData.Child("VertexIndices").Children = this.VertexIndices.Select(_ => new ElData().SetValues(new[] { _.Length + "," + _.First().ToString() }.Concat(_.Skip(1).Select(i => i.ToString())))).ToList();
            baseData.Child("Attributes").Children    = this.Attributes.Select(_ => new ElData().SetValues(_.ToString())).ToList();

            return(baseData);
        }
Пример #3
0
        public ElData ToData()
        {
            baseData      = baseData ?? new ElData();
            baseData.Name = "Setting";
            baseData.Child("ElfreinaSoftVersion").SetValues(this.ElfreinaSoftVersion.ToString("0.00"));

            if (this.ElfreinaBetaVersion == 0)
            {
                baseData.RemoveChildren("ElfreinaBetaVersion");
            }
            else
            {
                baseData.Child("ElfreinaBetaVersion").SetValues(this.ElfreinaBetaVersion.ToString());
            }

            baseData.Child("LoadType").SetValues("\"" + this.LoadType + "\"");
            baseData.Child("IsRightHand").SetValues(this.IsRightHand.ToString());

            return(baseData);
        }
Пример #4
0
        public ElData ToData()
        {
            baseData = baseData ?? new ElData();
            baseData.Child("AnimationName").SetValues("\"" + this.AnimationName + "\"");
            baseData.Child("AnimationTime").SetValues(this.AnimationTime.ToString());
            baseData.Child("FrameParSecond").SetValues(this.FramesPerSecond.ToString());
            baseData.Child("TransitionTime").SetValues(this.TransitionTime.ToString());
            baseData.Child("Priority").SetValues(this.Priority.ToString());
            baseData.Child("Loop").SetValues(this.Loop.ToString());

            if (this.BoneAnimation.Any())
                baseData.Child("BoneAnimation").Children =
                    this.BoneAnimation.Select(_ => _.ToData())
                        .StartWith(new ElData("TimeKeys")
                        {
                            Children = this.BoneAnimationTimeKeys.Select(f => new ElData().SetValues(f.ToString("0.000000"))).ToList(),
                        }).ToList();
            else
                baseData.RemoveChildren("BoneAnimation");

            if (this.UVAnimation.Any())
                baseData.Child("UVAnimation").Children =
                    this.UVAnimation.Select(_ => _.ToData())
                        .StartWith(new ElData("TimeKeys")
                        {
                            Children = this.UVAnimationTimeKeys.Select(f => new ElData().SetValues(f.ToString("0.000000"))).ToList(),
                        }).ToList();
            else
                baseData.RemoveChildren("UVAnimation");

            return baseData;
        }
Пример #5
0
        public ElData ToData()
        {
            baseData = baseData ?? new ElData();
            baseData.Name = "Setting";
            baseData.Child("ElfreinaSoftVersion").SetValues(this.ElfreinaSoftVersion.ToString("0.00"));

            if (this.ElfreinaBetaVersion == 0)
                baseData.RemoveChildren("ElfreinaBetaVersion");
            else
                baseData.Child("ElfreinaBetaVersion").SetValues(this.ElfreinaBetaVersion.ToString());

            baseData.Child("LoadType").SetValues("\"" + this.LoadType + "\"");
            baseData.Child("IsRightHand").SetValues(this.IsRightHand.ToString());

            return baseData;
        }
Пример #6
0
        public ElData ToData()
        {
            baseData = baseData ?? new ElData();
            baseData.Name = "Mesh";
            baseData.Child("Name").SetValues("\"" + this.Name + "\"");
            baseData.Child("VertexCount").SetValues(this.Positions.Count.ToString());
            baseData.Child("FaceCount").SetValues(this.VertexIndices.Count.ToString());
            baseData.Child("Positions").Children = this.Positions.Select(_ => new ElData().SetValues(_.Select(f => f.ToString("0.000000")))).ToList();
            baseData.Child("Normals").Children = this.Normals.Select(_ => new ElData().SetValues(_.Select(f => f.ToString("0.000000")))).ToList();
            baseData.Child("BlendList").Children = this.BlendList.Select(_ => _.ToData()).ToList();

            baseData.RemoveChildren("TextureUV");

            for (int i = 1; i < 9; i++)
                baseData.RemoveChildren("Texture" + i + "UV");

            if (this.TextureUV.Any())
                if (this.TextureUV.Count == 1)
                    baseData.Child("TextureUV").Children = this.TextureUV.First().Value.Select(_ => new ElData().SetValues(_.Select(f => f.ToString("0.000000")))).ToList();
                else
                    foreach (var i in this.TextureUV)
                        baseData.Child("Texture" + i.Key + "UV").Children = i.Value.Select(_ => new ElData().SetValues(_.Select(f => f.ToString("0.000000")))).ToList();

            baseData.Child("VertexIndices").Children = this.VertexIndices.Select(_ => new ElData().SetValues(new[] { _.Length + "," + _.First().ToString() }.Concat(_.Skip(1).Select(i => i.ToString())))).ToList();
            baseData.Child("Attributes").Children = this.Attributes.Select(_ => new ElData().SetValues(_.ToString())).ToList();

            return baseData;
        }