mirror of
https://github.com/maxartz15/VertexAnimation.git
synced 2025-06-13 06:46:17 +02:00
Interpolation
Smooth animations :)
This commit is contained in:
@ -45,6 +45,9 @@ namespace TAO.VertexAnimation.Editor
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("materialShader"), new GUIContent(""));
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useNormalA"), new GUIContent("Use Normal (A)"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useInterpolation"));
|
||||
|
||||
if (GUILayout.Button("Bake", GUILayout.Height(32)))
|
||||
{
|
||||
modelBaker.Bake();
|
||||
|
@ -22,6 +22,8 @@ namespace TAO.VertexAnimation.Editor
|
||||
public bool generateAnimationBook = true;
|
||||
public bool generatePrefab = true;
|
||||
public Shader materialShader = null;
|
||||
public bool useInterpolation = true;
|
||||
public bool useNormalA = true;
|
||||
|
||||
// Output.
|
||||
public GameObject prefab = null;
|
||||
@ -153,6 +155,24 @@ namespace TAO.VertexAnimation.Editor
|
||||
material.SetTexture("_PositionMap", positionMap);
|
||||
material.SetInt("_MaxFrames", bakedData.maxFrames);
|
||||
|
||||
if (useNormalA)
|
||||
{
|
||||
material.EnableKeyword("USE_NORMALA_ON");
|
||||
}
|
||||
else
|
||||
{
|
||||
material.DisableKeyword("USE_NORMALA_ON");
|
||||
}
|
||||
|
||||
if(useInterpolation)
|
||||
{
|
||||
material.EnableKeyword("USE_INTERPOLATION_ON");
|
||||
}
|
||||
else
|
||||
{
|
||||
material.DisableKeyword("USE_INTERPOLATION_ON");
|
||||
}
|
||||
|
||||
// Generate Prefab
|
||||
prefab = AnimationPrefab.Create(path, name, meshes, material, lodSettings.GetTransitionSettings());
|
||||
}
|
||||
|
Reference in New Issue
Block a user