Exemplo n.º 1
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion));
            node.Add(FirstByteName, FirstByte);
            node.Add(IndexCountName, IndexCount);
            if (HasTriangleCount(container.ExportVersion))
            {
                node.Add(IsTriStripName, (int)Topology);
                node.Add(TriangleCountName, TriangleCount);
            }
            else
            {
                node.Add(TopologyName, (int)Topology);
            }
            if (HasBaseVertex(container.ExportVersion))
            {
                node.Add(BaseVertexName, BaseVertex);
            }
            if (HasVertex(container.ExportVersion))
            {
                node.Add(FirstVertexName, FirstVertex);
                node.Add(VertexCountName, VertexCount);
                node.Add(LocalAABBName, LocalAABB.ExportYAML(container));
            }
            return(node);
        }
Exemplo n.º 2
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
#warning TODO: values acording to read version (current 2017.3.0f3)
            YAMLMappingNode node = new YAMLMappingNode();
            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add("firstByte", FirstByte);
            node.Add("indexCount", IndexCount);
            node.Add("topology", (uint)GetTopology(container.Version));
            node.Add("firstVertex", FirstVertex);
            node.Add("vertexCount", VertexCount);
            node.Add("localAABB", LocalAABB.ExportYAML(container));
            return(node);
        }
Exemplo n.º 3
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add("firstByte", FirstByte);
            node.Add("indexCount", IndexCount);
            node.Add("topology", (uint)GetTopology(container.Version));
            node.Add("firstVertex", FirstVertex);
            node.Add("vertexCount", VertexCount);
            node.Add("localAABB", LocalAABB.ExportYAML(container));
            return(node);
        }
Exemplo n.º 4
0
        public YAMLNode ExportYAML()
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(SerializedVersion);
            node.Add("firstByte", FirstByte);
            node.Add("indexCount", IndexCount);
            node.Add("topology", Topology);
            node.Add("firstVertex", FirstVertex);
            node.Add("vertexCount", VertexCount);
            node.Add("localAABB", LocalAABB.ExportYAML());
            return(node);
        }
Exemplo n.º 5
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(GetSerializedVersion(container.ExportVersion));
            node.Add(FirstByteName, FirstByte);
            node.Add(IndexCountName, IndexCount);
            node.Add(TopologyName, (uint)GetTopology(container.Version));
            node.Add(FirstVertexName, FirstVertex);
            node.Add(VertexCountName, VertexCount);
            node.Add(LocalAABBName, LocalAABB.ExportYAML(container));
            return(node);
        }
Exemplo n.º 6
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.º 7
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, Shapes.ExportYAML(container));
            node.Add(BindPoseName, IsReadBindPoses(container.Version) ? BindPoses.ExportYAML(container) : YAMLSequenceNode.Empty);
#warning TODO?
            node.Add(BoneNamesName, YAMLSequenceNode.Empty);
            node.Add(BoneNameHashesName, IsReadBoneNameHashes(container.Version) ? BoneNameHashes.ExportYAML(false) : YAMLSequenceNode.Empty);
#warning TODO?
            node.Add(RootBoneNameName, YAMLScalarNode.Empty);
            node.Add(RootBoneNameHashName, RootBoneNameHash);
            node.Add(MeshCompressionName, (byte)MeshCompression);
            node.Add(IsReadableName, IsReadable);
            node.Add(KeepVerticesName, KeepVertices);
            node.Add(KeepIndicesName, KeepIndices);
            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);
            if (IsReadCollision(container.Version))
            {
                node.Add(BakedConvexCollisionMeshName, CollisionData.BakedConvexCollisionMesh.ExportYAML());
                node.Add(BakedTriangleCollisionMeshName, CollisionData.BakedTriangleCollisionMesh.ExportYAML());
            }
            else
            {
                node.Add(BakedConvexCollisionMeshName, ArrayExtensions.EmptyBytes.ExportYAML());
                node.Add(BakedTriangleCollisionMeshName, ArrayExtensions.EmptyBytes.ExportYAML());
            }
#warning ???
            node.Add(MeshOptimizedName, 0);
            if (IsReadStreamData(container.ExportVersion))
            {
                node.Add(StreamDataName, StreamData.ExportYAML(container));
            }

            return(node);
        }
Exemplo n.º 8
0
        protected override YAMLMappingNode ExportYAMLRoot()
        {
#warning TODO: provide for null values

            YAMLMappingNode node = base.ExportYAMLRoot();
            node.AddSerializedVersion(SerializedVersion);
            node.Add("m_SubMeshes", SubMeshes.ExportYAML());
            node.Add("m_Shapes", Shapes.ExportYAML());
            node.Add("m_BindPose", BindPoses.ExportYAML());
#warning ???
            node.Add("m_BoneNames", YAMLSequenceNode.Empty);
            node.Add("m_BoneNameHashes", BoneNameHashes.ExportYAML(false));
#warning ???
            node.Add("m_RootBoneName", YAMLScalarNode.Empty);
            node.Add("m_RootBoneNameHash", RootBoneNameHash);
            node.Add("m_MeshCompression", MeshCompression);
            node.Add("m_IsReadable", IsReadable);
            node.Add("m_KeepVertices", KeepVertices);
            node.Add("m_KeepIndices", KeepIndices);
            node.Add("m_IndexBuffer", IndexBuffer.ExportYAML());
            node.Add("m_Skin", Skin.ExportYAML());
            node.Add("m_VertexData", VertexData.ExportYAML());
            node.Add("m_CompressedMesh", CompressedMesh.ExportYAML());
            node.Add("m_LocalAABB", LocalAABB.ExportYAML());
            node.Add("m_MeshUsageFlags", MeshUsageFlags);
            if (IsReadCollision)
            {
                node.Add("m_BakedConvexCollisionMesh", CollisionData.BakedConvexCollisionMesh.ExportYAML());
                node.Add("m_BakedTriangleCollisionMesh", CollisionData.BakedTriangleCollisionMesh.ExportYAML());
            }
            else
            {
                node.Add("m_BakedConvexCollisionMesh", ArrayExtensions.EmptyBytes.ExportYAML());
                node.Add("m_BakedTriangleCollisionMesh", ArrayExtensions.EmptyBytes.ExportYAML());
            }
#warning ???
            node.Add("m_MeshOptimized", 0);

            return(node);
        }
Exemplo n.º 9
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
#warning TODO: values acording to read version (current 2017.3.0f3)
            YAMLMappingNode node = base.ExportYAMLRoot(container);
            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add("m_SubMeshes", GetSubMeshes(container.Version).ExportYAML(container));
            node.Add("m_Shapes", Shapes.ExportYAML(container));
            node.Add("m_BindPose", IsReadBindPoses(container.Version) ? BindPoses.ExportYAML(container) : YAMLSequenceNode.Empty);
#warning TODO?
            node.Add("m_BoneNames", YAMLSequenceNode.Empty);
            node.Add("m_BoneNameHashes", IsReadBoneNameHashes(container.Version) ? BoneNameHashes.ExportYAML(false) : YAMLSequenceNode.Empty);
#warning TODO?
            node.Add("m_RootBoneName", YAMLScalarNode.Empty);
            node.Add("m_RootBoneNameHash", RootBoneNameHash);
            node.Add("m_MeshCompression", MeshCompression);
            node.Add("m_IsReadable", IsReadable);
            node.Add("m_KeepVertices", KeepVertices);
            node.Add("m_KeepIndices", KeepIndices);
            node.Add("m_IndexBuffer", GetIndexBuffer(container.Version).ExportYAML());
            node.Add("m_Skin", IsReadSkin(container.Version) ? Skin.ExportYAML(container) : YAMLSequenceNode.Empty);
            node.Add("m_VertexData", GetVertexData(container.Version).ExportYAML(container));
            node.Add("m_CompressedMesh", CompressedMesh.ExportYAML(container));
            node.Add("m_LocalAABB", LocalAABB.ExportYAML(container));
            node.Add("m_MeshUsageFlags", MeshUsageFlags);
            if (IsReadCollision(container.Version))
            {
                node.Add("m_BakedConvexCollisionMesh", CollisionData.BakedConvexCollisionMesh.ExportYAML());
                node.Add("m_BakedTriangleCollisionMesh", CollisionData.BakedTriangleCollisionMesh.ExportYAML());
            }
            else
            {
                node.Add("m_BakedConvexCollisionMesh", ArrayExtensions.EmptyBytes.ExportYAML());
                node.Add("m_BakedTriangleCollisionMesh", ArrayExtensions.EmptyBytes.ExportYAML());
            }
#warning ???
            node.Add("m_MeshOptimized", 0);

            return(node);
        }
Exemplo n.º 10
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);
        }