Model Baker

Model Baker ScriptableObject, bakes models and outputs the data. Can also generate prefab and animation books for quick setup.
Updated GUI.
This commit is contained in:
max
2021-01-11 20:59:40 +01:00
parent abd6cc9e9e
commit cab2c4ad12
11 changed files with 271 additions and 129 deletions

View File

@ -1,16 +1,4 @@
// References:
// https://forum.unity.com/threads/help-combining-and-manipulating-skinned-mesh-renderers-imported-from-blender.505078/
// http://wiki.unity3d.com/index.php/CombineSkinnedMeshes
// http://wiki.unity3d.com/index.php/SkinnedMeshCombiner
// TODO:
// ---Bake ALL the MeshRenderers/SkinnedMeshRenderers and merge them together.---
// ---Bake multiple animations.---
// ---Get the longest animation to calculate the texture height, so all the textures have the same height for the 3D texture.---
// Add options and previews for texture size, animation phasing/fps.
// Either merge with the animation books or generate them from this and maybe store them as child (and then don't destroy them on re-bake to keep the reference but replace it).
using UnityEngine;
using UnityEngine;
using System.Collections.Generic;
using System.Linq;

View File

@ -1,5 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace TAO.VertexAnimation
@ -9,10 +7,20 @@ namespace TAO.VertexAnimation
{
public GameObject model;
public AnimationClip[] animationClips;
[Range(1, 60)]
public int fps = 24;
public int textureWidth = 512;
#if UNITY_EDITOR
public bool saveBakedDataToAsset = true;
public bool generateAnimationBook = false;
public bool generateAnimationBook = true;
public bool generatePrefab = true;
public Shader materialShader = null;
public GameObject prefab = null;
public Material material = null;
public VA_AnimationBook book = null;
#endif
[SerializeField]
private AnimationBaker.BakedData bakedData;