Closed TokisanGames closed 3 years ago
Hey, thanks for testing!
I am afraid you can't retarget those two rigs for now. I couldn't spot a bug in the tool or an immediate issue with your custom mapping, it is more a lack of feature/support. Retargeting to more complex rigs with e.g. added twist bones in the middle of the bone chains, and different root_motion bones is unsupported and requires additional features that are not added yet.
Problem description:
CC rigs share a lot with Genesis rigs, in general you need to ignore/exclude twist bones for retargeting those complex rigs but this alone wouldn't solve the problem here.
The first issue is that the CC rig has additional bones not at the end but in the middle of the bone hierarchy (twist bones). Those bones apply additional rotation (and even position) to all child bones and are not accounted for by the retargeting tool. Something that I have planned for the future but not implemented yet. For now the tool only supports rigs with the same bone number, except for added leaf bones at the end of the bone chains that don't influence the transform of retargeted child bones.
Basically the entire legs and arms are wrong cause the additonal twist bones change the rotation to other directions. What needs to happen is that whenever the bone chain number between source and target are different the tool needs to travel through all parent bones and collect their transforms for a correct offset calculation.
The second issue is that the source skeleton uses root motion (mixamo hip bone) while the target skeleton does not (CC root bone) and also has the hip bone not as the root but as the second bone.
Root motion (just recently added) has currently no remap option to another bone (index). Godot's skeleton implementation is also not very helpful with this problem. Godot 3.x forces the child bone at the end position of the parent bone so we can not just retarget the root_motion position. We first need to place the bone length of the static root bone so its end position is at the correct hip position for the mixamo hip bone. Accounting for this on the code level is not too difficult but I am scratching my head how to implement this as options and selections in the user interface.
Points raised in your video:
The bone placement, size and connection problems that you see in Blender are blender-only problems as Godot forces all skeleton bones to connect on import and align on each others endpoints.
I see you figured out the correction mode later in your video. The enum that shows the entire bone list for the correction bone selection is available after retargeting at least ones to parse the skeleton (and de- and reselect the node to update the Godot inspector).
EDIT: For skeleton characters you basically always need "retarget_bone_rotation" enabled.
It seems to me that the common rigs and mappings should be included by default as they are developed
For now only a Genesis3and8 mapping are available by default cause that is what I am using for my own projects. I currently don't know proper mappings for other rig types. I wouldn't mind adding mappings to the tool for certain rigs when they are contributed and work properly.
Ok, thanks for the detailed explanation. We'll go down a different path for our project rather than retargeting. I'll leave this open, but feel free to close it if you want to track the other issues instead.
@tinmanjuggernaut Rather keep the issue open and fix the subisses one by one. Could be done in a few days or months, no eta.
Since CC rig and Genesis rig are so similar here is my own current workflow, maybe it can help for your project.
I tried the bvh importer without success. I'll look at other options. Thanks again.
@tinmanjuggernaut do you still have problem retargeting mixamo animation to cc3? The working path is shown here
@GeorgeS2019 This issue was about using this repo to retarget within Godot. We are not attempting that anymore. Thanks for the video, I'm aware of that process.
I currently have a mixamo rig and animation that I'm attempting to map onto a character creator 3 rig. I'm getting unexpected results and have recorded a video to show my setup and experience with the plugin. Can you help me figure this out? Thanks
https://www.youtube.com/watch?v=1mF-NvNctyw
Here is a minimal zip with both characters in godot, as well as the original fbx files if you want to look in blender or reimport (for test_npc, convert to glb in blender before reimporting into godot).
https://we.tl/t-g8zr0oUZW0 (Link expires in 1 week)
Also, It seems to me that the common rigs and mappings should be included by default as they are developed, though I'm sure that will take time. Common rigs include mixamo, epic skeleton, character creator 3, among others.
commit c2360db41c74820f207dfc05dd49502aabb01dd9