mirror of
https://github.com/maxartz15/VertexAnimation.git
synced 2025-06-13 06:46:17 +02:00
Apply root motion option.
Added option to apply root motion.
This commit is contained in:
@ -28,6 +28,7 @@ namespace TAO.VertexAnimation.Editor
|
||||
{
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("model"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("animationClips"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("applyRootMotion"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("fps"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("textureWidth"));
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ namespace TAO.VertexAnimation.Editor
|
||||
// Input.
|
||||
public GameObject model;
|
||||
public AnimationClip[] animationClips;
|
||||
public bool applyRootMotion = false;
|
||||
[Range(1, 60)]
|
||||
public int fps = 24;
|
||||
public int textureWidth = 512;
|
||||
@ -97,7 +98,7 @@ namespace TAO.VertexAnimation.Editor
|
||||
target.name = model.name;
|
||||
|
||||
target.ConbineAndConvertGameObject();
|
||||
AnimationBaker.BakedData bakedData = target.Bake(animationClips, fps, textureWidth);
|
||||
AnimationBaker.BakedData bakedData = target.Bake(animationClips, applyRootMotion, fps, textureWidth);
|
||||
|
||||
positionMap = VA_Texture2DArrayUtils.CreateTextureArray(bakedData.positionMaps.ToArray(), false, true, TextureWrapMode.Repeat, FilterMode.Point, 1, string.Format("{0}_PositionMap", name), true);
|
||||
meshes = bakedData.mesh.GenerateLOD(lodSettings.LODCount(), lodSettings.GetQualitySettings());
|
||||
|
Reference in New Issue
Block a user