Skip to content

Commit

Permalink
test: add test for this fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 committed Sep 5, 2023
1 parent 9d0cd26 commit 57060f5
Show file tree
Hide file tree
Showing 3 changed files with 206 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Test~/MeshInfo2/MeshInfo2Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,17 @@ public class MeshInfo2Test
[TestCase("two-negative-frame", 100, 10)]

[TestCase("two-0-50-frame", -25, -2)]
[TestCase("two-0-50-frame", 0, -1)]
[TestCase("two-0-50-frame", 0, 0)]
[TestCase("two-0-50-frame", 25, 0)]
[TestCase("two-0-50-frame", 50, 1)]
[TestCase("two-0-50-frame", 75, 2)]

[TestCase("single-0", -100, float.PositiveInfinity)]
[TestCase("single-0", -1, float.PositiveInfinity)]
[TestCase("single-0", 0, 0)]
[TestCase("single-0", 1, float.NegativeInfinity)]
[TestCase("single-0", 100, float.NegativeInfinity)]

public void BlendShapeLerp(string name, float weight, float offset)
{
var mesh = TestUtils.GetAssetAt<Mesh>($"MeshInfo2/{name}.asset");
Expand All @@ -63,6 +69,7 @@ public void BlendShapeLerp(string name, float weight, float offset)

[TestCase("single-negative")]
[TestCase("single-positive")]
[TestCase("single-0")]
[TestCase("two-positive-frame")]
[TestCase("two-negative-frame")]
[TestCase("two-0-50-frame")]
Expand Down
190 changes: 190 additions & 0 deletions Test~/MeshInfo2/single-0.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!43 &4300000
Mesh:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: single-0
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 36
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 8
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 1}
m_Shapes:
vertices:
- vertex: {x: -1, y: 0, z: 0}
normal: {x: 0, y: 0, z: 0}
tangent: {x: 0, y: 0, z: 0}
index: 4
- vertex: {x: -1, y: 0, z: 0}
normal: {x: 0, y: 0, z: 0}
tangent: {x: 0, y: 0, z: 0}
index: 5
- vertex: {x: -1, y: 0, z: 0}
normal: {x: 0, y: 0, z: 0}
tangent: {x: 0, y: 0, z: 0}
index: 6
- vertex: {x: -1, y: 0, z: 0}
normal: {x: 0, y: 0, z: 0}
tangent: {x: 0, y: 0, z: 0}
index: 7
shapes:
- firstVertex: 0
vertexCount: 4
hasNormals: 0
hasTangents: 0
channels:
- name: test0
nameHash: 4256558196
frameIndex: 0
frameCount: 1
fullWeights:
- 0
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_BonesAABB: []
m_VariableBoneCountWeights:
m_Data:
m_MeshCompression: 0
m_IsReadable: 1
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 000001000200010003000200040005000000050001000000030001000700010005000700020003000600030007000600000002000400020006000400050004000700040006000700
m_VertexData:
serializedVersion: 3
m_VertexCount: 8
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 96
_typelessdata: 000080bf000080bf000080bf000080bf000080bf0000803f000080bf0000803f000080bf000080bf0000803f0000803f0000803f000080bf000080bf0000803f000080bf0000803f0000803f0000803f000080bf0000803f0000803f0000803f
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 1}
m_MeshUsageFlags: 0
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
m_MeshMetrics[0]: 1
m_MeshMetrics[1]: 1
m_MeshOptimizationFlags: 1
m_StreamData:
offset: 0
size: 0
path:
8 changes: 8 additions & 0 deletions Test~/MeshInfo2/single-0.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 57060f5

Please sign in to comment.