Creating an animation rig in Blender: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(Added Things to know before starting, Tools and relevant tutorials, Rotation order issue between Oni and Blender)
m (copy edit)
Line 1: Line 1:
==Introduction==
==Introduction==
This tutorial describes how to create the Animation rig for Blender (ARB) by Geyser, shown here, with some improvements.
This tutorial shows you how to create the [http://mods.oni2.net/node/388 animation rig for Blender] (made by geyser), with some improvements.


The purpose of this rig is to give us much better tools to animate, compared to our [http://oni.bungie.org/forum/viewtopic.php?pid=23698#p23698 previous process in Softimage XSI] by EdT, which allowed us to animate exclusively with Forward Kinematics, which, while may work for simple, short animations done on characters with small amount of bones, it does not work well for Oni characters and animations, as it's too labour intensive and ineffective.
The purpose of this rig is to give us much better tools to animate, compared to our [http://oni.bungie.org/forum/viewtopic.php?pid=23698#p23698 previous process in Softimage XSI] by EdT, which allowed us to animate exclusively with Forward Kinematics. While FK may work for simple, short animations done on characters with a small amount of bones, it does not work well for Oni characters and animations, as it's too labor-intensive and inefficient.


==Prerequisite tutorials==
==Prerequisite tutorials==
Line 30: Line 30:




Blender custom properties and '''drivers''' (Drivers are used to set influence of rig's bone constraints through Pose1 and Pose2 bones locations):
Blender custom properties and '''drivers''' (drivers are used to set the influence of a rig's bone constraints through the Pose1 and Pose2 bone locations):
* [https://www.youtube.com/watch?v=_197jQFh22E Custom properties and drivers in blender made easy] by Pierrick Picaut
* [https://www.youtube.com/watch?v=_197jQFh22E Custom properties and drivers in blender made easy] by Pierrick Picaut


===Tracking constraint tutorials===
===Tracking constraint tutorials===
These explain constraints like Damped Track which are used by Rigify - you can skip this if you want, but it might explain a thing or two or come in handy in distant future, but other than that you don't need to know them to animate for Oni:
These explain constraints like Damped Track which are used by Rigify you can skip this if you want, but it might explain a thing or two, or come in handy in the distant future; other than that, you don't need to know them to animate for Oni:
* [https://www.youtube.com/watch?v=aGBOu-dNZ-w Tracking Constraints - Blender 2.80 Fundamentals]
* [https://www.youtube.com/watch?v=aGBOu-dNZ-w Tracking Constraints - Blender 2.80 Fundamentals]
* [https://www.youtube.com/watch?v=5FK4jDCAOkk Camera Track To vs Damped Track Constraints | Pros & Cons Explained With Examples | Blender] by 5 minutes Blender
* [https://www.youtube.com/watch?v=5FK4jDCAOkk Camera Track To vs Damped Track Constraints | Pros & Cons Explained With Examples | Blender] by 5 minutes Blender


==Things to know before you starting==
==Things to know before starting==
There are several things worth knowing before you start creating the rig.
There are several things worth knowing before you start creating the rig.


===Tools and relevant tutorials===
===Tools and relevant tutorials===
===Rotation order issue between Oni and Blender===
===Rotation order issue between Oni and Blender===
The previous XSI process allowed us to get to work pretty quickly: you could simply export any animation from Oni as a COLLADA file using OniSplit, then import it to XSI and it would work without (mostly) any quirks. That is not the case with Blender.
The previous XSI process allowed us to get to work pretty quickly: you could simply export any animation from Oni as a COLLADA file using OniSplit, then import it to XSI and it would work (mostly) without any quirks. That is not the case with Blender.


If you import any Oni animation into Blender as it is, the rotations will be all wrong.
If you import any Oni animation into Blender as it is, the rotations will be all wrong.


That's because Oni's rotations are stored in XYZ Euler rotation order, while Blender's XYZ is actually ZYX, it's just called XYZ.
That's because Oni's rotations are stored in XYZ Euler rotation order, while Blender's XYZ is actually ZYX despite being called "XYZ".


You can prove that by simply switching the rotation order of the body parts from XYZ to ZYX, as shown below - the image on the left shows KONCOMcomb_p imported to Blender without any adjustments, with the rotation order set as default Blender's XYZ, while image on the right shows the same animation after switching the rotation order to ZYX.
You can prove that by simply switching the rotation order of the body parts from XYZ to ZYX, as shown below the image on the left shows KONCOMcomb_p imported to Blender without any adjustments, with the rotation order set to Blender's default "XYZ", while the image on the right shows the same animation after switching the rotation order to ZYX.


{| class="wikitable"
{| class="wikitable"
|-
|-
! KONCOMcomb_p in Blender's XYZ !! KONCOMcomb_p in Blender's ZYX
! KONCOMcomb_p in Blender's XYZ !! KONCOMcomb_p in ZYX
|-
|-
| [[Image:ARB KONCOMcomb p XYZ.png|500px|frameless]]
| [[Image:ARB KONCOMcomb p XYZ.png|500px|frameless]]
Line 60: Line 59:
|}
|}


Because of this, Geyser implemented the '''-blender''' argument in OniSplit, which solves this problem by converting Oni assets' rotation order from XYZ to Quaternions and then to ZYX, and vice versa when exporting assets from Blender to Oni. So that conversion flow looks as follows:
Because of this, geyser implemented the '''-blender''' argument in OniSplit, which solves this problem by converting Oni assets' rotation order from XYZ to Quaternions and then to ZYX, and vice versa when exporting assets from Blender to Oni. So that conversion flow looks as follows:


*From Oni to Blender:
*From Oni to Blender:
Line 68: Line 67:
ZYX → Quaternions → XYZ
ZYX → Quaternions → XYZ


To summarize: '''Always use -blender argument when you're exporting assets from Oni to Blender,''' otherwise, expect the problem shown in the above screenshots.
To summarize: '''Always use the -blender argument when you're exporting assets from Oni to Blender''', otherwise you can expect the problem shown in the above screenshots.


[[Category:Modding tutorials]]
[[Category:Modding tutorials]]

Revision as of 11:44, 7 September 2021

Introduction

This tutorial shows you how to create the animation rig for Blender (made by geyser), with some improvements.

The purpose of this rig is to give us much better tools to animate, compared to our previous process in Softimage XSI by EdT, which allowed us to animate exclusively with Forward Kinematics. While FK may work for simple, short animations done on characters with a small amount of bones, it does not work well for Oni characters and animations, as it's too labor-intensive and inefficient.

Prerequisite tutorials

I highly recommend watching the tutorials below if you feel you're lacking knowledge in any of these subjects:


General Blender basics:


Blender Character Rigging overview showing that you can create a Rigify rig in less than a minute at 5:43, and also rig a character while at it:


Basics of using Rigify:


Rigify Bone Groups and Layers:


Changing Rigify Custom Shapes and Widgets:


Blender custom properties and drivers (drivers are used to set the influence of a rig's bone constraints through the Pose1 and Pose2 bone locations):

Tracking constraint tutorials

These explain constraints like Damped Track which are used by Rigify – you can skip this if you want, but it might explain a thing or two, or come in handy in the distant future; other than that, you don't need to know them to animate for Oni:

Things to know before starting

There are several things worth knowing before you start creating the rig.

Tools and relevant tutorials

Rotation order issue between Oni and Blender

The previous XSI process allowed us to get to work pretty quickly: you could simply export any animation from Oni as a COLLADA file using OniSplit, then import it to XSI and it would work (mostly) without any quirks. That is not the case with Blender.

If you import any Oni animation into Blender as it is, the rotations will be all wrong.

That's because Oni's rotations are stored in XYZ Euler rotation order, while Blender's XYZ is actually ZYX despite being called "XYZ".

You can prove that by simply switching the rotation order of the body parts from XYZ to ZYX, as shown below – the image on the left shows KONCOMcomb_p imported to Blender without any adjustments, with the rotation order set to Blender's default "XYZ", while the image on the right shows the same animation after switching the rotation order to ZYX.

KONCOMcomb_p in Blender's XYZ KONCOMcomb_p in ZYX
ARB KONCOMcomb p XYZ.png ARB KONCOMcomb p ZYX.png

Because of this, geyser implemented the -blender argument in OniSplit, which solves this problem by converting Oni assets' rotation order from XYZ to Quaternions and then to ZYX, and vice versa when exporting assets from Blender to Oni. So that conversion flow looks as follows:

  • From Oni to Blender:

XYZ → Quaternions → ZYX

  • From Blender to Oni:

ZYX → Quaternions → XYZ

To summarize: Always use the -blender argument when you're exporting assets from Oni to Blender, otherwise you can expect the problem shown in the above screenshots.