-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Refactored bone_pose_override
in Skeleton3D
#55840
Conversation
Skeleton3D
Skeleton3D
bone_pose_override
in Skeleton3D
ee92cfe
to
8053ed7
Compare
8053ed7
to
f3495d6
Compare
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.
Code changes look good to me 👍
I didn't test it though, @TokageItLab if you can provide a sample project I can test it, although that might not be necessary if someone more familiar with the code takes a look, maybe @fire
f3495d6
to
e5d9c5b
Compare
I organized it a little more. I've tested at least SkeletonIK node, but I'm missing some testing on ModifierStack. @fire @TwistedTwigleg Can you help me with the test and review? |
e5d9c5b
to
4eff257
Compare
Sure, I'll take a look at the modifications soon in the test project I have and will let you know the results! |
I just tested and everything seems to be working fine! I had a slight issue with one of the character setups, but I think it's part of the model import (I probably needed to re-import) than the changes in this PR as all of the test meshes worked fine. The only thing that didn't work was that when you disable the modification stack, it doesn't reset the bone poses back to how it was prior to the override, but that is literally the only thing that I could spot and I'm not sure if it was that way prior to this PR or not. |
4eff257
to
9d5ce71
Compare
@TwistedTwigleg Thank you a lot! Probably the reason why the poses are not reset when modifier is disabled is that I forgot to enable the |
9d5ce71
to
b1a5993
Compare
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.
I did some style review of the code. @TwistedTwigleg reviewed this work in a practical demo.
Looks good to me.
I added some c++ comment changes.
Normally I'd ask Reduz, but he's currently busy, and @TwistedTwigleg was in this area of the code.
3ebca1a
to
da8c9a5
Compare
da8c9a5
to
477f422
Compare
Superseded by #56902. |
Commentary: I was looking at godotengine/godot-proposals#3379 and it was hard to review, so I wanted to break the pr into pieces now that the retarget node is more complete. |
Some notes here based on my review:
|
@reduz The previous implementation can only have one blend amount per bone, so I think it doesn't make sense to have it in the skeleton; once you have two blends in one bone, you don't know how much of each blend you have. So the blend amount should be controlled externally.
|
Memo - I and @lyuma's discussion log from Rocket Chat:
But renaming could be done with a different PR, I think it's better to get a consensus on the renaming-proposal first. cc: @reduz |
I reconsidered the implementation of the argument The reason is that it would cause confusion as to whether the
Also, in |
d9ad785
to
c31c491
Compare
c31c491
to
e7326a9
Compare
Reimplemented Still @reduz claims that In my opinion, Also, Although reduz mentions an independent process, |
@reduz If you mean by "process independence" that you want "to avoid updating by the dirty flag", then I think the correct way to implement it is to have a dedicated option for that. |
Even if In other words, if The immediate solution is to add some kind of mode to For now, I think the performance thing can be improved later; there are many features around skeleton and skeleton itself that need more refactoring to improve performance, not just The main purpose of this PR is to fix the major problem of not being able to final bone pose and to remove some redundant functions. |
Probably superseded by godotengine/godot-proposals#4863. |
Currently, the bone stores three pose values:
bone_pose
,bone_global_pose_override
andbone_local_pose_override
. However, it is not possible to get which of those values is used and how much. In other words we can't get the correct pose that the Skeleton is finally displaying. Moreover,global_pose_override
andlocal_pose_override
are not tied together so it looks mess.I'm working on implementing RetargetNode (godotengine/godot-proposals#3379) but due to these factors, it is difficult to get the final bone pose, and we can't retarget the modifier transforms.
This will do some refactoring.
bone_pose
andbone_pose_override
bool president
andfloat amount
, then implementbool is_override_enabled
instead (if amount is needed, useinterpolate_with()
before passing the pose toset_bone_pose_override()
; president should be managed in modifier's priority)global_pose
is fine for performance reasons, but it is a value used for conversion between local <-> global and we should not apply it directly as a poseget_bone_pose()
returns the final displayed pose,get_bone_pose_no_override()
returns the value without the override for the boneIf this is approved, the same changes may need to be made to
Skeleton2D
for consistency.