ApplyAnimationBounds option.

This commit is contained in:
max 2021-02-18 18:29:40 +01:00
parent 43049094af
commit b16b0aedcd
2 changed files with 7 additions and 1 deletions

View File

@ -37,6 +37,7 @@ namespace TAO.VertexAnimation.Editor
private void BakeGUI() private void BakeGUI()
{ {
EditorGUILayout.PropertyField(serializedObject.FindProperty("lodSettings").FindPropertyRelative("lodSettings")); EditorGUILayout.PropertyField(serializedObject.FindProperty("lodSettings").FindPropertyRelative("lodSettings"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("applyAnimationBounds"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("generateAnimationBook")); EditorGUILayout.PropertyField(serializedObject.FindProperty("generateAnimationBook"));
using (new EditorGUILayout.HorizontalScope()) using (new EditorGUILayout.HorizontalScope())

View File

@ -18,6 +18,7 @@ namespace TAO.VertexAnimation.Editor
public bool includeInactive = false; public bool includeInactive = false;
public LODSettings lodSettings = new LODSettings(); public LODSettings lodSettings = new LODSettings();
public bool applyAnimationBounds = true;
public bool generateAnimationBook = true; public bool generateAnimationBook = true;
public bool generatePrefab = true; public bool generatePrefab = true;
public Shader materialShader = null; public Shader materialShader = null;
@ -118,7 +119,11 @@ namespace TAO.VertexAnimation.Editor
for (int i = 0; i < meshes.Length; i++) for (int i = 0; i < meshes.Length; i++)
{ {
meshes[i].bounds = bounds; if (applyAnimationBounds)
{
meshes[i].bounds = bounds;
}
meshes[i].Finalize(); meshes[i].Finalize();
AssetDatabase.AddObjectToAsset(meshes[i], this); AssetDatabase.AddObjectToAsset(meshes[i], this);
} }