ALS for UE5.4: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 85: | Line 85: | ||
# I had the left hand with very weird angle, like rotated 90 degrees (maybe because it's mirrored in blender?) and to get the proper preview in the ALS Anim BP, I had to remove the "Take Rotation from Effector Space" for the "Two Bone IK" hand_l I did the same for both hands and for the the feet. [[File:Effector rotation.png]] | # I had the left hand with very weird angle, like rotated 90 degrees (maybe because it's mirrored in blender?) and to get the proper preview in the ALS Anim BP, I had to remove the "Take Rotation from Effector Space" for the "Two Bone IK" hand_l I did the same for both hands and for the the feet. [[File:Effector rotation.png]] | ||
#If the legs are bent backward, go to Animation Layers -> FootIK and click on "Two Bone IK" for the foot. On the right panel change "Joint Target Location" to be in front of the knee | #If the legs are bent backward, go to Animation Layers -> FootIK and click on "Two Bone IK" for the foot. On the right panel change "Joint Target Location" to be in front of the knee | ||
#Restart the Editor or the AnimBP will still see the old skeleton!! (weird...) | #Restart the Editor or the AnimBP will still see the old skeleton!! (weird...). It will ask you to save the skeleton, but don't save it, it didn't do any changes. | ||
#Create a new Blueprint deriving from ALSCharacter class for the Kran model. Add the skeletal mesh to it, Set the "Anim Class" to be the new retargeted Animation Blueprint | #Create a new Blueprint deriving from ALSCharacter class for the Kran model. Add the skeletal mesh to it, Set the "Anim Class" to be the new retargeted Animation Blueprint | ||
#This new Blueprint is missing all the settings of ALSCharacterBP, which we have to change: | #This new Blueprint is missing all the settings of ALSCharacterBP, which we have to change: |
Revision as of 23:33, 6 December 2024
Test new ALS in separate project
- Create new 3rd person project with C++
- Download ALS Community plugin, copy under /Plugins (make dir if not present)
- Generate Project files, recompile, and test ALS.
Add PlaneShift character to ALS project
- Import Kran character torso (for skeleton)
- Import Kran modules using torso skeleton
- Create a new PreviewMeshCollection with other kran pieces
- Modify the Kran skeleton:
- Activate under "Skeleton Tree" tab, the "Retargeting Options", and then copy the values from the current PS implementation
- "Animation Scaled" for the root, pelvis and all the ik
- "Skeleton" for everything else
- Added the Virtual Bones on the kran skeleton as per table below
- Activate under "Skeleton Tree" tab, the "Retargeting Options", and then copy the values from the current PS implementation
Source | Target | VB Name |
---|---|---|
hand_l | ik_hand_gun | VB LHS_ik_hand_gun |
LHS_ik_hand_gun | ik_hand_r | VB LHS_ik_hand_r |
hand_r | ik_hand_gun | VB RHS_ik_hand_gun |
RHS_ik_hand_gun | ik_hand_l | VB RHS_ik_hand_l |
ik_foot_l | foot_l | VB ik_foot_l_Offset |
ik_foot_l | calf_l | VB ik_knee_target_l |
ik_foot_r | foot_r | VB ik_foot_r_Offset |
ik_foot_r | calf_r | VB ik_knee_target_r |
ik_foot_root | foot_l | VB foot_target_l |
ik_foot_root | foot_r | VB foot_target_r |
root | root | VB Curves |
- Create new IKRig, set Preview Mesh to the Kran torso
- Click on "Auto Create Retarget Chains", then clear up the IK Goals (hands, feet)
- Create new IKRig, set Preview Mesh to the AnimMan mesh (ALS)
- Click on "Auto Create Retarget Chains", then clear up the IK Goals (hands, feet)
- Create a new IKRetargeter
- Set source ALS IKRig, and target Kran IK Rig
- In the "Chain Mapping" panel click on the "Root" Target Chain and set "Translation Mode" to "Globally Scaled". Without this the root movement (red line) will not be present in the retargeted animations.
- We have to set "Pin to Bone" in the retargeter as seems the IK are not properly retargeted. Click on top right on "Post Settings", then "Add new Retarget Op" -> "Pin Bone". Click on the pin just created and paste this in "Bones to Pin":
- ((BoneToPin="ik_foot_l",BoneToPinTo="foot_l"),(BoneToPin="ik_foot_r",BoneToPinTo="foot_r"),(BoneToPin="ik_hand_l",BoneToPinTo="hand_l"),(BoneToPin="ik_hand_r",BoneToPinTo="hand_r"),(BoneToPin="VB LHS_ik_hand_r",BoneToPinTo="hand_r"),(BoneToPin="VB RHS_ik_hand_l",BoneToPinTo="hand_l"),(BoneToPin="VB ik_foot_r_Offset",BoneToPinTo="foot_r"),(BoneToPin="VB ik_foot_l_Offset",BoneToPinTo="foot_l"),(BoneToPin="VB ik_knee_target_r",BoneToPinTo="calf_r"),(BoneToPin="VB ik_knee_target_l",BoneToPinTo="calf_l"),(BoneToPin="VB foot_target_l",BoneToPinTo="foot_l"),(BoneToPin="VB foot_target_r",BoneToPinTo="foot_r"))
- Create a new "Pin Bone" and paste this: ((BoneToPin="ik_hand_gun",BoneToPinTo="hand_l")) Deselect "Maintain Offset" and add a Local Offset of 3,-4,0
- Create a new "Pin Bone" and paste this: ((BoneToPin="VB LHS_ik_hand_gun",BoneToPinTo="ik_hand_gun"),(BoneToPin="VB RHS_ik_hand_gun",BoneToPinTo="ik_hand_gun")) Deselect "Maintain Offset"
- Select ALS_AnimBP , and click on "Retarget Animations"
- Select AnimMan as source, and Kran_torso as target, select RTG_ALS_to_Kran as retargeter
- Select all assets and click on "Export Animations", this will create all blendspaces and animations referenced by it
- WARNING: seems that the retargeter is not copying over this setting: Animation Sequence -> Asset Details -> Additive Settings -> Additive anim type: Local Space, Selected animation frame, ALS_N_Pose, 0. This causes the preview of the model in the anim BP to look all warped, like bones scaled up wrongly.
- Due to the above I had to use the Property Editor to set them all, copying from the standard ALS ones. I've selected all "Animation Sequence" in content browser (after retarget) and using the property editor add these properties
- I had the left hand with very weird angle, like rotated 90 degrees (maybe because it's mirrored in blender?) and to get the proper preview in the ALS Anim BP, I had to remove the "Take Rotation from Effector Space" for the "Two Bone IK" hand_l I did the same for both hands and for the the feet.
- If the legs are bent backward, go to Animation Layers -> FootIK and click on "Two Bone IK" for the foot. On the right panel change "Joint Target Location" to be in front of the knee
- Restart the Editor or the AnimBP will still see the old skeleton!! (weird...). It will ask you to save the skeleton, but don't save it, it didn't do any changes.
- Create a new Blueprint deriving from ALSCharacter class for the Kran model. Add the skeletal mesh to it, Set the "Anim Class" to be the new retargeted Animation Blueprint
- This new Blueprint is missing all the settings of ALSCharacterBP, which we have to change:
- in Class Defaults, search MovementModel, and set it to MovementModelTable, Normal
- in Class Defaults, copy all values from ALSCharacterBP for LandRoll Animations and GetUp Animations using the retargeted ones
- Add MantleComponent and DebugComponent
- Add all skeletal meshes for head, arms, hands, legs, feet, eyes
- In the construction script use "Set Leader Pose Component" node to connect all submeshes to the torso one
- In the 3d view, rotate the torso mesh -90 degrees on the Z axis to align to the direction blue arrow
- Override the functions GetGetUpAnimation and GetRollAnimation, copy the content from ALSCharacterBP. You will get a lot of errors for all variables not existing. Create all those variables, and set the content to the retargeted animations copying from ALSCharacterBP
- Copy the functions OnUpdateHeldObjectAnimations and OnUpdateHeldObject, content gets copied automatically
- In Character Movement Component -> Details, enable "Can Crouch"
- The MantleComponent is holding the mantle animations, and those are in ALS Plugin directory, so to have our character work properly, we have to switch those animations as well with our retargeted ones. So click on the MantleComponent and change the animations.
- Search ALS_GameMode_SP and change the "Default Pawn Class" to the new KranBP.