示例#1
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.Add(VerticesName, Vertices.ExportYAML(container));
            node.Add(UVName, UV.ExportYAML(container));
            if (HasBindPoses(container.ExportVersion))
            {
                node.Add(BindPosesName, BindPoses.ExportYAML(container));
            }

            node.Add(NormalsName, Normals.ExportYAML(container));
            node.Add(TangentsName, Tangents.ExportYAML(container));
            node.Add(WeightsName, Weights.ExportYAML(container));
            node.Add(NormalSignsName, NormalSigns.ExportYAML(container));
            node.Add(TangentSignsName, TangentSigns.ExportYAML(container));
            if (HasFloatColors(container.ExportVersion))
            {
                node.Add(FloatColorsName, FloatColors.ExportYAML(container));
            }

            node.Add(BoneIndicesName, BoneIndices.ExportYAML(container));
            node.Add(TrianglesName, Triangles.ExportYAML(container));
            if (HasColors(container.ExportVersion))
            {
                node.Add(ColorsName, Colors.ExportYAML(container));
            }
            if (HasUVInfo(container.ExportVersion))
            {
                node.Add(UVInfoName, UVInfo);
            }
            return(node);
        }
示例#2
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);
        }
示例#3
0
文件: Mesh.cs 项目: bmjoy/UnityRipper
        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);
        }
示例#4
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);
        }