-
-
Notifications
You must be signed in to change notification settings - Fork 19.6k
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
Feature/add mirror animation option #89070
base: master
Are you sure you want to change the base?
Feature/add mirror animation option #89070
Conversation
…ofileHumanoid (cherry picked from commit ff866e655468a3fb2138e73ee049faaacdbbf5a0)
@SaracenOne Was interested in these workflows. @Lunatix89 Can you check the new fbx importer? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SkeletonProfile is available only in the editor and is not available at runtime.
If you want to use SkeletonProfile, this feature must be dedicated to editor only. From looking at the PR code, it appears that this is a function for mirroring on import, but if so, all the code needs to be in the importer.
So, at least Skeleton3D and SkeletonProfile1 will never have bone_counterpart_name
property. Even without such a property, as long as you are using SkeletonProfileHumanoid, it is definitely sufficient to use a simple regular expression to map the left and right bones. You can refer to BoneMapper::guess_bone_segregation()
for the regular expression.
Footnotes
-
SkeletonProfileHumanoid is just a template with some constants for SkeletonProfile, but SkeletonProfile needs to be generic. For this reason, it is not a good way that only SkeletonProfileHumanoid have additional property ↩
BTW, considering the original proposal godotengine/godot-proposals#8478, this feature would seem to be better available on AnimationTrackEditor than on importer. Considering the possibility of creating animations in Godot, having this feature in the importer would not be applicable to it. FYI, If you want to add SkeletonProfileHumanoid data, the best way would be to create a dedicated SkeletonProfileHumanoid editor. If the feature is only for SkeletonProfileHumanoid, then you can make the SkeletonProfileHumanoid editor to have a left-right mapping of bones that uses each SkeletonProfileHumanoid bone name as a definition. You can also include any other data. However, this is non-generic and cannot be used for any SkeletonProfile other than Humanoid, so it may be more preferable to have it as an add-on. With this way, you can add a metadata to Skeleton to check if a Skeleton has been imported as a Humanoid. As I said in godotengine/godot-proposals#8478 (comment), we can come up with many additional features for Humanoid animations, so it might be nice to have one package add-on that brings them all together in a single repository like GodotHumanoidEditor addon. |
This PR adds two things to Godot:
SkeletonProfileHumanoid
which can be mirror (likeLeftHand
<>RightHand
)get_bone_counterpart_name
toBoneMap
andSkeleton3D
so we can retrieve a bones counterpart nameHowever, during development I've discovered that animations whose rest pose is not in T-Pose will be heavily broken by this implementation.
I think the reason why this works in Unity is that they have an Avatar system which contains a models T-Pose.
Since this avatar is then by individual animations they can always figure out the correct rest pose.
Maybe there is a fix for this problem but I don't have one yet, maybe someone else knows more about this.
AnimationPlayer.play_flipped()
to play mirrored 3D animations godot-proposals#8478.