Description of the problem
When using a weapon in a character’s hand, most of the case, the weapon has animations that translates the weapon to be able to hold the weapon by the gunstock or the trigger. The problem is that translation animations is not supported by Golaem Crowd.
To solve this problem, the character’s skeleton has to be modified to transform the translations keys in rotations keys only.
Left picture: Rifle animation uses translation keys / Right picture: Rifle animation uses rotation keys thanks to 2 additional bones
This is done in a few steps (detailed below)
First, you will need to create the new bone hierarchy ;
An IK system should be prepared to transfer the previous translation into the new bone system, with only rotation keys ;
An orientation constraint should be added to keep the old weapon bone orientation on the new one ;
Then you should transfer the skinning from the old bone hierarchy to the new one, and save the new character file ;
Finally the new bone hierarchy should be driven by the previous bone translation animation, this is done by using IK ;
New bone hierarchy to replace the fr_infantry_01_LeftGun
Click on the IK Handle tool button
Select the both the fr_infantry_01_LefttGun_IK1 bone and then the new_fr_infantry_01_LefttGun1 bones (in that order) by holding the CTRL key
This should create an IK system that control the orientation of the IK1 and IK2 bones to follow the newly created ikHandle node’s position
(The IK Handle tool created an iKHandle1 node)
Try to move the ikHandle node, you should see the IK1 and IK2 nodes rotate to ensure that the new_fr_infantry_01_LefttGun1 position is the same than the ikHandle1
Parent the ikHandle1 node under the old fr_infantry_01_LefttGun node, and give him a null translation/orientation.
This way, when you will move this node, the new IK system will follow and keep the new_fr_infantry_01_LefttGun at the exact same position than the old one.
Now as you can see, the position of the new_fr_infantry_01_LefttGun is correct, but its orientation still differs from the old fr_infantry_01_LefttGun bone. To fix this, you can use an orientation constraint.
Select the old fr_infantry_01_LefttGun bone and the new_fr_infantry_01_LefttGun (in that order) by holding the CTRL key ;
click on the Orient Constraint button:
Now the new_fr_infantry_01_LefttGun should be at the same position AND orientation than the old fr_infantry_01_LefttGun bone, whatever its position and orientation are.
As the Golaem animation will work with the new_fr_infantry_01_LefttGun instead of the old one, you have to move the weapon skinning from the old bone to the new one.
The only reason why the old bone (not compliant with the Golaem animation system) stays is to drive the animation on the new bone system (compliant with the Golaem animation system).
Once every change has been made on the character, you’ll have to export it back as a Golaem character (both .gcha and geometry .fbx or .gcg files).
To export the new .gcha file, just load the one that was made for the character (if any), and re-import the new one by choosing the “Remap by name” option when asked.
This will reload any previously configured .gcha with the new changed skeleton.
Next step is to add the IK system as a node in the Golaem Character. Just map the first bone of the weapon IK system and the new_fr_infantry_01_LefttGun to a Golaem node:
You can now save the .gcha file, as it’s ready for simulation.
N.B: Don’t forget to re-export the fbx/gcg file as well, as the bone hierarchy changed and should be the same than in the .gcha file
Once the animation uses the same bone system than the one described in the previous section, there is not much more to do.
When importing the animation to Golaem with the Character maker, you will notice than the Golaem Conversion Quality is not that good and see some warning messages: “Some joints' animation seems not to be compatible with forward kinematic animation. Make sure there is no local Translate animation for the following frame/joint: fr_infantry_01_LefttGun”
That’s something normal, because the old animation bone is still present in the skeleton and needed to apply the animation on the new one.
But as it’s not used anymore for the skinning, it just won’t matter at all during simulation, and these messages can be ignored in this specific case.
You should still check specifically that the weapon animation was correctly exported by clicking on the arrows to develop the quality until you find the most detailed view for the weapon system:
Golaem Conversion Quality for the weapon system
Here again, you will notice that the conversion quality is not good for the weapon IK system. This does not matter at all, because there is nothing skinned to these bones, and it won’t be noticeable during the simulation. The only bone for which conversion quality really matters is the new_fr_infantry_01_LefttGun, for which the Conversion Quality is green (good) for position, orientation and scale. This animation should work perfectly in simulation.