Recalculated Bounds.

This commit is contained in:
max
2021-02-18 03:19:07 +01:00
parent 2ea76b947e
commit bc8aa08193
3 changed files with 54 additions and 29 deletions

View File

@ -111,15 +111,20 @@ namespace TAO.VertexAnimation.Editor
{
AssetDatabaseUtils.RemoveChildAssets(this, new Object[2] { book, material });
foreach (var m in meshes)
Bounds bounds = new Bounds
{
m.bounds = bakedData.mesh.bounds;
m.Finalize();
AssetDatabase.AddObjectToAsset(m, this);
max = bakedData.maxBounds,
min = bakedData.minBounds
};
for (int i = 0; i < meshes.Length; i++)
{
meshes[i].bounds = bounds;
meshes[i].Finalize();
AssetDatabase.AddObjectToAsset(meshes[i], this);
}
AssetDatabase.AddObjectToAsset(positionMap, this);
AssetDatabase.SaveAssets();
if (generatePrefab)