蒙皮骨骼动画 unity
This post is a guide to importing a skinned mesh with a looping animation and then animating it’s position in Unity.
这篇文章是有关导入带有循环动画的蒙皮网格物体,然后对其在Unity中的位置进行动画处理的指南。
出口 (Export)
Set the keyframe range for one animation or export all animations and remember to set up splits in Unity or use @ name formating (see documentation on animation).
设置一个动画的关键帧范围或导出所有动画,并记住要在Unity中设置分割或使用@名称格式(请参阅动画文档 )。
Choose whether to bake your keyframes or not;
选择是否烘烤关键帧;
建立 (Setup)
Open or create a scene – Drag your animated model, lets call it Shark into the scene.
打开或创建场景–拖动动画模型,将其命名为Shark进入场景。
Create an empty object in the scene: from the Menu choose > Game Object > Create Empty – name it to SharkPos, where Shark is the name of your animated object and Position.
在场景中创建一个空对象:从菜单中选择>游戏对象>创建空对象-将其命名为Shark Pos ,其中Shark是动画对象和位置的名称。
Move the empty SharkPos to the location of Shark, so you can use the gizmo from the same position. To position accurately you could copy and past the translation values.
将空的Shark Pos移动到Shark的位置,以便可以从相同位置使用Gizmo。 为了准确定位,您可以复制并粘贴转换值。
Parent your Shark to the SharkPos object (this allows you to keep separate the animation of the position from the animated object’s idle/other animations).
将“ Shark” ( 鲨鱼)与“ Shark Pos” ( 鲨鱼 Pos)对象作为父对象(这使您可以将位置的动画与动画对象的“空闲” /其他动画分开)。
动画化 (Animate)
Animate position/rotation of xPos:
xPos的动画位置/旋转:
Open animation panel
打开动画面板
Create new clip > name and place somewhere sensible like assets\animation
创建新的片段 >名称并放置在明智的位置,例如资产\动画
Move SharkPos to start position – Use gizmo to move object to desired position for start of your animation (this updates the translate value, so move a bit even if close to desired position)
将 Shark Pos 移动到起始位置 –使用Gizmo将对象移动到所需位置以开始动画(这将更新转换值,因此即使靠近所需位置也要移动一点)
Set a keyframe on frame 0 with the <>+ button
使用<> +按钮在第0 帧上设置关键帧
Move to next keyframe – Drag forward in the time line, marked by seconds – you may need to zoom in and out with scroll wheel
移至下一个关键帧 –在时间线中向前拖动,以秒为标记–您可能需要使用滚轮进行放大和缩小
Move and/or rotate SharkPos (keyframe will be set for you)
移动和/或旋转 Shark Pos (将为您设置关键帧)
编辑 (Edit)
To ensure a looping path, copy values from the first to the last keyframe – e.g click in the value of translation x, copy the number, go to the last keyframe click in the value and paste, and so on.
为了确保循环路径,请将值从第一个关键帧复制到最后一个关键帧–例如,单击转换x的值,复制数字,转到最后一个关键帧,单击该值并粘贴,依此类推。
For Rotation values, to ensure consistent rotation direction, make sure the first and last are not the same value but 360 degrees apart e.g. first frame is y=-30 the last frame is y= 330.
对于“旋转”值,要确保旋转方向一致,请确保第一个和最后一个不是相同的值,而是相隔360度,例如,第一帧为y = -30,最后一帧为y = 330。
To change the way your animation eases in and out of each keyframe right click the keyframe and choose the Tangents to edit and manipulate the handles – see editing curves for more info.
要更改动画在每个关键帧中进出的方式,请右键单击关键帧,然后选择“切线”以编辑和操纵控柄–有关更多信息,请参见编辑曲线 。
完成 (Finalise)
Parent to a new empty object – e.g.Shark01 this node can be used to move the whole animated object and path together.
新建一个空对象的父对象-例如Shark 01,此节点可用于将整个动画对象和路径一起移动。
Two Hammerheads in your pool :-)
您池中的两个锤头鱼:-)
翻译自: https://blogs.unity3d.com/2011/09/20/animating-skinned-mesh-along-waypoints-in-unity/
蒙皮骨骼动画 unity