When I started an Inverse Kinematics tutorial I was left with a lot of questions. A problem about custom IK is getting your own models working. I use Blender as my goto tool when it comes to models. The problem is that different programs use different coordinate systems and different orientations for it. I will walk through the steps to get a model created and rigged in Blender to Unity.
First I model an object facing the y+ direction in Blender. Here I will do a simple robot arm and an arrow indicator at the bottom. Please ignore that there is already a bonechain / rig in this one. I took the screenshot at the end.
Now we want to add a Rig. For this we deselect everything and go to Add > Armature. Make sure to select the Armature and now switch to edit mode. To help visualize where the bones are look on the right under “Viewport Display” is the option to display “In Front”. You simply click the small sphere, then “E” for extrude and add bones the way you like it.
Once you are satisfied with the model and the rig you can combine the two. You do this in Blender object mode. First select all Objects and then in the list select the armature. Rightclick > Parent > Armature Deform > With Automatic Weights.
The objects should be part of the armature after you did this. Like in the screenshot below.
You can check if everything is good and ready to export. For this you select the Pose Mode and then a bone. Move the bone around to see how it behaves.
Make it look robotic
In my case I want bones to controll a single object part. I don’t have soft tissues that are kind of transformed. I want the robotic look. For this to work we will have to change the weightpainting. A good and to the point tutorial I found was this.
So we go through all the objects and all the bones to correct the influence. In Objectmode select an object, switch to weight paint mode and then click through the bones (the tab Object Data Properties) either painting it fully red or fully blue (add or subtract). To switch the object you want to paint you go back to object mode, select the next object and turn weight painting on again.
Export
Now exporting is not quite strait forward. We want to set the forward direction. Set the Forward to “Y Forward” and check that under “Armature” the Primary Bone Axis is the Y Axis.
Now to Unity
Once the FBX file is loaded in Unity we have to change an input setting and we are good. We select the point “Bake Axis Conversion” and apply. This changes the joints local directions from y as forward to the usual z axis is forward. We also want to take Convert Units out. This means that we have to rescale the armature inside of the model.
For the rescaling we drag the model into our scene and it will be massive. Open up the model in the inspector and change the armature scale from 100 to 1 and set the y position again.
Now we can use the model and the rig in Unity. If you want to use it for Inverse Kinematics you reference the transforms in the armature. The object meshes are outside of the armature but you can rotate the mesh with the armature handles.
Archives
- November 2023
- December 2022
- November 2022
- February 2022
- November 2021
- October 2021
- September 2021
- July 2021
- April 2021
- March 2021
- February 2021
- January 2021
- September 2020
- July 2020
- April 2020
- March 2020
- February 2020
- December 2019
- November 2019
- October 2019
- August 2019
- June 2019
- February 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- May 2018
- March 2018
- February 2018
- December 2017
- November 2017
- September 2017
- July 2017
- June 2017
- April 2017
- February 2017
- January 2017
- October 2016
- September 2016
- July 2016
- May 2016
- April 2016
- March 2016
- August 2015
- July 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- October 2014
- April 2014
- March 2014
- February 2014
Calendar
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |