mirror of
https://github.com/maxartz15/VertexAnimation.git
synced 2025-07-01 22:16:09 +02:00
Added basic blending and refactored some files
This commit is contained in:
@ -128,7 +128,7 @@ namespace TAO.VertexAnimation
|
||||
|
||||
// Bake mesh for a copy and to apply the new UV's to.
|
||||
SkinnedMeshRenderer skinnedMeshRenderer = model.GetComponent<SkinnedMeshRenderer>();
|
||||
skinnedMeshRenderer.BakeMesh(mesh);
|
||||
mesh = model.GetComponent<SkinnedMeshRenderer>().sharedMesh.Copy();
|
||||
mesh.RecalculateBounds();
|
||||
|
||||
mesh.uv3 = mesh.BakePositionUVs(animationInfo);
|
||||
|
@ -7,11 +7,10 @@ namespace TAO.VertexAnimation
|
||||
public static Mesh[] GenerateLOD(this Mesh mesh, int lods, float[] quality)
|
||||
{
|
||||
Mesh[] lodMeshes = new Mesh[lods];
|
||||
|
||||
|
||||
for (int lm = 0; lm < lodMeshes.Length; lm++)
|
||||
{
|
||||
lodMeshes[lm] = mesh.Copy();
|
||||
|
||||
// Only simplify when needed.
|
||||
if (quality[lm] < 1.0f)
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ namespace TAO.VertexAnimation
|
||||
uv5 = mesh.uv5,
|
||||
uv6 = mesh.uv6,
|
||||
uv7 = mesh.uv7,
|
||||
uv8 = mesh.uv8
|
||||
uv8 = mesh.uv8,
|
||||
};
|
||||
|
||||
return copy;
|
||||
@ -35,6 +35,7 @@ namespace TAO.VertexAnimation
|
||||
{
|
||||
mesh.Optimize();
|
||||
mesh.UploadMeshData(true);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user