Exemplo n.º 1
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            node.AddSerializedVersion(GetSerializedVersion(container.ExportVersion));
            node.Add(WidthName, Width);
            node.Add(HeightName, Height);
            node.Add(CompleteImageSizeName, CompleteImageSize);
            node.Add(TextureFormatName, (int)TextureFormat);
            node.Add(MipCountName, MipCount);
            node.Add(IsReadableName, IsReadable);
            if (IsReadStreamingMipmaps(container.ExportVersion))
            {
                node.Add(StreamingMipmapsName, StreamingMipmaps);
            }
            if (IsReadStreamingMipmapsPriority(container.ExportVersion))
            {
                node.Add(StreamingMipmapsPriorityName, StreamingMipmapsPriority);
            }
            node.Add(AlphaIsTransparencyName, GetAlphaIsTransparency(container.Version, container.Flags));
            node.Add(ImageCountName, ImageCount);
            node.Add(TextureDimensionName, (int)TextureDimension);
            node.Add(TextureSettingsName, TextureSettings.ExportYAML(container));
            node.Add(LightmapFormatName, (int)LightmapFormat);
            node.Add(ColorSpaceName, (int)ColorSpace);
            IReadOnlyList <byte> imageData = GetExportImageData();

            node.Add(ImageDataName, imageData.Count);
            node.Add(TypelessdataName, imageData.ExportYAML());
            StreamingInfo streamData = new StreamingInfo(true);

            node.Add(StreamDataName, streamData.ExportYAML(container));
            return(node);
        }
Exemplo n.º 2
0
        protected sealed override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            if (HasColorSpace(container.ExportVersion))
            {
                node.Add(ColorSpaceName, (int)ColorSpace);
            }
            node.Add(FormatName, (int)Format);
            node.Add(WidthName, Width);
            node.Add(HeightName, Height);
            node.Add(DepthName, Depth);
            node.Add(MipCountName, MipCount);
            node.Add(DataSizeName, DataSize);
            node.Add(TextureSettingsName, TextureSettings.ExportYAML(container));
            node.Add(IsReadableName, IsReadable);
            IReadOnlyList <byte> imageData = GetImageData(container.Version);

            node.Add(ImageDataName, imageData.Count);
            node.Add(TypelessdataName, imageData.ExportYAML());
            StreamingInfo streamData = new StreamingInfo(true);

            node.Add(StreamDataName, streamData.ExportYAML(container));
            return(node);
        }
Exemplo n.º 3
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            node.AddSerializedVersion(GetSerializedVersion(container.ExportVersion));
            node.Add(SubMeshesName, GetSubMeshes(container.Version).ExportYAML(container));
            node.Add(ShapesName, GetShapes(container.Version).ExportYAML(container));
            node.Add(BindPoseName, GetBindPoses(container.Version).ExportYAML(container));
            node.Add(BoneNameHashesName, GetBoneNameHashes(container.Version).ExportYAML(true));
            node.Add(RootBoneNameHashName, RootBoneNameHash);
            if (IsReadBonesAABB(container.ExportVersion))
            {
                node.Add(BonesAABBName, GetBonesAABB(container.Version).ExportYAML(container));
                node.Add(VariableBoneCountWeightsName, GetVariableBoneCountWeights(container.Version).ExportYAML(container));
            }
            node.Add(MeshCompressionName, (byte)MeshCompression);
            node.Add(IsReadableName, IsReadable);
            node.Add(KeepVerticesName, KeepVertices);
            node.Add(KeepIndicesName, KeepIndices);
            node.Add(IndexFormatName, (int)IndexFormat);
            node.Add(IndexBufferName, GetIndexBuffer(container.Version, container.Platform).ExportYAML());
            node.Add(SkinName, GetSkin(container.Version).ExportYAML(container));
            node.Add(VertexDataName, GetVertexData(container.Version).ExportYAML(container));
            node.Add(CompressedMeshName, CompressedMesh.ExportYAML(container));
            node.Add(LocalAABBName, LocalAABB.ExportYAML(container));
            node.Add(MeshUsageFlagsName, MeshUsageFlags);
            node.Add(BakedConvexCollisionMeshName, GetBakedConvexCollisionMesh(container.Version).ExportYAML());
            node.Add(BakedTriangleCollisionMeshName, GetBakedTriangleCollisionMesh(container.Version).ExportYAML());
            if (IsReadMeshOptimizationFlags(container.ExportVersion, container.ExportFlags))
            {
                node.Add(MeshOptimizationFlagsName, (int)GetMeshOptimizationFlags(container.Version, container.Flags));
            }
            else
            {
                node.Add(MeshOptimizedName, GetMeshOptimized(container.Version, container.Flags));
            }
            if (IsReadStreamData(container.ExportVersion))
            {
                StreamingInfo streamData = new StreamingInfo(true);
                node.Add(StreamDataName, streamData.ExportYAML(container));
            }

            return(node);
        }
Exemplo n.º 4
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion));
            if (HasLODData(container.ExportVersion))
            {
                node.Add(LODDataName, LODData.ExportYAML(container));
            }
            else
            {
                if (HasUse16bitIndices(container.ExportVersion))
                {
                    node.Add(Use16BitIndicesName, Use16BitIndices);
                }
                if (IsIndexBufferFirst(container.ExportVersion))
                {
                    node.Add(IndexBufferName, IndexBuffer.ExportYAML());
                }
                node.Add(SubMeshesName, SubMeshes.ExportYAML(container));
            }

            if (HasBlendShapes(container.ExportVersion))
            {
                if (HasBlendChannels(container.ExportVersion))
                {
                    node.Add(ShapesName, Shapes.ExportYAML(container));
                }
                else
                {
                    node.Add(ShapesName, BlendShapes.ExportYAML(container));
                    node.Add(ShapeVerticesName, ShapeVertices.ExportYAML(container));
                }
            }
            if (HasBindPose(container.ExportVersion))
            {
                if (IsBindPoseFirst(container.ExportVersion))
                {
                    node.Add(BindPoseName, BindPose.ExportYAML(container));
                }
            }
            if (HasBoneNameHashes(container.ExportVersion))
            {
                node.Add(BoneNameHashesName, BoneNameHashes.ExportYAML(true));
                node.Add(RootBoneNameHashName, RootBoneNameHash);
            }
            if (HasBonesAABB(container.ExportVersion))
            {
                node.Add(BonesAABBName, BonesAABB.ExportYAML(container));
                node.Add(VariableBoneCountWeightsName, VariableBoneCountWeights.ExportYAML(container));
            }

            if (HasMeshCompression(container.ExportVersion))
            {
                node.Add(MeshCompressionName, (byte)MeshCompression);
            }
            if (HasStreamCompression(container.ExportVersion))
            {
                node.Add(StreamCompressionName, StreamCompression);
            }
            if (HasIsReadable(container.ExportVersion))
            {
                node.Add(IsReadableName, IsReadable);
                node.Add(KeepVerticesName, KeepVertices);
                node.Add(KeepIndicesName, KeepIndices);
            }

            if (HasIndexFormat(container.ExportVersion))
            {
                node.Add(IndexFormatName, (int)IndexFormat);
            }

            if (!HasLODData(container.ExportVersion))
            {
                if (!IsIndexBufferFirst(container.ExportVersion))
                {
                    node.Add(IndexBufferName, IndexBuffer.ExportYAML());
                }
            }

            if (HasVertexData(container.ExportVersion))
            {
                if (!IsOnlyVertexData(container.ExportVersion))
                {
                    if (MeshCompression != MeshCompression.Off)
                    {
                        node.Add(VerticesName, Vertices.ExportYAML(container));
                    }
                }
            }
            else
            {
                node.Add(VerticesName, Vertices.ExportYAML(container));
            }

            if (HasSkin(container.ExportVersion))
            {
                node.Add(SkinName, Skin.ExportYAML(container));
            }
            if (HasBindPose(container.ExportVersion))
            {
                if (!IsBindPoseFirst(container.ExportVersion))
                {
                    node.Add(BindPoseName, BindPose.ExportYAML(container));
                }
            }

            if (HasVertexData(container.ExportVersion))
            {
                if (IsOnlyVertexData(container.ExportVersion))
                {
                    node.Add(VertexDataName, VertexData.ExportYAML(container));
                }
                else
                {
                    if (MeshCompression == MeshCompression.Off)
                    {
                        node.Add(VertexDataName, VertexData.ExportYAML(container));
                    }
                    else
                    {
                        node.Add(UVName, UV.ExportYAML(container));
                        node.Add(UV1Name, UV1.ExportYAML(container));
                        node.Add(TangentsName, Tangents.ExportYAML(container));
                        node.Add(NormalsName, Normals.ExportYAML(container));
                        node.Add(ColorsName, Colors.ExportYAML(container));
                    }
                }
            }
            else
            {
                node.Add(UVName, UV.ExportYAML(container));
                if (HasUV1(container.ExportVersion))
                {
                    node.Add(UV1Name, UV1.ExportYAML(container));
                }
                if (HasTangentSpace(container.ExportVersion))
                {
                    node.Add(TangentSpaceName, Tangents.ExportYAML(container));
                }
                else
                {
                    node.Add(TangentsName, Tangents.ExportYAML(container));
                    node.Add(NormalsName, Normals.ExportYAML(container));
                }
            }

            if (HasCompressedMesh(container.ExportVersion))
            {
                node.Add(CompressedMeshName, CompressedMesh.ExportYAML(container));
            }

            node.Add(LocalAABBName, LocalAABB.ExportYAML(container));
            if (!HasVertexData(container.ExportVersion))
            {
                node.Add(ColorsName, Colors.ExportYAML(container));
            }
            if (HasCollisionTriangles(container.ExportVersion))
            {
                node.Add(CollisionTrianglesName, CollisionTriangles.ExportYAML(true));
                node.Add(CollisionVertexCountName, CollisionVertexCount);
            }
            if (HasMeshUsageFlags(container.ExportVersion))
            {
                node.Add(MeshUsageFlagsName, MeshUsageFlags);
            }

            if (HasCollision(container.ExportVersion))
            {
                node.Add(BakedConvexCollisionMeshName, CollisionData.BakedConvexCollisionMesh.ExportYAML());
                node.Add(BakedTriangleCollisionMeshName, CollisionData.BakedTriangleCollisionMesh.ExportYAML());
            }
            if (HasMeshMetrics(container.ExportVersion))
            {
                node.Add(MeshMetricsName + "[0]", MeshMetrics[0]);
                node.Add(MeshMetricsName + "[1]", MeshMetrics[1]);
            }
            if (HasMeshOptimization(container.ExportVersion, container.ExportFlags))
            {
                if (IsMeshOptimizationFlags(container.ExportVersion))
                {
                    node.Add(MeshOptimizationFlagsName, (int)MeshOptimizationFlags);
                }
                else
                {
                    node.Add(MeshOptimizedName, MeshOptimized);
                }
            }
            if (HasStreamData(container.ExportVersion))
            {
                StreamingInfo streamData = new StreamingInfo(true);
                node.Add(StreamDataName, streamData.ExportYAML(container));
            }
            return(node);
        }