-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Fix initial skin update timing in Skeleton3D #98009
Conversation
3e47a4a
to
b0473fa
Compare
We ran into an issue with this change but also found a workaround in our project. I'll break down what happens so we can discuss whether any changes should be made in this PR to account for this problem we encountered. So in our project, we generate icons for user inventory items at runtime. We do this by equipping an item to the character, taking a screen capture (offscreen) of that item, and then displaying it as an icon like so: Now the problem is, resolve_skeleton_path has been moved to godot/scene/3d/mesh_instance_3d.cpp Line 336 in af77100
This means the skeleton doesn't move right away to its location and I can't take a screenshot of it right after equipping it. Which in turn looks like: I found a workaround to be this: foreach (var child in currentMesh.FindChildren("*", recursive: true))
{
if (child is MeshInstance3D childSkel)
{
// Reassign the skeleton to itself so the skin has an immediate refresh
childSkel.Skeleton = childSkel.Skeleton;
}
} This works because set_skeleton_path invokes resolve_skeleton_path right away unlike the new deferred call in notification: I propose a few possible solutions:
NOTE: I ran into this same issue with the |
b0473fa
to
d29e7b6
Compare
This is probably fine. I thought I had a recurring problem with the #98001 project when I did that before, but maybe I had the wrong build binary. I've made the change, so please test to see if it's a problem. |
Just tested. Everything goes back to working again! Thanks! :) |
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.
Tests from developers work correctly.
Thank you! |
MeshInstance3D
from skinning properly #97982I have changed the update timing on the MeshInstance side in #97489 to READY, but now move it to the original timing as ENTER_TREE
with calling deferred. Instead, we will update the skin once before the deferred process in the skeleton.This means that notifications for updates are called twice only in the first frame; once in the normal process and once in the deferred process, but this is probably not a serious problem since it is managed by the update flag, which is separate from the dirty flag.
Also, confirmed that #97459 does not recur.