-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RetargetModifier3D for realtime retarget to keep original rest #97824
base: master
Are you sure you want to change the base?
Conversation
e3f3157
to
a7b2351
Compare
a7b2351
to
b8f72c7
Compare
Is there particular tests you want us to look at? I'll try to review this as soon as possible. |
61da730
to
8346442
Compare
I put the project that I used to test the behavior on my end. I would appreciate it if you could retarget other models or test the combination with XRModifier like one more RetargetModifier to the GeneralSkeleton parent to retarget from the real body shape skeleton with tracking. cc @Malcolmnixon Godette / CC by SirRichard94 |
3cdd2eb
to
42eda8c
Compare
It may be possible (not so at the current this PR) to modify it so that Skeleton can create a children list even if it is not a direct child of RetargetModifier like:
but it will need to be tested. I will try to improve this in a later Follow up PR, as it could be applied to SkeletonModifier lists that are direct children of Skeleton to organize tree view like:
|
d9c790b
to
e42e587
Compare
e42e587
to
1607517
Compare
I have tested this on https://github.com/V-Sekai/godot-humanoid-project where we retarget a character body without a UpperChest to a character body that has does not have a UpperChest but only has a Chest. Note that there a difference in animation in the godot-humanoid-project but it is unrelated to this pr. |
1607517
to
d45866a
Compare
d45866a
to
f6de32d
Compare
Closes godotengine/godot-proposals#3379
RetargetModifier3D
Add RetargetModifier3D. Currently Godot performs retargeting by overwriting rest. However, that means discarding the bone rest which set in the DCC, and it is quite possible that the axis of rest will be in an unintended direction. It makes re-targeting useless for specifying IK pole vectors and setting constraints for specific axes.
This PR solves this problem by retargeting the parent skeleton with the rest defined in the SkeletonProfile and the child skeleton holding the original rest with the RetargetModifier that will be added in this PR. Also keep in mind that parenting is required to guarantee process order.
The Profile specified to RetargetModifier3D is used only as a list of bone names, so if you want to retarget only specific bones, you can create a custom SkeletonProfile with arbitrary bone names only and set it to the RetargetModifier3D.
It has the following two types of retargets by
Use Global Pose
option.Use Global Pose
optionIf enabled, retargeting is enabled when the parent of the source bone is deformed, even if the target bone is less than the source bone. However, as a limitation, the lengths of the bones must be exactly equal. For example a specific use case, adding a dummy bone with zero length helps share animation between models with different numbers of bones.
retmod002.mp4
If disabled, retargeting is not performed when the parent of the source bone is deformed if the target bone is less than the source bone. However, it is possible to retarget bones of different lengths without destroying the appearance of the bones. For example a specific use case, you can retarget a chibi character from a skeleton that matches your real body shape for XR motion tracking. In addition, position, rotation, and scale can be handled individually.
Post importer change
Add option to separate unmapped bone library
Add option to use RetargetModifier to keep original rest
Note that the Rename Bone option must be enabled.