Creating an animation rig in Blender: Difference between revisions

m
various section link fixes; also did a partial pass of wiki markup and grammar touchup
(→‎Overview of the rig: clarified why do we have T-Pose, Pose 1 and Pose 2 collections in the rig)
m (various section link fixes; also did a partial pass of wiki markup and grammar touchup)
Line 1: Line 1:
==Introduction==
This tutorial shows you how to create the [http://mods.oni2.net/node/388 animation rig for Blender] (made by geyser) from scratch, with some improvements.
This tutorial shows you how to create the [http://mods.oni2.net/node/388 animation rig for Blender] (made by geyser) from scratch, 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. 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.
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.


'''If you are looking for information on how to use the rig, please refer to the article on that available [[Using_the_Rigify_animation_rig|HERE.]]'''
'''If you are looking for information on how to use the rig, please refer to the article on that available [[Using_the_Rigify_animation_rig|HERE]].'''


==Prerequisite tutorials==
==Prerequisite tutorials==
Line 15: Line 14:


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:
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:
* [https://youtu.be/f2pTkW-1JkE?t=343 Character Rigging - Blender 2.80 Fundamentals]
* [https://youtu.be/f2pTkW-1JkE?t=343 Character Rigging Blender 2.80 Fundamentals]




Practical and intuitive explanation of what Inverse and Forward Kinematics (IK/FK) are - this is explained in Maya, but same principles apply in every 3D editing program including Blender:
Practical and intuitive explanation of what Inverse and Forward Kinematics (IK/FK) are this is explained in Maya, but same principles apply in every 3D editing program including Blender:
* [https://www.youtube.com/watch?v=p6PYKyxR0aY Animating with IK and FK]
* [https://www.youtube.com/watch?v=p6PYKyxR0aY Animating with IK and FK]




Basics of using Rigify:
Basics of using Rigify:
* [https://www.youtube.com/watch?v=vKgH5zXIYmM Rigify Tutorial #08 - Posing the Rigify rig] by CGDive
* [https://www.youtube.com/watch?v=vKgH5zXIYmM Rigify Tutorial #08 Posing the Rigify rig] by CGDive




Line 33: Line 32:


Changing Rigify Custom Shapes and Widgets:
Changing Rigify Custom Shapes and Widgets:
* [https://www.youtube.com/watch?v=beVtWATcw9U Rigify - Custom Shapes/Widgets] by CGDive
* [https://www.youtube.com/watch?v=beVtWATcw9U Rigify Custom Shapes/Widgets] by CGDive




Line 41: Line 40:
===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 give you a better idea of how Rigify's MCH (Mechanical) layers work, or come in handy in the distant future; 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 give you a better idea of how Rigify's MCH (Mechanical) layers work, 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


Line 48: Line 47:


===Tools and relevant tutorials===
===Tools and relevant tutorials===
[[Image:Cmder.png|200px|right|thumb|Screenshot showing Cmder's capabilities within the context of modding Oni]]
[[Image:Cmder.png|200px|right|thumb|Screenshot showing Cmder's capabilities within the context of modding Oni.]]
* [http://mods.oni2.net/node/38 '''Current version of OniSplit.'''] This is the tool needed to import and export assets out of Oni. '''DO NOT USE OniSplit GUI or Vago for importing Oni assets into Blender''' - neither of these weren't updated in a long time, and thus they don't support OniSplit's v0.9.99.2 -blender option. You can still use them for other purposes though, such as sounds and converting .oni files to XMLs, etc.
* [http://mods.oni2.net/node/38 '''Current version of OniSplit.'''] This is the tool needed to import and export assets out of Oni. '''DO NOT USE OniSplit GUI or Vago for importing Oni assets into Blender''' neither of these weren't updated in a long time, and thus they don't support OniSplit's v0.9.99.2 -blender option. You can still use them for other purposes though, such as sounds and converting .oni files to XMLs, etc.
* [https://cmder.net/ '''Cmder'''] (Windows only) - because OniSplit is a command line tool, it is highly recommended to get any upgrade to Windows' Command Prompt. As shown in the screenshot on the right, Cmder allows you to start it from the context menu in any selected folder, and it also remembers your most recently used commands, vastly improving your workflow when you're forced to use any command line tools.
* [https://cmder.net/ '''Cmder'''] (Windows only) because OniSplit is a command line tool, it is highly recommended to get any upgrade to Windows' Command Prompt. As shown in the screenshot on the right, Cmder allows you to start it from the context menu in any selected folder, and it also remembers your most recently used commands, vastly improving your workflow when you're forced to use any command line tools.
* [https://docs.blender.org/manual/en/2.81/addons/rigging/rigify.html '''Rigify'''] - it's a plugin for Blender designed to automate a lot of rigging work. The rig described here is generated using Rigify.
* [https://docs.blender.org/manual/en/2.81/addons/rigging/rigify.html '''Rigify'''] it's a plugin for Blender designed to automate a lot of rigging work. The rig described here is generated using Rigify.
* [https://docs.google.com/document/d/175uJGklYASAgrFjxuUG4-kJRDoMTjjP7GvNxSj1GscU/edit '''Oni-Blender tutorial'''] by EdT. Please read this in entirety to know likely-to-happen issues and refer to this as your guide for OniSplit commands relating to Blender.
* [https://docs.google.com/document/d/175uJGklYASAgrFjxuUG4-kJRDoMTjjP7GvNxSj1GscU/edit '''Oni-Blender tutorial'''] by EdT. Please read this in entirety to know likely-to-happen issues and refer to this as your guide for OniSplit commands relating to Blender.
* [http://oni.bungie.org/forum/viewtopic.php?pid=23230#p23230 '''Brief overview on creating TRAMs'''] by EdT - while this was written with XSI in mind, this is still relevant as the process for preparing the XML files for Oni is still the same. Also the next post in that thread, called '''Brief walk through on modifying a TRAM,''' is an example of that overview put into practice.
* [http://oni.bungie.org/forum/viewtopic.php?pid=23230#p23230 '''Brief overview on creating TRAMs'''] by EdT while this was written with XSI in mind, this is still relevant as the process for preparing the XML files for Oni is still the same. Also the next post in that thread, called '''Brief walk through on modifying a TRAM,''' is an example of that overview put into practice.


===Assorted issues in Blender===
===Assorted issues in Blender===
Line 61: Line 60:
Here is an overview of how the rig works: As stated before, our previous animating process was limited to FK only, which is inefficient for Oni. So instead we desperately needed an IK/FK capable rig, to which we would be able to snap a character, so we could animate him/her.
Here is an overview of how the rig works: As stated before, our previous animating process was limited to FK only, which is inefficient for Oni. So instead we desperately needed an IK/FK capable rig, to which we would be able to snap a character, so we could animate him/her.


At the same time, the rig would have to be capable of the opposite thing - snapping itself to the animated character. That's because most often the way we start out with making a new animation is copying the first or last frame of the preceeding animation. This functionality has been implemented, and is called Pose Matching. The way it works is simple - it uses bone constraints in rig controller bones targeting the character model in order to snap the rig to the model.
At the same time, the rig would have to be capable of the opposite thing snapping itself to the animated character. That's because most often the way we start out with making a new animation is copying the first or last frame of the preceding animation. This functionality has been implemented, and is called Pose Matching. The way it works is simple it uses bone constraints in rig controller bones targeting the character model in order to snap the rig to the model.


The rig uploaded on Oni Mod Depot contains three Konokos by default: One T-Posed Konoko and two animated ones, all stored in their own collections. The T-Posed Konoko is there because it was easiest to build the rig off a T-Pose, while the remaining two ones, stored in Pose 1 and Pose 2 collections, is where you are supposed to store your animated characters, to which you can Pose Match, and thus check if Pose Matching works as intended.
The rig uploaded on Oni Mod Depot contains three Konokos by default: One T-Posed Konoko and two animated ones, all stored in their own collections. The T-Posed Konoko is there because it was easiest to build the rig off a T-Pose, while the remaining two ones, stored in Pose 1 and Pose 2 collections, is where you are supposed to store your animated characters, to which you can Pose Match, and thus check if Pose Matching works as intended.
Line 75: Line 74:
# Import the animation you are using as a starting point.
# Import the animation you are using as a starting point.
## If you did point 3, apply the textures on the animated model.
## If you did point 3, apply the textures on the animated model.
# Using the RigBoneConstraintTargetSetter script available [[Blender#Rig_bone_constraint_target_setting_script|HERE]], set the targets of the rig's bone constraints to be the body parts of the animation you've imported.
# Using the RigBoneConstraintTargetSetter script available [[Blender/Obsolete scripts#Rig bone constraint target setting script|HERE]], set the targets of the rig's bone constraints to be the body parts of the animation you've imported.
# Using the Pose Matching functionality, constrain the rig to the imported animation (Set the IK-FK sliders on rig limbs to 1, as Pose Matching works only through FK controllers)
# Using the Pose Matching functionality, constrain the rig to the imported animation (Set the IK-FK sliders on rig limbs to 1, as Pose Matching works only through FK controllers)
# For each frame that you want to remain in your animation, while having all the bones selected (or the ones you want), press Ctrl+A, select Apply Visual Transform to Pose and keyframe it.
# For each frame that you want to remain in your animation, while having all the bones selected (or the ones you want), press Ctrl+A, select Apply Visual Transform to Pose and keyframe it.
# Disable bone constraints on the rig using the BoneConstraintEnabler script available [[Blender#Script_for_enabling.2Fdisabling_bone_constraints_in_the_selected_armature|HERE]].  
# Disable bone constraints on the rig using the BoneConstraintEnabler script available [[Blender/Obsolete scripts#Script for enabling.2Fdisabling bone constraints in the selected armature|HERE]].  
# '''Make your animation.'''
# '''Make your animation.'''
# Once your animation is ready, use the Visual Transformer script available [[Blender#Visual_transformer_script|HERE]] to bake the rig keyframes into the character model.
# Once your animation is ready, use the Visual Transformer script available [[Blender/Obsolete scripts#Visual transformer script|HERE]] to bake the rig keyframes into the character model.
# Using the ObjectConstraintEnabler script available [[Blender#Script_for_enabling.2Fdisabling_constraints_in_selected_objects|HERE]], disable the object constraints on the character model. '''The character model should now be animated and have the needed rotations and locations.
# Using the ObjectConstraintEnabler script available [[Blender/Obsolete scripts#Script for enabling.2Fdisabling constraints in selected objects|HERE]], disable the object constraints on the character model. '''The character model should now be animated and have the needed rotations and locations.
# Export the animation as a DAE.
# Export the animation as a DAE.


Line 89: Line 88:
For detailed explanation of the required OniSplit commands, please refer to the '''Oni-Blender Tutorial by EdT''' listed in the '''Tools and relevant tutorials'''.
For detailed explanation of the required OniSplit commands, please refer to the '''Oni-Blender Tutorial by EdT''' listed in the '''Tools and relevant tutorials'''.


[[Image:ARB SceneUponImportingKonokos.png|400px|right|thumb|Expected result by the end of this header]]
[[Image:ARB SceneUponImportingKonokos.png|400px|right|thumb|The expected result by the end of this section.]]


# Using OniSplit, export any character you want as a DAE (-extract:dae) using -noanim (T-Pose) and -blender arguments.  
# Using OniSplit, export any character you want as a DAE (-extract:dae) using -noanim (T-Pose) and -blender arguments.  
Line 96: Line 95:
# Using OniSplit, export any two animations as an XML (-extract:xml) using -anim-body (lets you specify the character you want) and -blender arguments.
# Using OniSplit, export any two animations as an XML (-extract:xml) using -anim-body (lets you specify the character you want) and -blender arguments.
## You should get '''one DAE and an XML file for each animation, totalling four files.'''  
## You should get '''one DAE and an XML file for each animation, totalling four files.'''  
# Open up Blender and set your scene's frame rate to 60 FPS. If you don't, the keyframes of the imported animations will get tightened up together, because Blender's default scene framerate is 24 FPS.
# Open up Blender and set your scene's frame rate to 60 FPS. If you don't, the keyframes of the imported animations will get tightened up together, because Blender's default scene frame rate is 24 FPS.
# Import the -noanim model into Blender first ('''MAKE SURE YOU CHECK THE ''Import Unit'' BOX''', otherwise you will import the model with arbitrary units which will break everything and will be basically unadjustable later)
# Import the -noanim model into Blender first ('''MAKE SURE YOU CHECK THE ''Import Unit'' BOX''', otherwise you will import the model with arbitrary units which will break everything and will be basically unadjustable later)
# Import the animations into Blender ('''ALSO MAKE SURE YOU CHECK THE ''Import Unit'' BOX EACH TIME''')
# Import the animations into Blender ('''ALSO MAKE SURE YOU CHECK THE ''Import Unit'' BOX EACH TIME''')
Line 102: Line 101:
# Create three new collections in the Outliner, name them ''T-pose'', ''Pose 1'' and ''Pose 2''. These three collections allow you to quickly hide the respective models from the Viewport using the eye icon in the Outliner.
# Create three new collections in the Outliner, name them ''T-pose'', ''Pose 1'' and ''Pose 2''. These three collections allow you to quickly hide the respective models from the Viewport using the eye icon in the Outliner.
## Move the T-Posed model to ''T-pose'', and move ''.001'' and ''.002'' animated models to ''Pose 1'' and ''Pose 2'' collections respectively.
## Move the T-Posed model to ''T-pose'', and move ''.001'' and ''.002'' animated models to ''Pose 1'' and ''Pose 2'' collections respectively.
# If you've imported the textured model, [[#Broken_alpha_transparency_and_textures_on_animated_models|apply textures to the animated models and fix the alpha transparency issue.]]
# If you've imported the textured model, [[Blender#Lack of textures on animated models|apply textures to the animated models]] and [[Blender#Alpha transparency issue|fix the alpha transparency issue]].
# At this point, your scene should look as shown in the screenshot on the right.
# At this point, your scene should look as shown in the screenshot on the right.
# You can hide the Pose 1 and Pose 2 collections - they won't be changed in this tutorial anymore.
# You can hide the Pose 1 and Pose 2 collections they won't be changed in this tutorial anymore.


==Adjusting T-posed model's Z location==
==Adjusting T-posed model's Z location==
At this moment the T-posed model is sunk to the ground. That's because the pelvis location is set to 0,0,0. All of the animations in Oni have their heights adjusted [[XML:TRAM#List_of_tags.2C_types.2C_and_flags|(through the <Height> tags)]] so that the pelvis is roughly at Z ~ 0.9, so that the characters appear standing on the floor instead of, again, sinking into it. For this reason, we want to adjust the position of the pelvis so that the feet soles are aligned with the floor.
At this moment the T-posed model is sunk to the ground. That's because the pelvis location is set to 0,0,0. All of the animations in Oni have their heights adjusted [[XML:TRAM#List_of_tags.2C_types.2C_and_flags|(through the <Height> tags)]] so that the pelvis is roughly at Z ~ 0.9, so that the characters appear standing on the floor instead of, again, sinking into it. For this reason, we want to adjust the position of the pelvis so that the feet soles are aligned with the floor.


[[Image:PelvisZLocation.png|400px|right|thumb|Expected result by the end of this header]]
[[Image:PelvisZLocation.png|400px|right|thumb|The expected result by the end of this section.]]


# <li value="10">Adjust the Z position of the T-posed model's Pelvis in one of the two ways:</li>
# <li value="10">Adjust the Z position of the T-posed model's Pelvis in one of the two ways:</li>
## Simply switch to Front Ortographic view (Num 1) and move the Pelvis along the Z axis so that the feet soles are roughly aligned with the floor. This will work, but if you want 100% accuracy, use the method below.
## Simply switch to Front Orthographic view (Num 1) and move the Pelvis along the Z axis so that the feet soles are roughly aligned with the floor. This will work, but if you want 100% accuracy, use the method below.
## The 3D Cursor snapping method:
## The 3D Cursor snapping method:
### Select one of the feet in Object mode.
### Select one of the feet in Object mode.
Line 142: Line 141:
|}
|}


# <li value="13">Enable Rigify in Blender if you haven't already - you can do that by going to Edit / Preferences / Addons and looking it up, as Rigify comes with by Blender by default.</li>
# <li value="13">Enable Rigify in Blender if you haven't already you can do that by going to Edit / Preferences / Addons and looking it up, as Rigify comes with by Blender by default.</li>
# Add a Basic Human Metarig  to the scene. ( Add Menu / Armature / Basic / Basic Human (Meta-Rig) )
# Add a Basic Human Metarig  to the scene. ( Add Menu / Armature / Basic / Basic Human (Meta-Rig) )
## Scale the rig by 10 or so that it's roughly the size of the character.
## Scale the rig by 10 or so that it's roughly the size of the character.
Line 149: Line 148:
## Open Viewport Display,
## Open Viewport Display,
## Check ''In Front'' box to make the metarig easier to select when your Viewport is in Solid or Material Preview shading modes,
## Check ''In Front'' box to make the metarig easier to select when your Viewport is in Solid or Material Preview shading modes,
## Check the ''Axes'' box to see the local axes of each bones - this makes their rolls easier to understand.
## Check the ''Axes'' box to see the local axes of each bones this makes their rolls easier to understand.
# Remove the following bones from the Metarig:
# Remove the following bones from the Metarig:
*pelvis.L
*pelvis.L
Line 172: Line 171:
|}
|}


# <li value="18">The default Rigify bone layer order is highly unergonomic. For this reason, reassign the following bones to bone layers in accordance with the table below. You can reassign bones' bone layers by selecting them and pressing M. Make sure you have enabled User Tooltips in Preferences / Interface - that way when you move your cursor over the layer box, a tooltip will display the layer number.</li>
# <li value="18">The default Rigify bone layer order is highly unergonomic. For this reason, reassign the following bones to bone layers in accordance with the table below. You can reassign bones' bone layers by selecting them and pressing M. Make sure you have enabled User Tooltips in Preferences / Interface that way when you move your cursor over the layer box, a tooltip will display the layer number.</li>


{| class="wikitable"
{| class="wikitable"
Line 204: Line 203:


# <li value="21"> Remove ''rig type'' on the ''spine.004'' bone.</li>
# <li value="21"> Remove ''rig type'' on the ''spine.004'' bone.</li>
# Set ''rig type'' on ''spine.003'' bone to ''spines.super_head''.  
# Set ''rig type'' on the ''spine.003'' bone to ''spines.super_head''.  
# Enable the ''Connect chain'' checkbox on the ''spine.003'' bone.
# Enable the ''Connect chain'' checkbox on the ''spine.003'' bone.
# Disable the ''Widget'' checkbox on ''shoulder.L'' and ''shoulder.R bones''.
# Disable the ''Widget'' checkbox on the ''shoulder.L'' and ''shoulder.R bones''.
# Set ''pivot_position'' on the ''spine'' bone to 1.
# Set ''pivot_position'' on the ''spine'' bone to 1.
# Enable the ''Custom Pivot Control'' checkbox on the ''spine'' bone.
# Enable the ''Custom Pivot Control'' checkbox on the ''spine'' bone.
Line 227: Line 226:
|}
|}


# <li value="29">Now you need to adjust metarig's bones so that they match up with character body parts. In order to reduce the amount of needed work, switch to Edit Mode and check the X-Axis Mirror either in Options or the Tool tab.</li>
# <li value="29">Now you need to adjust the metarig's bones so that they match up with character body parts. In order to reduce the amount of needed work, switch to Edit Mode and check the X-Axis Mirror either in Options or the Tool tab.</li>
# Switch to Object mode and using the Snapping Cursor to Active, and Snapping Selection to Cursor in the Snap menu (Shift + S), keep snapping cursor to model's body parts, selecting the Metarig, switching to Edit mode, selecting the appropriate bone and snapping it to 3D Cursor. '''I believe it is intuitive which bones should be snapped to which body parts, therefore there is no need for a table describing that, with the exception of hints on what should be done about spine.004, hand.L, hand.R, toe.L, toe.R, heel.02.L and heel.02.R.'''
# Switch to Object mode and using the Snapping Cursor to Active, and Snapping Selection to Cursor in the Snap menu (Shift + S), keep snapping cursor to model's body parts, selecting the Metarig, switching to Edit mode, selecting the appropriate bone and snapping it to 3D Cursor. '''I believe it is intuitive which bones should be snapped to which body parts, therefore there is no need for a table describing that, with the exception of hints on what should be done about spine.004, hand.L, hand.R, toe.L, toe.R, heel.02.L and heel.02.R.'''
## There is actually nothing you need to do about the heel bones, leave them as they are.
## There is actually nothing you need to do about the heel bones, leave them as they are.
## Snap the tails of spine.004, hand.L and hand.R to their heads and move them along the axis they're pointing at, to some whatever point that makes sense to you, e.g. furthest reaching vertex on the hand. No need to be precise here, and thus snapping - just move the tail so that it is roughly where you want it to be.
## Snap the tails of spine.004, hand.L and hand.R to their heads and move them along the axis they're pointing at, to some whatever point that makes sense to you, e.g. furthest reaching vertex on the hand. No need to be precise here, and thus snapping just move the tail so that it is roughly where you want it to be.
## In order to keep the toe bones aligned and properly positioned, do the following for each toe bone:
## In order to keep the toe bones aligned and properly positioned, do the following for each toe bone:
### Select the foot in object mode,
### Select the foot in object mode,
Line 271: Line 270:


# <li value="37">Copy the constraints to all of the remaining body parts.</li>
# <li value="37">Copy the constraints to all of the remaining body parts.</li>
# At this point, the character is folded into Oni's default pose, described [[Importing_character_models#Oni.27s_default_orientation|HERE.]] This is hard to work with, so disable all of the object constraints with the ObjectConstraintEnabler script available [[Blender#Script_for_enabling.2Fdisabling_constraints_in_selected_objects|HERE]]. We will also fix the folded pose in a moment.
# At this point, the character is folded into Oni's default pose, described [[Importing_character_models#Oni.27s_default_orientation|HERE.]] This is hard to work with, so disable all of the object constraints with the ObjectConstraintEnabler script available [[Blender/Obsolete scripts#Script for enabling.2Fdisabling constraints in selected objects|HERE]]. We will also fix the folded pose in a moment.
# Add a ''Copy Location'' constraint to the ''Pelvis'' and:
# Add a ''Copy Location'' constraint to the ''Pelvis'' and:
## Set the ''Target to ''rig'',
## Set the ''Target to ''rig'',
Line 278: Line 277:
# <li value="40">Now we need to fix the folded pose. This is done through a set of Empties with specified rotations, which are added to the rotation of each body part through the ''Copy Rotation.001'' constraint (this is also why the Mix of that constraint was set to ''After Original'').</li>
# <li value="40">Now we need to fix the folded pose. This is done through a set of Empties with specified rotations, which are added to the rotation of each body part through the ''Copy Rotation.001'' constraint (this is also why the Mix of that constraint was set to ''After Original'').</li>
## Create a new collection in the Outliner called "''Axis Correction Empties''".
## Create a new collection in the Outliner called "''Axis Correction Empties''".
## Add six Arrows Empties, all with their Name showing in the Viewport Display. ( Object Properties / Viewport Display / Name )
## Add six Arrows Empties, all with their Name showing in the Viewport Display. (Object Properties / Viewport Display / Name)
## Name the empties and place them in the proposed arbitrary postions using cursor snapping, and set their rotations according to the table below - you can place them however you want, as their location does not influence the rig in any way, however, proper placement makes them easy to edit if needed. It's also proposed to place the empties one meter either in front or behind the given body part.
## Name the empties and place them in the proposed arbitrary positions using cursor snapping, and set their rotations according to the table below you can place them however you want, as their location does not influence the rig in any way, however, proper placement makes them easy to edit if needed. It's also proposed to place the empties one meter either in front or behind the given body part.


[[Image:AxisCorrectionEmptyPlacement.png|200px|right|thumb|Proposed Axis Correction Empties' placement]]
[[Image:AxisCorrectionEmptyPlacement.png|200px|right|thumb|Proposed Axis Correction Empties' placement]]
Line 301: Line 300:


::#<li value="4"> In your Viewport, open the Viewport Overlay and enable Relationship Lines. These are the lines that will show you lines from constrained objects to their targets. They will give you a better sense of how body parts are copying rotations from the Empties you are about to make. You can also turn Relationship Lines off at any point if they're making the scene hard to read.</li>
::#<li value="4"> In your Viewport, open the Viewport Overlay and enable Relationship Lines. These are the lines that will show you lines from constrained objects to their targets. They will give you a better sense of how body parts are copying rotations from the Empties you are about to make. You can also turn Relationship Lines off at any point if they're making the scene hard to read.</li>
::# Set the ''Bones'' of ''Copy Rotation'' and ''Targets'' of ''Copy Rotation.001'' constraints in character's body parts in accordance with the table below. The table may be intimidating, but it should be logical enough and easy to copy and paste the targets and bones - all of the body parts get targeted to a corresponding ORG bone in the rig through ''Copy Rotation'' and get their Axis Correction rotation added through ''Copy Rotation.001'' set to appropriate empty.
::# Set the ''Bones'' of ''Copy Rotation'' and ''Targets'' of ''Copy Rotation.001'' constraints in character's body parts in accordance with the table below. The table may be intimidating, but it should be logical enough and easy to copy and paste the targets and bones all of the body parts get targeted to a corresponding ORG bone in the rig through ''Copy Rotation'' and get their Axis Correction rotation added through ''Copy Rotation.001'' set to appropriate empty.


[[Image:RigCharacterConstrained.png|600px|right|thumb|Expected result by the end of this header]]
[[Image:RigCharacterConstrained.png|600px|right|thumb|Expected result by the end of this header]]
Line 399: Line 398:


#<li value="47">Using 3D Cursor snapping, snap ''torso'' and ''torso_pivot'' bones to the ''mid'' body part.</li>
#<li value="47">Using 3D Cursor snapping, snap ''torso'' and ''torso_pivot'' bones to the ''mid'' body part.</li>
##Since ''torso'' and ''torso_pivot'' are of the same size, etc. and thus are overlapping each other, feel free to move their tails a bit in the appropriate axis. This applies to all overlapping bones in the rig - if they overlap, move the tail in the axis parallel to the bone.
##Since ''torso'' and ''torso_pivot'' are of the same size, etc. and thus are overlapping each other, feel free to move their tails a bit in the appropriate axis. This applies to all overlapping bones in the rig if they overlap, move the tail in the axis parallel to the bone.
#Reparent ''shoulder.L'' and ''shoulder.R'' bones from ''ORG-spine.003'' to ''ORG-spine.002''.
#Reparent ''shoulder.L'' and ''shoulder.R'' bones from ''ORG-spine.003'' to ''ORG-spine.002''.
# Controller bones are now adjusted, and we can move on to ORG and MCH layers. Select the ORG layer (31), reparent the bones and set their ''Connected'' box according to the table below. '''x''' means no change is needed.
# Controller bones are now adjusted, and we can move on to ORG and MCH layers. Select the ORG layer (31), reparent the bones and set their ''Connected'' box according to the table below. '''x''' means no change is needed.
Line 432: Line 431:
# With X-Axis mirror enabled, select the MCH-forearm_ik.R bone and extrude it perpendicularly to the axis of the arm. You should now have the MCH-forearm_ik.R.001 and MCH-forearm_ik.L.001 bones. These bones are needed for the wrist snapping function which we'll implement later.
# With X-Axis mirror enabled, select the MCH-forearm_ik.R bone and extrude it perpendicularly to the axis of the arm. You should now have the MCH-forearm_ik.R.001 and MCH-forearm_ik.L.001 bones. These bones are needed for the wrist snapping function which we'll implement later.


==Editing the bone constrants of ORG and MCH bone layers==
==Editing the bone constraints of ORG and MCH bone layers==
Now's the time to edit and add bone constraints.
Now's the time to edit and add bone constraints.


Line 485: Line 484:
==Changing custom shapes of rig controller bones==
==Changing custom shapes of rig controller bones==
We're getting close to the end. There's still a bit of work to do, but all that remains relates to the rig controller bones in Pose mode.
We're getting close to the end. There's still a bit of work to do, but all that remains relates to the rig controller bones in Pose mode.
This short header will focus on changing the shapes of the controller bones - these changes are purely visual and have no functional effect on the rig, however, they do make it more more ergonomic and easier to read.
This short header will focus on changing the shapes of the controller bones these changes are purely visual and have no functional effect on the rig, however, they do make it more more ergonomic and easier to read.
[[Image:Rig After Editing Custom Shapes.png|200px|right|thumb|Rig's expected state at point 69]]
[[Image:Rig After Editing Custom Shapes.png|200px|right|thumb|Rig's expected state at point 69.]]
#<li value="65>Switch over to all other bone layers except the MCH and ORG layers - all that was related to them is now done.</li>
#<li value="65>Switch over to all other bone layers except the MCH and ORG layers all that was related to them is now done.</li>
#Select the tweak_spine.001 bone:
#Select the tweak_spine.001 bone:
## Set the Custom Object to WGT-rig_thigh_parent.L - this will make it much more easier to read.
## Set the Custom Object to WGT-rig_thigh_parent.L this will make it much more easier to read.
## Set the Scale to 1.5.
## Set the Scale to 1.5.
## Disable the ''Scale to Bone Length'' checkbox.
## Disable the ''Scale to Bone Length'' checkbox.
Line 510: Line 509:
<pre>        props.bones = '["upper_arm_ik.L", "upper_arm_ik_target.L", "hand_ik.L"]'</pre>
<pre>        props.bones = '["upper_arm_ik.L", "upper_arm_ik_target.L", "hand_ik.L"]'</pre>


Add the following code snippet below it - this will add a button and functionality for the wrist snapping on the '''left''' arm - using the MCH-forearm_ik.L.001 bone that was created in points 52 and 53.
Add the following code snippet below it this will add a button and functionality for the wrist snapping on the '''left''' arm using the MCH-forearm_ik.L.001 bone that was created in points 52 and 53.
Also, replace <code>'''YOURRIGID'''</code> with your <code>rig_id</code> from point 71.
Also, replace <code>'''YOURRIGID'''</code> with your <code>rig_id</code> from point 71.


Line 524: Line 523:
#<li value="74"> Find the following line:
#<li value="74"> Find the following line:
<pre>        props.bones = '["upper_arm_ik.R", "hand_ik.R", "upper_arm_ik_target.R"]' </pre>
<pre>        props.bones = '["upper_arm_ik.R", "hand_ik.R", "upper_arm_ik_target.R"]' </pre>
Add the following code snippet below it - this will add a button and functionality for the wrist snapping on the '''right''' arm. Also, replace <code>'''YOURRIGID'''</code> with your <code>rig_id</code> from point 71.
Add the following code snippet below it this will add a button and functionality for the wrist snapping on the '''right''' arm. Also, replace <code>'''YOURRIGID'''</code> with your <code>rig_id</code> from point 71.


<pre>
<pre>
Line 626: Line 625:
##Add ''three'' Copy Rotation bone constraints, and move the one without the suffix to the bottom of the list (so the order of the bone constraints going from the top to bottom is ''Copy Rotation.001'', ''Copy Rotation.002'', ''Copy Rotation''). ''Copy Rotation.001'' and ''Copy Rotation.002'' will be used for pose matching, ''Copy Rotation'' will be used for axis correction.
##Add ''three'' Copy Rotation bone constraints, and move the one without the suffix to the bottom of the list (so the order of the bone constraints going from the top to bottom is ''Copy Rotation.001'', ''Copy Rotation.002'', ''Copy Rotation''). ''Copy Rotation.001'' and ''Copy Rotation.002'' will be used for pose matching, ''Copy Rotation'' will be used for axis correction.
##In the ''Copy Rotation'' constraint, set the ''Mix'' to ''After Original''.  
##In the ''Copy Rotation'' constraint, set the ''Mix'' to ''After Original''.  
#Now we'll have to add the drivers controlling the influence of each Copy Rotation constraint. As shown in Pierrick Picaut's tutorial, you can do that by right clicking on the Influence value and pressing ''Add Driver'' (same applies to any other property in any other constraint). Once you add a driver, you can edit it either through ''Edit Driver'' or through the Driver Editor - both are selectable within the same menu.
#Now we'll have to add the drivers controlling the influence of each Copy Rotation constraint. As shown in Pierrick Picaut's tutorial, you can do that by right clicking on the Influence value and pressing ''Add Driver'' (same applies to any other property in any other constraint). Once you add a driver, you can edit it either through ''Edit Driver'' or through the Driver Editor both are selectable within the same menu.
##Add a driver to the ''Influence'' of each ''Copy Rotation'' constraint in accordance with the table below:
##Add a driver to the ''Influence'' of each ''Copy Rotation'' constraint in accordance with the table below:
{| class="wikitable"
{| class="wikitable"
Line 690: Line 689:
#*foot_fk.L
#*foot_fk.L
#*foot_fk.R
#*foot_fk.R
#Unfortunately, because Blender at this moment does not copy drivers when copying bone constraints, the bone constraints you've just copied are lacking the drivers. Because of this, you have to copy the drivers manually - simply right click on the ''Influence'' value of ''Copy Rotation'' constraint, press ''Copy Driver'', and go through all bones in the upper list and ''Paste Driver'' onto the Influence of the ''Copy Rotation'' in each bone. '''Do this for all three ''Copy Rotation'' bone constraints.'''
#Unfortunately, because Blender at this moment does not copy drivers when copying bone constraints, the bone constraints you've just copied are lacking the drivers. Because of this, you have to copy the drivers manually simply right click on the ''Influence'' value of ''Copy Rotation'' constraint, press ''Copy Driver'', and go through all bones in the upper list and ''Paste Driver'' onto the Influence of the ''Copy Rotation'' in each bone. '''Do this for all three ''Copy Rotation'' bone constraints.'''
#Add two ''Copy Location'' constraints to ''torso'' and ''torso_pivot'' bones, and make sure they're named ''Copy Location.001'' and ''Copy Location.002''.
#Add two ''Copy Location'' constraints to ''torso'' and ''torso_pivot'' bones, and make sure they're named ''Copy Location.001'' and ''Copy Location.002''.
#Copy Influence Drivers from any of the bones in point 96 and paste them into the ''Influence'' of ''Copy Location'' constraints in ''torso'' and ''torso_pivot'', in accordance with the numbers of bone constraints (e.g. copy the driver from ''hips''' ''Copy Rotation.001'' Influence and paste it into Influence of ''Copy Location.001'' in ''torso'' and ''torso_pivot'').
#Copy Influence Drivers from any of the bones in point 96 and paste them into the ''Influence'' of ''Copy Location'' constraints in ''torso'' and ''torso_pivot'', in accordance with the numbers of bone constraints (e.g. copy the driver from ''hips''' ''Copy Rotation.001'' Influence and paste it into Influence of ''Copy Location.001'' in ''torso'' and ''torso_pivot'').
Line 738: Line 737:
|}
|}


[[Image:RigFinished.png|200px|right|thumb|Finished rig showing the pose matching functionality]]
[[Image:RigFinished.png|200px|right|thumb|Finished rig showing the pose matching functionality.]]


#<li value="100"> Select any FK (green) bone and set the IK-FK slider to 1. Do this for all four limbs. This has to be done because pose matching works only through FK.
#<li value="100"> Select any FK (green) bone and set the IK-FK slider to 1. Do this for all four limbs. This has to be done because pose matching works only through FK.
# Using the [[Blender#Rig_bone_constraint_target_setting_script|RigBoneConstraintTargetSetter script]], set the targets for the ''Copy Rotation.001'' and ''Copy Rotation.002'' bone constraints. You can do that by having the rig in Pose mode, going to the Scripting tab, copying and pasting the script, and running it with <code>prefix</code> value set to 1, and then set to 2.
# Using the [[Blender/Obsolete scripts#Rig bone constraint target setting script|RigBoneConstraintTargetSetter script]], set the targets for the ''Copy Rotation.001'' and ''Copy Rotation.002'' bone constraints. You can do that by having the rig in Pose mode, going to the Scripting tab, copying and pasting the script, and running it with <code>prefix</code> value set to 1, and then set to 2.
# If you didn't get any errors, move one of the Pose bones in the global Z axis above the XY plane - the T-posed character should now snap to one of the animations in the ''Pose'' collections, as shown in the screenshot on the right.
# If you didn't get any errors, move one of the Pose bones in the global Z axis above the XY plane the T-posed character should now snap to one of the animations in the ''Pose'' collections, as shown in the screenshot on the right.
# Congratulations! The rig is now ready to be used.
# Congratulations! The rig is now ready to be used.


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