<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      (翻譯) V Rising's Animation Layering in Unity

      https://80.lv/articles/v-rising-s-animation-layering-in-unity/

       

      Stunlock Studios' Technical Animator Albin Thunstr?m showed the character animation workflow used in V Rising, discussed how the layers were made, and mentioned different approaches to animating.

      Stunlock Studios 的技術動畫師 Albin Thunstr?m 展示了《V Rising》中角色動畫的制作流程,講解了動畫層是如何構建的,并提到了多種不同的動畫實現方

      Animation Layering is when you want your Call of Duty soldier running around and reloading at the same time without skipping a step. You play your running animation on the pelvis and down and your gun-related animations on the torso and up. Easy-peasy, right? Well, it’s not always that simple. What happens when you want to combine running with swinging a sword? And what if you want to be able to use the same animations for when your character is running and for when they’re standing still? 

      動畫分層是指:當你希望《使命召喚》里的士兵一邊奔跑一邊換彈而不會跳幀時所用的技術。你可以在骨盆及以下部位播放奔跑動畫,同時在上半身播放與武器相關的動畫。聽起來很簡單,對吧?但實際操作并不總是那么容易。那如果你想把奔跑和揮劍動作結合起來呢?又或者你希望角色在奔跑和站立狀態下都能使用同一套動畫,又該怎么辦?

      I’ll show you how we handled these problems in V Rising. While our game is made in Unity, our solution was actually inspired by an Unreal Engine live training video, which goes to show how sharing an idea or a concept can have an impact that you never anticipated and how beneficial doing so is for our industry. So this is me paying it forward. While Unreal solved this issue with special Unreal-specific animation nodes, we solved it in Unity through the clever use of character rigs, real-time IK, and nested blend trees.

       我來展示一下我們在《V Rising》中是如何處理這些問題的。雖然我們的游戲是用 Unity 制作的,但我們的解決方案實際上是受一個 Unreal Engine 實時培訓視頻啟發的,這也說明了分享一個想法或概念可能帶來的意想不到的影響,以及這種分享對我們行業有多么有益。所以這也是我回饋行業的一種方式。雖然 Unreal 是通過一些特定于 Unreal 的動畫節點來解決這個問題的,而我們則是在 Unity 中巧妙地利用角色骨架、實時 IK 和嵌套混合樹來實現的。

      Let’s get started!

      To illustrate our problem, we start off by creating an Animator with two layers: one for the legs and one for the upper body animations. The leg layer usually has a blend tree that handles strafing in multiple directions, so we’ll add that. We add an Avatar Mask to the upper body layer that masks out the legs and then play a melee animation on it. You can find countless tutorials doing exactly this and leaving it there, but this is where we start to see the problem with doing so.

      為了說明我們的問題,我們首先創建一個 Animator,并設置兩個圖層:一個用于腿部動畫,另一個用于上半身動畫。腿部圖層通常包含一個用于處理多方向移動的混合樹,所以我們會加入這個部分。

      接著,我們在上半身圖層添加一個 Avatar Mask,用來屏蔽腿部,然后在該圖層播放一個近戰攻擊動畫。網上有無數教程都是這么做,并且就到此為止,但問題也正是從這里開始顯現的。

       

       Just using Avatar Masks gives the chest the incorrect rotations.

       僅僅使用 Avatar Mask 會導致胸部的旋轉不正確。

      Straightening out the spine 拉直脊柱

      First off the torso animation will have incorrect rotations because the pelvis rotation, which by being higher up in the hierarchy influences the torso, doesn’t match the ability animation anymore since it’s masked out and only influenced by the running animations.

      We fix that by using a reference/proxy joint. This joint is parented directly underneath the character's root, but in Maya (or Blender, whatever you prefer) it’s constrained to the chest joint.

      That way, when we export our animations from Maya/Blender, this joint will receive the exact same position and rotation data as the chest without being influenced by the pelvis.

      首先,軀干動畫的旋轉會出現錯誤,因為骨骼層級中位置更高的骨盆旋轉不再與技能動畫匹配。由于骨盆在 Avatar Mask 中被屏蔽,只受到奔跑動畫的影響,因此會影響上層的軀干。

      為了解決這個問題,我們使用一個參考關節(proxy joint)。這個關節直接作為角色 Root 的子節點,但在 Maya(或 Blender,任選你喜歡的工具)中,它是通過約束綁定到胸部關節上的。

      這樣,在我們從 Maya 或 Blender 導出動畫時,這個參考關節會接收到與胸部完全一致的位置和旋轉數據,但不會受到骨盆的影響。

      Now in our upper body Avatar Mask in Unity, we make sure to include this joint, which will leave us a perfect reference for exactly what the chest should look like.

      We then use IK to force the chest to match this reference joint. This can be used with a Chain IK Constraint from Unity's Animation Rigging package or with something like FinalIK’s CCD IK and Aim IK components.

      How you want to do it is up to you as long as you get the chest to match the rotation on every axis.

      接下來,在 Unity 的上半身 Avatar Mask 中,我們確保包含這個參考關節,從而為胸部提供一個精確的參考位置。

      然后我們使用 IK 強制讓胸部對齊這個參考關節。

      這可以通過 Unity Animation Rigging 套件中的 Chain IK Constraint 來實現,或者使用像 FinalIK 的 CCD IK 和 Aim IK 組件。

      使用哪種方式取決于你,但關鍵是要確保胸部在每個軸上的旋轉都能與參考關節匹配。

       Correct chest rotation using IK.

       

      Rotating the hips 旋轉臀部

      The next problem is that when you play your melee attack, you might end up breaking your character’s back. A sword swing needs to convey power and force, but if you apply the necessary rotation to your torso while keeping your hips straight, you’ll get an unnatural (and for your character, probably painful) twist of the spine.

      下一個問題是,當你播放近戰攻擊動畫時,可能會讓角色的脊柱看起來像是被“扭斷”了。一次揮劍攻擊需要傳達出力量與沖擊感,但如果你在上半身施加了所需的旋轉,而臀部卻保持不動,就會導致一個非常不自然(對角色來說可能也很“痛苦”)的脊柱扭曲

      What we want to do is have the lower half of the body twist along with the torso without messing with the foot placements. How do we do that? Let’s try to visualize what that would look like. I would even encourage you to run around and try it for yourself! Imagine this: your character is running forward and their swing has twisted their chest so that it is facing to their right, along with their pelvis to support it, but the feet still need to run forward. Now, that would probably look like they are strafing to their left, but that left being forward (see GIF). Okay, cool, so how do we achieve this?

      我們真正想要的效果是:下半身在不影響雙腳落點的前提下,也隨著上半身一起進行一定程度的扭轉。那我們該怎么做呢?我們可以試著想象一下這種動作會是什么樣子——甚至我鼓勵你親自試著跑起來做個動作體會一下!

      想象一下:你的角色正在向前跑,同時進行一次揮砍,動作中胸部已經扭向了右側,為了支撐這個動作,骨盆也需要向右旋轉,但雙腳仍然要保持向前奔跑。看起來,這個姿態可能就像是在向左側移動,但實際上那個“左”就是角色當前的正前方(參考 GIF)。好,理解了這個姿態之后,我們來看看該怎么實現它。

       A pelvis twist results in strafing.  骨盆的扭轉會導致角色呈現出側移(strafing)的姿態。

       

      Imagine a normal two-dimensional blend tree for strafing (you can find it in any YouTube tutorial). In its simplest form, it contains 4 animations: run forward, run backward, strafe left, and strafe right. However, in all of these animations, the character is facing forward. Let’s instead replace all of these animations with blend trees of their own that support running in their designated direction, but that can also face every other direction. We’re pretty much reversing the setup, where a normal blend tree for strafing would run in all directions but only face one (being forward), these nested blend trees run in one direction but can face all directions. With this tree, we can now, without actually turning the character, run in all directions and face all directions.

      想象一下一個普通的二維側移(strafing)混合樹(Blend Tree),你可以在任何一個 YouTube 教程中看到它。最簡單的形式包含四個動畫:向前跑、向后跑、向左側移和向右側移。然而,在這些動畫中,角色的朝向始終是正前方。

      現在我們來改變思路,把這些動畫都替換成各自的混合樹,這些新的混合樹不僅支持角色朝指定方向移動,還能讓角色朝任意方向面向。

      我們基本上是將傳統設置“反過來”使用:通常的 strafing 混合樹是角色可以向任意方向移動,但始終面朝前方;而我們的嵌套混合樹是角色朝一個方向移動,但可以面向所有方向。

      通過這種樹結構,我們現在就可以在不真正旋轉角色的前提下,實現角色既能向所有方向移動,也能朝任意方向面向。

       

       All nested blend trees, running in their own direction but facing any direction. 所有嵌套混合樹,角色在各自的方向上奔跑,但可以面向任意方向。

       

       

      We use four variables to control the Blend Trees: inputX, inputY, twistX, and twistY. The first two are the normal ones you need for a normal strafing blend tree – the dot products of the character's movement direction and the character’s right/forward direction. Here’s some pseudo-code for the sake of explanation:

      我們使用四個變量來控制混合樹:inputXinputYtwistXtwistY。前兩個是用在普通 strafing 混合樹中的常規變量——它們分別是角色移動方向與角色自身右方向和前方向的點積。下面是為了說明用的一段偽代碼:

      inputX = Vector3.Dot(transform.right, velocity);

      inputY = Vector3.Dot(transform.forward, velocity);

      The other two variables control the nested blend trees and are the dot product of the character’s proxy chest joint’s forward direction (which we created earlier) and the character’s right/forward direction.

      另外兩個變量用于控制嵌套混合樹,它們是角色的代理胸部關節(之前我們創建的那個)的前方向與角色自身右方向和前方向的點積。

      twistX = Vector3.Dot(transform.right, chestReference.forward);

      twistY = Vector3.Dot(transform.forward, chestReference.forward);

      In case you are wondering what a dot product is, it’s math magic. The simple explanation is: it takes two vectors and returns a float value. When the two vectors face the same direction, you get 1, when they face the exact opposite direction to one another, you get -1, and if they are perpendicular to one another, you get 0. This is exactly what we want for our blend tree! It might be a good idea however to remove the y-axis in these calculations since we’re only working in the two other axes anyway.

      如果你在想“點積”到底是什么,其實就是一種數學魔法。簡單來說,它接收兩個向量并返回一個浮點值:

      • 當兩個向量朝同一個方向時,結果是 1;

      • 當它們方向完全相反時,結果是 -1;

      • 如果它們互相垂直,則結果是 0。

      這正是我們在混合樹中所需要的!不過,建議在計算時去除 Y 軸的影響,因為我們只關心另外兩個軸上的變化。

       Basic Unity blend tree for strafing, but with nested blend trees. 這是一個基礎的 Unity strafing 混合樹結構,但內部嵌套了多個混合樹

      • 主混合樹(2D Blend Tree)使用 inputXinputY 控制角色移動方向(如前、后、左、右)。

      • 每個方向節點(如“向前跑”、“向左跑”等)不再是單一動畫,而是一個嵌套的 2D 混合樹。

      • 每個嵌套混合樹使用 twistXtwistY 控制角色朝向(面向前、后、左、右等)。

      這樣角色可以在奔跑時不僅朝任意方向移動,還可以面向任意方向,實現完全自由的動作表現。

      Final Result

       And there we have our final result! Our chest is doing the exact same motion as the original animation intended. And even though the character could be running in any direction, the feet will always keep running in that direction while still allowing the pelvis to support the twist rotation in the chest. A nice bonus we got from this solution was that even in animations where the character is doing a spin, they could still do it while running since the feet and pelvis can support any direction.

       

      最終效果就這樣實現了!現在我們的胸部能夠完全按照原始動畫的動作來運動。即使角色在任意方向奔跑,雙腳依然會保持正確的奔跑方向,同時骨盆也可以很好地支撐胸部的扭轉旋轉。

      這個方案帶來的一個額外好處是:即使在角色做旋轉動作的動畫中,也能邊跑邊旋轉,因為腳步和骨盆都能靈活適應任何方向的變化。

       Twists are automatically supported. (Santa hats are not automatically included.) 扭轉動作會被自動支持。(圣誕帽則不會自動包含。)

       

      Extra and alternative approaches

      On V Rising, we actually didn’t use the chest direction when calculating the nested blend tree variables. Instead, we used another proxy joint, just like the one for the chest but for the pelvis. This way we didn’t overdo the twisting and also kept the rotation closer to the animator’s intentions. That is also what you’re seeing in these GIFs. Try it out for yourself to see whichever works best for you.

      Another thing we did, which I also recommend, is switching out the melee animation when running to one that is keeping the spine much straighter. This way you can put the character in a position where they look less likely to fall over. 

      You could also do it the Unreal Training Video way, by not using nested blend trees (or blend spaces in “Unrealian”) but by actually rotating the character’s root instead. That way you don’t have to re-export rotated versions of the same animations in every direction – the normal strafe animations will do fine. However, you would also need to consider how you’d rotate your character’s root without altering the proxy joints.

      在《V Rising》中,我們實際上在計算嵌套混合樹變量時并沒有使用胸部的朝向,而是使用了另一個代理關節,類似于胸部的那個,但這次是用于骨盆的。這樣做的好處是避免了過度扭轉,同時讓旋轉更接近動畫師原本的設計意圖。你在這些 GIF 中看到的也是這種方式的效果。建議你親自試試看哪種方式更適合你的項目。

      我們還做了另一項優化,也推薦你嘗試:在角色奔跑時替換掉普通的近戰攻擊動畫,使用一個保持脊柱更直的版本。這樣角色看起來會更穩定,更不容易失衡。

      你也可以采用 Unreal 培訓視頻中的做法——不是使用嵌套混合樹(或者在 Unreal 中叫做 Blend Spaces),而是直接旋轉角色的 Root 節點。這樣你就無需為每個方向重新導出帶旋轉的動畫,普通的 strafing 動畫就足夠用了。但這樣做也需要你思考如何在不影響代理關節的情況下對角色 Root 進行旋轉

       

       

       

      posted @ 2025-04-20 18:28  sun_dust_shadow  閱讀(90)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 日本亚洲一区二区精品久久| 大尺度国产一区二区视频| 日韩av一区二区精品不卡| 亚洲婷婷六月的婷婷| 亚洲AV国产福利精品在现观看| 久久精品国产99精品亚洲| 男人的天堂av社区在线| 国产精久久一区二区三区| 黄色大全免费看国产精品| 亚洲精品综合一区二区在线| 亚洲午夜理论片在线观看| 全免费A级毛片免费看无码| 亚洲综合在线日韩av| 丁香花成人电影| 国产小受被做到哭咬床单GV| 国精品午夜福利不卡视频| 国产美女久久久亚洲综合| 美女胸18大禁视频网站| 福利一区二区1000| 日韩丝袜欧美人妻制服| 国产精品成人av在线观看春天 | 亚洲午夜福利网在线观看| 强插少妇视频一区二区三区| 91老肥熟女九色老女人| 天堂网亚洲综合在线| 国产精品第一页中文字幕| 久久男人av资源站| 免费看的一级黄色片永久| 免费夜色污私人影院在线观看| 欧美牲交a欧美牲交aⅴ图片| 亚洲综合国产伊人五月婷| 国产真人无码作爱视频免费| 国产亚洲精品AA片在线播放天| 国产偷拍自拍视频在线观看| 成人无码潮喷在线观看| 波多野结衣一区二区三区高清| 风流老熟女一区二区三区| 国产午夜亚洲精品国产成人| 礼泉县| 亚洲国产午夜精品理论片| 欧美成人午夜在线观看视频|