-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Don't mark cached previously pinned AnimationMixers #102813
Conversation
Weird the fix has nothing to do with AnimationMixers. |
AnimationPlayerEditor will hold on to pointers to no-longer existing Nodes that were previously pinned. Make sure to not mark them as dirty if they are not already inside the cache. This fixes godotengine#102108
} | ||
// If the current pinned node changed update both the old and new node. | ||
if (node_cache.current_pinned_node != pinned_node) { | ||
node_cache.mark_dirty(pinned_node); | ||
node_cache.mark_dirty(node_cache.current_pinned_node); | ||
// get_editing_node() will return deleted nodes. If the nodes are not in cache don't try to mark them. |
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.
Why not also fix the upstream issue and null original_node
when player
is cleared? I think the has
checks are unnecessary with that + your additional fixes with nulling current_pinned_node
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.
Apologies I missed this comment before merging, otherwise I'd have waited for @hpvb to reply first.
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.
No worries, ultimately the current code only uses get_editing_node
in two places and both would now be safe handling that pointer but it seems like it would be better to prevent that from being returned in the first place.
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.
Because this was a release blocker I decided to do a local fix. The current way the editor pinning works is kind of broken, editors can be pinned but the status of whether or not it is pinned is stored in the button toggle state, which gets reset when switching scenes.
The behavior is kind of silly as it is now, and was silly before any of my changes. I'm planning to do a ui fix pr separately to fix the pinning behavior in general.
Thanks! |
AnimationPlayerEditor will hold on to pointers to no-longer existing Nodes that were previously pinned. Make sure to not mark them as dirty if they are not already inside the cache.
This fixes #102108