Tutorial 3D Hand Morphing Tool and Tutorial(3DS Max and Blender)

Users who are viewing this thread

With permission of the creator Enpremi, this is a video tutorial covering the implementation of hand morph animations into Bannerlord. This tool is an fbx that has a rigged hand animated to each of the 26 hand poses in BL. Modders can rig their hand assets to this hand rig and use the animations to create morphs. It also has a tool that automatically converts the animation frames to morphs, but this is only for 3DS Max. More documentation, or conversion of the tool for other programs would be appreciated.



Tool Download Link:


Blender Tutorial:
1. What You Need
This tutorial is assuming you have your hand armour meshes are complete rigged to your skeleton mesh already. You should also have Enpremi's resource above downloaded.
unknown.png

2. Importing Enpremi's Resources
Import Bannerlord_HandsRig.fbx with these settings:
unknown.png


For my default settings, I needed to enable Force Connect Children and Automatic Bone Orientation.

3. Meshes and Skeletons
These are the objects we are using:
unknown.png

-HandMRef_Rigged is the animated hands we will get our morphs from.
-HandMRef_morph is an example mesh with hand morphs already applied to it. It is purely reference.
unknown.png

You can look under its Object Data Properties to see how your hand armour's morphs should look like in the end. 1 Basis shape key and 0-25 normal shape keys. Each shape key is an animation/pose of the hands the game choses from. The name does not matter, only the order of shape keys, but use the 0-25 naming convention to avoid confusion.

-royal_guard_bracers is my hand armour mesh. It should not need any more mesh work, new modifiers cannot be added after this process, so do them now.
Warning⚠️: You should apply every modifier except Armature. If you don't apply it now, you will have to remove them and their effect later.
It is currently rigged to the BL skeleton in another folder. We aren't actually going to make any changes to this object until the end. We are going to duplicate this object so we can make the shape keys.
unknown.png

I rename this object something obvious for workflow purposes.

4. Rigging Shape Key Mesh to Hand Skeleton
royal_guard_bracersSHAPE needs to be rigged to "Armature" from Enpremi's resource.
unknown.png

Use ctrl+p to parent the shape key object to the skeleton, use With Automatic Weights under Armature Deform.
We want to transfer weights from Enpremi's HandMRef_Rigged to our mesh. To do this,
First select HandMRef_Rigged then select royal_guard_bracersSHAPE.

Second enter Weight Paint then select Weights, Transfer Weights
unknown.png


Third, open Transfer Mesh Data at the bottom left, change Source Layers Selection from Active Layer to By Name.
unknown.png


The mesh should be rigged now, but bad rigging is possible, so manual clean up will be likely. Here the hand is good, but I need to move the bracer and strap weights away from the hand bones completely.

unknown.png

Remember to do rigging for both hands since the mirror modifier has been applied.

5. Creating the Shape Keys
This is the most tedious part of the process, and is the part that is automated in Enpremi's Max script. There is currently no Blender equivalent, so it must be done manually. If someone makes one, I can add it here.

To do this, you will want to be in the Animation window to use the timeline. Then follow these steps:
1. Duplicate royal_guard_bracersSHAPE. This should create royal_guard_bracersSHAPE.001, we can use the automatic naming system as it numbers them how we want.

2. We should be on Frame 1. Select the mesh the was duplicated, it should be frame number minus 1(royal_guard_bracersSHAPE in this case, since it is logically "000"), and apply the modifier with Armature as its Object, not the BL skeleton. It will usually be the second Armature modifier, like in the image below.
If we were on Frame 10, we would apply royal_guard_bracersSHAPE.009.
unknown.png



3. Move to the next frame. The last frame that should be done is 26.

An example of the workflow looks like this:
-Duplicate royal_guard_bracersSHAPE into royal_guard_bracersSHAPE.001
-Apply Armature modifier of royal_guard_bracersSHAPE on frame 1
-Move to frame 2
-Duplicate royal_guard_bracersSHAPE.001 into royal_guard_bracersSHAPE.002
-Apply Armature modifier of royal_guard_bracersSHAPE.001 on frame 2
-Move to frame 3
...
-Duplicate royal_guard_bracersSHAPE.024 into royal_guard_bracersSHAPE.025
-Apply Armature modifier of royal_guard_bracersSHAPE.024 on frame 25
-Move to frame 26
-Since royal_guard_bracersSHAPE.025 is the last shape key, it does not need to be duplicated.
-Apply Armature modifier of royal_guard_bracersSHAPE.025 on frame 26

The final product should look like this:

unknown.png

6. Apply meshes as Shape Keys

Under Object Data Properties prese the "+" by Shape Keys. This adds the "Basis" key, it doesn't need any changes.

After this, select all of the shape key meshes, then the original mesh last. In the Shape Key section there is an down facing arrow button. Click it, then choose Join as Shapes.
unknown.png


None of the SHAPE meshes will be used from now on, nor will the Armature skeleton, so all can be hidden. On the original mesh you should have all of the shape keys added:
unknown.png

You can test them by increasing their value to 1. Compare them to HandMRef_morph with the same shape key applied. When finished, remember to return values to 0.

This is technically finished now, you will just want to create LODs and import into Bannerlord.

7. Importing to Bannerlord

The standard export options can be used, make sure to turn on Selected Objects and turn off Add Leaf Bones.
If you did not apply all of your modifiers except Armature, it will simply not work. You have to remove(or apply earlier in the process) all of the modifiers except Armature.

Bannerlord Import Settings:
importsettings.png



When you make the xmls, hand morphs on hand armours only work when you hide the hands.
 
Last edited:
With permission of the creator Enpremi, this is a video tutorial covering the implementation of hand morph animations into Bannerlord. This tool is an fbx that has a rigged hand animated to each of the 26 hand poses in BL. Modders can rig their hand assets to this hand rig and use the animations to create morphs. It also has a tool that automatically converts the animation frames to morphs, but this is only for 3DS Max. More documentation, or conversion of the tool for other programs would be appreciated.



Tool Download Link:


Awesome work, Enpremi.
 
Blender Tutorial:
1. What You Need
This tutorial is assuming you have your hand armour meshes are complete rigged to your skeleton mesh already. You should also have Enpremi's resource above downloaded.
unknown.png

2. Importing Enpremi's Resources
Import Bannerlord_HandsRig.fbx with these settings:
unknown.png


For my default settings, I needed to enable Force Connect Children and Automatic Bone Orientation.

3. Meshes and Skeletons
These are the objects we are using:
unknown.png

-HandMRef_Rigged is the animated hands we will get our morphs from.
-HandMRef_morph is an example mesh with hand morphs already applied to it. It is purely reference.
unknown.png

You can look under its Object Data Properties to see how your hand armour's morphs should look like in the end. 1 Basis shape key and 0-25 normal shape keys. Each shape key is an animation/pose of the hands the game choses from. The name does not matter, only the order of shape keys, but use the 0-25 naming convention to avoid confusion.

-royal_guard_bracers is my hand armour mesh. It should not need any more mesh work, new modifiers cannot be added after this process, so do them now. You should also apply every modifier except Armature. It is currently rigged to the BL skeleton in another folder. We aren't actually going to make any changes to this object until the end. We are going to duplicate this object so we can make the shape keys.
unknown.png

I rename this object something obvious for workflow purposes.

4. Rigging Shape Key Mesh to Hand Skeleton
royal_guard_bracersSHAPE needs to be rigged to "Armature" from Enpremi's resource.
unknown.png

Use ctrl+p to parent the shape key object to the skeleton, use With Automatic Weights under Armature Deform.
We want to transfer weights from Enpremi's HandMRef_Rigged to our mesh. To do this,
First select HandMRef_Rigged then select royal_guard_bracersSHAPE.

Second enter Weight Paint then select Weights, Transfer Weights
unknown.png


Third, open Transfer Mesh Data at the bottom left, change Source Layers Selection from Active Layer to By Name.
unknown.png


The mesh should be rigged now, but bad rigging is possible, so manual clean up will be likely. Here the hand is good, but I need to move the bracer and strap weights away from the hand bones completely.

unknown.png

Remember to do rigging for both hands since the mirror modifier has been applied.

5. Creating the Shape Keys
This is the most tedious part of the process, and is the part that is automated in Enpremi's Max script. There is currently no Blender equivalent, so it must be done manually. If someone makes one, I can add it here.

To do this, you will want to be in the Animation window to use the timeline. Then follow these steps:
1. Duplicate royal_guard_bracersSHAPE. This should create royal_guard_bracersSHAPE.001, we can use the automatic naming system as it numbers them how we want.

2. We should be on Frame 1. Select the mesh the was duplicated, it should be frame number minus 1(royal_guard_bracersSHAPE in this case, since it is logically "000"), and apply the modifier with Armature as its Object, not the BL skeleton. It will usually be the second Armature modifier, like in the image below.
If we were on Frame 10, we would apply royal_guard_bracersSHAPE.009.
unknown.png



3. Move to the next frame. The last frame that should be done is 26.

An example of the workflow looks like this:
-Duplicate royal_guard_bracersSHAPE into royal_guard_bracersSHAPE.001
-Apply Armature modifier of royal_guard_bracersSHAPE on frame 1
-Move to frame 2
-Duplicate royal_guard_bracersSHAPE.001 into royal_guard_bracersSHAPE.002
-Apply Armature modifier of royal_guard_bracersSHAPE.001 on frame 2
-Move to frame 3
...
-Duplicate royal_guard_bracersSHAPE.024 into royal_guard_bracersSHAPE.025
-Apply Armature modifier of royal_guard_bracersSHAPE.024 on frame 25
-Move to frame 26
-Since royal_guard_bracersSHAPE.025 is the last shape key, it does not need to be duplicated.
-Apply Armature modifier of royal_guard_bracersSHAPE.025 on frame 26

The final product should look like this:

unknown.png

6. Apply meshes as Shape Keys

Under Object Data Properties prese the "+" by Shape Keys. This adds the "Basis" key, it doesn't need any changes.

After this, select all of the shape key meshes, then the original mesh last. In the Shape Key section there is an down facing arrow button. Click it, then choose Join as Shapes.
unknown.png


None of the SHAPE meshes will be used from now on, nor will the Armature skeleton, so all can be hidden. On the original mesh you should have all of the shape keys added:
unknown.png

You can test them by increasing their value to 1. Compare them to HandMRef_morph with the same shape key applied. When finished, remember to return values to 0.

This is technically finished now, you will just want to create LODs and import into Bannerlord.

7. Importing to Bannerlord

The standard export options can be used, make sure to turn on Selected Objects and turn off Add Leaf Bones.

Bannerlord Import Settings:
importsettings.png



When you make the xmls, hand morphs on hand armours only work when you hide the hands.
 
Last edited:
Back
Top Bottom