mirror of
https://github.com/maxartz15/VertexAnimation.git
synced 2025-06-13 14:56:18 +02:00
GenerateTexture2DArray in ModelBaker
This commit is contained in:
@ -10,6 +10,7 @@ namespace TAO.VertexAnimation
|
||||
{
|
||||
public Mesh mesh;
|
||||
public List<Texture2D> positionMaps;
|
||||
public int maxFrames;
|
||||
|
||||
// Returns main position map.
|
||||
public Texture2D GetPositionMap
|
||||
@ -84,6 +85,7 @@ namespace TAO.VertexAnimation
|
||||
BakedData bd = Bake(model, ac, animationInfo);
|
||||
bakedData.mesh = bd.mesh;
|
||||
bakedData.positionMaps.AddRange(bd.positionMaps);
|
||||
bakedData.maxFrames = maxFrames;
|
||||
}
|
||||
|
||||
return bakedData;
|
||||
@ -106,7 +108,8 @@ namespace TAO.VertexAnimation
|
||||
BakedData bakedData = new BakedData()
|
||||
{
|
||||
mesh = mesh,
|
||||
positionMaps = new List<Texture2D>() { BakePositionMap(model, animationClip, animationInfo) }
|
||||
positionMaps = new List<Texture2D>() { BakePositionMap(model, animationClip, animationInfo) },
|
||||
maxFrames = animationInfo.maxFrames
|
||||
};
|
||||
|
||||
return bakedData;
|
||||
|
@ -3,7 +3,7 @@ using UnityEngine;
|
||||
|
||||
namespace TAO.VertexAnimation
|
||||
{
|
||||
[CreateAssetMenu(fileName = "new AnimationBook", menuName = "VA_Animation/AnimationBook", order = 400)]
|
||||
[CreateAssetMenu(fileName = "new AnimationBook", menuName = "TAO/VertexAnimation/AnimationBook", order = 400)]
|
||||
public class VA_AnimationBook : ScriptableObject
|
||||
{
|
||||
public PlayData playData = null;
|
||||
|
@ -3,7 +3,7 @@ using UnityEngine;
|
||||
|
||||
namespace TAO.VertexAnimation
|
||||
{
|
||||
[CreateAssetMenu(fileName = "new AnimationLibrary", menuName = "VA_Animation/AnimationLibrary", order = 400)]
|
||||
[CreateAssetMenu(fileName = "new AnimationLibrary", menuName = "TAO/VertexAnimation/AnimationLibrary", order = 400)]
|
||||
public class VA_AnimationLibrary : ScriptableObject
|
||||
{
|
||||
[SerializeField]
|
||||
|
@ -5,7 +5,7 @@ namespace TAO.VertexAnimation
|
||||
public static class VA_Texture2DArrayUtils
|
||||
{
|
||||
public static Texture2DArray CreateTextureArray(Texture2D[] a_textures, bool a_useMipChain, bool a_isLinear,
|
||||
TextureWrapMode a_wrapMode = TextureWrapMode.Repeat, FilterMode a_filterMode = FilterMode.Bilinear, int a_anisoLevel = 1, string a_name = "")
|
||||
TextureWrapMode a_wrapMode = TextureWrapMode.Repeat, FilterMode a_filterMode = FilterMode.Bilinear, int a_anisoLevel = 1, string a_name = "", bool a_makeNoLongerReadable = true)
|
||||
{
|
||||
if(!IsValidForTextureArray(a_textures) || !IsValidCopyTexturePlatform())
|
||||
{
|
||||
@ -27,7 +27,7 @@ namespace TAO.VertexAnimation
|
||||
textureArray.anisoLevel = a_anisoLevel;
|
||||
textureArray.name = a_name;
|
||||
|
||||
textureArray.Apply(false, false);
|
||||
textureArray.Apply(false, a_makeNoLongerReadable);
|
||||
|
||||
return textureArray;
|
||||
}
|
||||
|
Reference in New Issue
Block a user