unity 等待...动画

The Animation Rigging package for Unity 2019.1 enables users to set up procedural motion on animated skeletons at runtime. You can use a set of predefined animation constraints to manually build a control rig hierarchy for a character or develop your own custom constraints in C#. This makes it possible to do powerful things during gameplay such as world interactions, skeletal deformation rigging, and physics-based secondary motion.

Unity 2019.1的Animation Rigging软件包使用户可以在运行时在动画骨骼上设置程序动作。 您可以使用一组预定义的动画约束来手动为角色构建控制装置层次结构,或在C#中开发自己的自定义约束。 这样就可以在游戏过程中做一些有力的事情,例如世界互动,骨骼变形操纵和基于物理的辅助运动。

We’re happy to introduce the new Animation Rigging as a preview package for Unity 2019.1. This blog post will provide an introduction and some examples of how you can use it. Please also check out the video of our Animation Rigging GDC 2019 presentation, it’s freely accessible on the GDC Vault.

我们很高兴推出新的 Animation Rigging 作为 Unity 2019.1 的预览包 。 这篇博客文章将提供介绍和一些使用示例。 另请查看我们的 动画索具GDC 2019演示文稿 的视频,该视频 可在GDC Vault中免费访问。

入门 (Getting started)

You can now install the Animation Rigging package in your Unity projects from Package Manager. (Be sure to show Preview packages in the Advanced tab of Package Manager) The package page includes links to documentation along with some samples to help everyone get up to speed with using the package. This is our first release as a preview package for Unity 2019.1. You can also try out our next iteration for 2019.2 in the public beta. Using this upcoming version, you can use the Animation Window to author your own constraints animations with live feedback.

现在,您可以从Package Manager在Unity项目中安装Animation Rigging软件包。 (请确保在“程序包管理器”的“高级”选项卡中显示“预览”程序包)。“程序包”页面包含 文档 链接 以及一些示例,以帮助所有人快速使用该程序包。 这是我们作为Unity 2019.1预览包的第一个版本。 您也可以 在公开测试版中试用 我们对 2019.2 的下一个迭代 。 使用此即将发布的版本,您可以使用“动画窗口”来创作自己的带有实时反馈的约束动画。

A brief note about what we mean by preview: please be aware that things in this package will change as we update to new versions. The exciting part is that you have the opportunity to influence our development and make sure it works for what you need. So please stay in touch with us and let us know how it goes. We are very eager to hear your input.

关于预览的含义的简要说明:请注意,随着我们更新到新版本,此软件包中的内容将发生变化。 令人兴奋的是,您有机会影响我们的发展,并确保它能满足您的需求。 因此,请 与我们保持联系, 并告诉我们如何进行。 我们非常希望听到您的意见。

动画索具概述 (Animation Rigging overview)

The Animation Rigging package provides a library of rig constraints that you can use to create procedural motion at runtime. This is commonly known as runtime rigging. The constraints are set up in groups called Rigs, which are assembled in the Rig Builder component that is assigned to the asset’s Animator Root.

动画索具包提供了绑定约束库,可用于在运行时创建过程运动。 这通常称为运行时绑定。 约束在称为“钻机”的组中进行设置,这些组在分配给资产的“ Animator Root”的“ Rig Builder”组件中进行组装。

This enables users to do powerful things with animated skeletons during gameplay, such as world interactions. For example, when a character’s hands interact with a prop, or to aim at a target in the world. It’s also possible to get higher quality rigging using procedurally controlled bones for skeletal deformation rigging, such as twist correction for shoulders and wrists on skinned mesh characters. We also have physics-based constraints that can be used for dynamic secondary motion on character rigs.

这使用户可以在游戏过程中使用动画骨架来完成强大的功能,例如世界互动。 例如,当角色的手与道具互动或瞄准世界上的目标时。 还可以使用程序控制的骨骼进行骨骼变形绑定(例如对蒙皮网格物体的肩膀和手腕进行扭曲校正)来获得更高质量的绑定。 我们还具有基于物理的约束,可用于角色装备上的动态辅助运动。

骨骼渲染器 (Bone Renderer)

For working with rigs in the Unity Editor, it helps to see and interact with the skeleton in Scene view. We now have the Bone Renderer component, which allows you to add a list of transforms and display them in a variety of visual styles.

为了在Unity编辑器中使用装备,它有助于在“场景”视图中查看骨架并与之交互。 现在,我们有了Bone Renderer组件,该组件使您可以添加变换列表并以各种视觉样式显示它们。

It often helps to organize parts of the skeleton using multiple Bone Renderer components. Here is an example where the same character has multiple Bone Renderer components so that the body, fingers and twist bones can each have their own display styles. This helps to facilitate different artist workflows such as rig setup, keyframing or gameplay debugging.

它通常有助于使用多个Bone Renderer组件来组织骨骼的各个部分。 这是一个示例,其中同一角色具有多个Bone Renderer组件,因此,身体,手指和扭骨可以各自具有自己的显示样式。 这有助于简化不同的艺术家工作流程,例如装备设置,关键帧或游戏调试。

钻机制造商和钻机 (Rig Builder and Rigs)

Here are instructions for setting up Rigs on a character:

以下是在角色上设置装备的说明:

  • First, we need to add the Rig Builder component to the Animator root. This is the same GameObject where the Animator component is assigned. Typically, this is the topmost transform in the rig hierarchy.

    首先,我们需要将Rig Builder组件添加到Animator根目录。 这是分配了Animator组件的同一GameObject。 通常,这是装备层次结构中最顶层的变换。

  • Next, we can create a new child GameObject and that is where we will add the Rig component.

    接下来,我们可以创建一个新的子GameObject,并在其中添加Rig组件。

  • Finally, the Rig gets assigned to the Rig Layers list in Rig Builder.

    最后,将“装备”分配给“装备生成器”中的“装备层”列表。

This is the minimal valid rig setup. In the next steps, we add constraints.

这是最小的有效装备设置。 在接下来的步骤中,我们添加约束。

The really great thing about Rig Builder is that the Rig Layers list allows for multiple rigs as seen in the image above. This is very useful for creating specialized behaviors that can be turned on and off during gameplay. And to make it even more useful, each Rig has its own weight value so it can be blended with the other Rigs.

Rig Builder的真正妙处在于,“钻机层”列表允许多个钻机,如上图所示。 这对于创建可以在游戏过程中打开和关闭的特殊行为非常有用。 为了使它更加有用,每个钻机都有自己的重量值,因此可以与其他钻机混合。

钻机约束 (Rig Constraints)

Rig Constraints are the building blocks that are used to assemble rigs and produce procedural motion at runtime. They’re designed to be modular and general-purpose so that they can be combined in many different ways to solve the needs of your animation game designs in runtime.

钻机约束是用于组装钻机并在运行时产生程序运动的构造块。 它们被设计为模块化和通用的,因此可以通过多种不同方式组合起来,以解决运行时动画游戏设计的需求。

Here is the list of Rig Constraints that are being released with the package.

以下是与软件包一起发布的绑定约束列表。

Here are steps for how to set up a Rig Constraint. In this example, we’re using the TwoBoneIK Constraint.

以下是有关如何设置装备约束的步骤。 在此示例中,我们使用TwoBoneIK约束。

  • First, add a child GameObject below the Rig.

    首先,在装备下方添加一个子GameObject。

  • Then we add a TwoBoneIK Constraint.

    然后,我们添加一个TwoBoneIK约束。

  • Next, we assign the bones and effectors to the TwoBoneIK Constraint.

    接下来,我们将骨骼和效应器分配给TwoBoneIK约束。

  • Lastly, when Play is pressed we can see the Constraint evaluates at runtime.

    最后,当按下Play键时,我们可以看到Constraint在运行时评估。

钻机约束样本 (Rig Constraints samples)

The best way to get started and learn how the Rig Constraints work is by checking out the samples included with the package. Inside of Package Manager, there is a button to import the samples into your project. There is a scene for each constraint that demonstrates how it works.

入门和了解绑定约束的工作方式的最佳方法是检出包装中随附的示例。 在Package Manager中,有一个按钮可以将样本导入到您的项目中。 每个约束都有一个场景来演示其工作原理。

游戏实例 (Gameplay examples)

Runtime rigging happens during gameplay. So in order to try out how this works, we made a quick gameplay prototype using some existing Unity sample content.

运行时操纵发生在游戏过程中。 因此,为了尝试如何工作,我们使用一些现有的Unity示例内容制作了一个快速的游戏原型。

We implemented these basic player controls and used the Animation Rigging package to get some cool gameplay mechanics very easily. Here is a quick video of what it looks like:

我们实现了这些基本的播放器控件,并使用了动画索具包来轻松获得一些很棒的游戏机制。 这是一个简短的视频:

Let’s take a look at each of these features so you can see how we made the runtime rigs.

让我们看一下这些功能中的每一个,以便您可以了解我们如何制作运行时装备。

骨骼变形钻机 (Skeletal Deformation Rig)

The ninja’s skeleton already had twist bones and skin weights set up to begin with. In Unity, we added TwistCorrection constraints to fix up the deformation on his arms and legs. The video shows what it looks like when these constraints are turned off. With the twist correction applied, the movement feels much more natural, like real anatomy and clothing:

忍者的骨骼已经开始具有扭曲骨骼和皮肤重量。 在Unity中,我们添加了TwistCorrection约束来修正他的手臂和腿部的变形。 视频显示了关闭这些约束后的外观。 应用扭曲校正后,运动感觉自然得多,就像真正的解剖结构和衣服一样:

垂直瞄准装备:手里剑 (Vertical Aim Rig: Shuriken)

For the shuriken player ability, the ninja needs to be able to aim his throwing knives at any angle, 360 degrees.

为了使手榴弹的球员能力强,忍者需要能够将投掷刀对准任何角度(360度)。

  • To set this up we first added some new virtual bones to his skeleton.

    为了进行设置,我们首先在他的骨骼中添加了一些新的虚拟骨骼。

    • Virtual bones in Unity are when you add new Transforms into the skeleton hierarchy and save them with the prefab. These can be animated like any other bone. They can be considered virtual because they may only have keyframes in the animation clips that need them, which saves memory elsewhere where they are not needed.

      Unity中的虚拟骨骼是在将新的Transforms添加到骨架层次结构中并将其与预制件一起保存时。 这些可以像其他骨骼一样设置动画。 它们可以被认为是虚拟的,因为它们在动画片段中可能只包含需要它们的关键帧,从而在不需要它们的其他地方节省了内存。

    To set this up we first added some new virtual bones to his skeleton.

    为了进行设置,我们首先在他的骨骼中添加了一些新的虚拟骨骼。

  • Next, we added a TwoBoneIK Constraint to the left arm and set the virtual bones as the IK targets.

    接下来,我们在左臂上添加了TwoBoneIK约束,并将虚拟骨骼设置为IK目标。

  • The IK targets were then animated in a new animation clip where he throws the shuriken. This clip is set up in the ninja’s Animator State Machine as a replacement layer. Both this layer and the vertical aim rig are activated on button press.

    然后,在新的动画剪辑中对IK目标进行了动画处理,他在其中投掷了手里剑。 此剪辑在忍者的Animator状态机中设置为替换层。 按下按钮即可激活该层和垂直瞄准装备。

  • Finally, we made a 1D Blend Tree to drive the Aim Vertical virtual bone, which is the parent of the IK targets. This gets driven by player input, the vertical axis of the left analog thumbstick on a gamepad controller.

    最后,我们制作了一维混合树以驱动“垂直目标”虚拟骨骼,该骨骼是IK目标的父级。 这是由玩家输入驱动的,即游戏手柄控制器上左模拟指尖的垂直轴。

As a result, this animation layer overlays on top of any animation the ninja may be playing. This always works whether he is running, jumping, crouching or even attacking with his sword he can immediately throw a shuriken as a ninja should.

结果,此动画层将叠加在忍者可能正在播放的任何动画之上。 无论他是奔跑,跳跃,蹲下,甚至是用剑进攻,这总是有效的,他可以立即按照忍者的要求投掷手榴弹。

垂直瞄准装备:武士刀 (Vertical Aim Rig: Katana)

The ninja’s katana also needs to be able to aim vertically in order to hit targets that might be on the ground or overhead. We made this building on top of the shuriken rig. It uses the same 1D Blend Tree to control aiming.

忍者的武士刀还需要能够垂直瞄准,以击中可能在地面或头顶的目标。 我们在shuriken钻机顶部建造了这座建筑物。 它使用相同的1D混合树来控制瞄准。

Sword animations bring a new factor: the horizontal rotation. It’s very important for this horizontal aim to be perfectly straight so that the sword trail effect looks smooth. It can be difficult to make this look straight using only skeletal animations because even if the poses are perfect, there are often imperfections in sub-frames. This is because of the way the interpolations solve on the arm’s FK bone chain. The best way to fix this is by using a Multi-Aim Constraint.

剑动画带来了新的因素:水平旋转。 使水平瞄准镜完美笔直非常重要,这样剑道效果看起来很平滑。 仅使用骨骼动画很难使它看起来直,因为即使姿势完美,子帧中也经常有瑕疵。 这是因为插值在手臂的FK骨骼链上求解的方式。 解决此问题的最佳方法是使用“多目标约束”。

  • We set up a new virtual bone and moved it out in front of the katana. Then we assigned this as the target of a Multi-Aim Constraint. The source object of this is the right-hand grip bone, which is the parent of the katana model.

    我们设置了一个新的虚拟骨骼并将其移到武士刀前面。 然后,我们将其指定为“多目标约束”的目标。 该对象的源对象是右手握骨,是katana模型的父代。

  • Next, we added another virtual bone as the parent of the aim target and used a Position Constraint to keep it centered on the ninja’s chest.

    接下来,我们添加了另一个虚拟骨骼作为目标目标的父对象,并使用“位置约束”将其保持在忍者胸部的中心。

  • Finally, we opened the sword swipe animation clip and added keyframes for rotating the parent of the aim target in sync with the motion of the arm.

    最后,我们打开了剑滑动动画剪辑,并添加了关键帧以与手臂的运动同步旋转目标目标的父对象。

The result is that the Multi-Aim Constraint corrects any imperfections in the horizontal rotation arc of the sword. Even when the animations are slowed down and have particle effects added as shown in the above video, the sword strike is always straight and true.

结果是,多重目标约束可以纠正剑的水平旋转弧中的任何缺陷。 即使如上视频所示,放慢了动画的速度并添加了粒子效果,剑的打击也总是笔直而真实的。

蝴蝶熟悉的钻机 (Butterfly Familiar Rig)

Here is another example of how Rig Constraints helped us to make a follower character. We used the DampedTransform Constraint to make the butterfly follow a target Transform in the ninja’s prefab. It also uses a Multi-Aim Constraint to shine a spotlight that always aims at a target in front of the ninja wherever he goes.

这是“绑定约束”如何帮助我们树立追随者角色的另一个示例。 我们使用DampedTransform约束使蝴蝶跟随忍者预制件中的目标Transform。 它还使用“多目标约束”来照亮聚光灯,无论他走到哪里,该聚光灯始终对准忍者前方的目标。

You might recognize the butterfly model from our earlier blog post on the HD Lit Master Node for Shadergraph. What we didn’t know at the time is that this is the ninja’s messenger butterfly – he gives him power-ups and special attacks. Most importantly it keeps him company while he runs through the Megacity. Anyway, you can invent whatever cool gameplay mechanics you like and the Animation Rigging package makes it easy to implement.

您可能会从我们之前在 Shadergraph 的 HD Lit Master Node 上的博客文章中认识到蝴蝶模型 。 当时我们还不知道这是忍者的信使蝴蝶-他给了他力量增强和特殊攻击的机会。 最重要的是,当他穿越大城市时,这可以使他保持陪伴。 无论如何,您都可以发明自己喜欢的任何酷炫的游戏机制,而“ Animation Rigging”软件包可以轻松实现。

机械起重机的例子 (Mechanical Crane example)

The animation rigging constraints can not only be used for characters, but also for anything else. In this example, we used these constraints to build a futuristic mechanical crane rig. The goal was to create a rig that is entirely driven by inputs and constraints at runtime. There are no animation clips in this example, as all motion is derived from two gamepad joystick inputs and one button to trigger the clamp & release of the container.

动画绑定约束不仅可以用于角色,还可以用于其他任何东西。 在此示例中,我们使用这些约束条件构建了一个未来派机械起重机。 目标是创建一个在运行时完全由输入和约束驱动的装备。 在此示例中没有动画剪辑,因为所有运动均来自两个游戏手柄操纵杆输入和一个按钮来触发容器的夹紧和释放。

Note: HDRP textures are not included in the sample project.

注意:HDRP纹理不包括在示例项目中。

You can download mechanical crane sample project for Unity 2019.1 on GitHub.

您可以 在GitHub上 下载 Unity 2019.1的机械起重机示例项目。

If you’re using Unity 2019.2 beta, download this updated version of the project.

如果您正在使用 Unity 2019.2 beta ,请 下载 此项目的更新版本。

The controls for the crane are:

起重机的控件为:

控制装备 (ControlRig)

In this example, we took the approach of creating two rigs. First, a ControlRig that basically mimics the model hierarchy in order to input and solve the desired result in an animation stream (aka the ControlRig)

在此示例中,我们采用了创建两个装备的方法。 首先,一个ControlRig基本上模仿模型层次结构,以便在动画流中输入并求解所需的结果(也称为ControlRig)

The red part of the rig represents the inputs or desired targets, whereas the green represents the actual/current result.

装备的红色部分表示输入或所需的目标,而绿色部分表示实际/当前结果。

变形钻机 (DeformRig)

Second, a DeformRig takes the final result of the ControlRig and applies it the model hierarchy + secondary piston movement:

其次,DeformRig获取ControlRig的最终结果,并将其应用于模型层次结构+辅助活塞运动:

The final result on the rig is then applied to the models or joints in the scene.

然后,将钻机上的最终结果应用于场景中的模型或关节。

钻机结构 (Rig Structure)

The inputs for the crane’s arm are driving rig effectors using a simple script and the Rig Transform component to obtain the proper scene/input evaluation. These inputs are then damped onto a second effector. The remaining effectors, including the container rotation and clamps, are children of this damped result. In this example, the ControlRig uses 15 constraints: Damp for the inputs, 2BoneIK for the arm, multiple constraints for the clamps and container release. The DeformRig uses a flat list of constraints: Aim & Multi-Position for the pistons & Multi-Parent Constraints for the rig-to-model remapping.

起重机臂的输入是使用简单的脚本和“钻机变换”组件的钻机效应器,以获得正确的场景/输入评估。 然后将这些输入阻尼到第二个效应器上。 其余的效应器,包括容器旋转和夹具,都是这种衰减结果的子代。 在此示例中,ControlRig使用15个约束:Damp用于输入,2BoneIK用于臂,多个约束用于夹具和容器释放。 DeformRig使用简单的约束列表:“目标”和“多位置”用于活塞,“多父对象”约束用于“钻机到模型”重新映射。

There are, of course, many ways that this example could have been rigged to obtain the same or similar result. Keep in mind that the rig hierarchy (order of GameObjects in the scene) controls the order in which the constraints are evaluated. This is extremely important in cases like this, where certain constraints need to be evaluated in a specific order.

当然,可以使用多种方法来操纵此示例以获得相同或相似的结果。 请记住,装备层次结构(场景中GameObjects的顺序)控制评估约束的顺序。 在这种情况下,这是非常重要的,在这种情况下,需要按特定顺序评估某些约束。

Hope you’ve found this blog post useful in understanding how to manage inputs, Rig Transforms and different types of rigs & constraints. Have fun! We’re looking forward to hearing your feedback on the forums.

希望您发现此博客文章对理解如何管理输入,装备转换和各种类型的装备与约束有用。 玩得开心! 我们期待着您 在论坛上收到 您的 反馈 。

-

Want to continue learning about rigging? Check out our courses and tutorials on the Unity Learn Premium platform.

是否想继续学习索具? 在Unity Learn Premium平台上 查看我们的 课程和教程

翻译自: https://blogs.unity3d.com/2019/05/14/introducing-the-animation-rigging-preview-package-for-unity-2019-1/

unity 等待...动画

unity 等待...动画_介绍Unity 2019.1的动画索具预览包相关推荐

  1. unity网络开发_介绍Unity开发人员网络

    unity网络开发 演示地址 As part of a larger plan, today we launch the first iteration of the Unity Developer ...

  2. unity 物理台球_使用基于Android物理的动画制作类似于桌球的游戏

    unity 物理台球 学习Android开发 (Learning Android Development) While playing around with Android Physics-base ...

  3. unity 2017介绍_介绍Unity 2017

    unity 2017介绍 We're excited to announce that Unity 2017.1 has been released and is now available for ...

  4. unity 存档插件_【Unity消息】5月1日到5月15日 Unity资源商店大促

    5月1日到5月15日,Unity资源商店5月大促,几百款资源5折,而且每天有一款资源打3折~ 而且Unity资源商店又改版啦,新版好好看呀~ Unity资源5月大促地址:Unity Asset Sto ...

  5. unity 回合制_用Unity E3 Goodness制成

    unity 回合制 The Electronic Entertainment Expo, more commonly known as E3, has kicked off this week in ...

  6. qt过场动画_代码之夏:过场动画编辑器的进展

    qt过场动画 This blog post is written by Matthew Miner who is working on a cutscene editor for Unity. The ...

  7. android刷新时的圆形动画_【Android】圆形揭露动画

    在Android系统中提供了一种圆形的揭露动画,具体表现为一个view以圆形的形式展开.揭示.所谓揭露动画,就是一种用于 View 之间,甚至界面之间的特殊过渡动画效果.通过ViewAnimation ...

  8. android svg指纹录取动画_你知道几种前端动画的实现方式?

    随着互联网的持续发展,H5 页面作为与用户直接交互的表现层越来越复杂,呈现的形式也越来越丰富,从而也要求 H5 页面具有更多的花样性及动画效果.那前端实现动画效果的方式有哪些呢,大致有如下几种: 一. ...

  9. js svg语音波动动画_整理一些有趣的svg动画

    原因 原因很简单,我不想成为一个api前端工程师,想能够多学一点.偶尔的喜欢做一些html可能难以完成的效果,去年用canvas写了一份简单的gant图,感觉还不错.后来画流程图的时候搜索各大网站发现 ...

最新文章

  1. 突发!微信官方证实:“绞杀”了刷量平台
  2. 为什么分布式一定要有延时任务?
  3. 双非高校浙工大,一年2项研究上Nature,校友纷纷打Call:欠一个211名头
  4. kotlin与java对比
  5. AutoBench的使用分析
  6. MySql增加字段、删除字段、修改字段名称、修改字段类型
  7. 《SAS编程与数据挖掘商业案例》学习笔记之一
  8. mysql 查看当前使用的配置文件my.cnf的方法
  9. 【Linux】 浅谈 NCSI 及其在 Linux 上的实现
  10. 基本矩阵F、本质矩阵E、单应矩阵H的关系
  11. 马氏距离(Mahalanobis Distance)与欧式距离
  12. 如何阅读《如何阅读一本书》?
  13. es---elasticsearch-篇二:idea操作es,常用查询DSL
  14. 如何将新手引导模块化?答案在此
  15. 网络编程套接字编程-代码实现-复习总结
  16. java解压加密的7z格式文件
  17. 为SSD编程(6):总结—每个程序员都应该了解的关于固态硬盘的知识
  18. 用了这么久开源社区,还搞不明白免费/自由/开源软件?
  19. python-CST MWS自动采样
  20. Windows自带的造字功能使用

热门文章

  1. python 打开网页开发者工具_Python获取网页指定内容(BeautifulSoup工具的使用方法)...
  2. 华为鸿蒙周易,世纪工程背后的大局--港珠澳大桥的风水秘密!
  3. C/C++实现多个数的拼接(组合)成最大数字
  4. Redis pool 配置详解
  5. Google 收购摩托罗拉移动将会对全球手机市场格局带来哪些深远影响?
  6. 听说这玩意可以安全交换密钥 —— Diffie-Hellman 算法
  7. 无法验证到服务器的安全证书,打开outlook提示…无法验证的安全证书……
  8. C++之父 Bjarne Stroustrup
  9. 即时通讯开发时Https的安全性原理
  10. [网络安全设备——物理隔离设备2]物理隔离网闸常见概念问题解答