- Home /
How can I export 3D data from the walking Ethan at regular intervals?
I need some figures of the walking human for 3D zoetrope, so I want to export 3D data from animating ThirdPersonCharacter at regular intervals ( You can know what the 3D zoetrope is from this video -> https://youtu.be/5khDGKGv088?t=1m10s ). Now, I'm using "Ethan" and "HumanoidWalk" motion. How can I do it? thanks.
Just create a full $$anonymous$$eshCopy with the applied animation at the frames you want them.
Answer by BastianUrbach · Jan 02, 2018 at 10:33 PM
You can export the current skinned mesh of a skinned mesh renderer using SkinnedMeshRenderer.BakeMesh():
using UnityEngine; using UnityEditor; public class BakeAnimationMeshes : MonoBehaviour { public float interval; public Animator animator; public SkinnedMeshRenderer skinnedMeshRenderer; void Start() { float length = animator.GetCurrentAnimatorClipInfo(0)[0].clip.length; Mesh mesh; for (int i = 0; i < length / interval; i++) { animator.Update(interval); mesh = new Mesh(); skinnedMeshRenderer.BakeMesh(mesh); AssetDatabase.CreateAsset(mesh, "Assets/BakedMesh[" + i + "].asset"); } } }Be careful, this script will spam your Assets folder with one mesh for each step. Without changes I recommend using it only in an otherwise empty project.
Thank you very much! I could get some .obj files of the walking Ethan by Scene OBJ Exporter after using your script.
Your answer
Follow this Question
Related Questions
Blender Path animation to Unity? 2 Answers
Importing multiple objects with animations 0 Answers
Exporting animated scene from Blender to Unity 0 Answers
Exporting Maya Animation to Unity3d 3 Answers
Help, can't import animation into unity 0 Answers