-
-
Notifications
You must be signed in to change notification settings - Fork 21.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
Revive onion skinning #80939
Revive onion skinning #80939
Conversation
Tried using this. As soon as I activated onion skin, all I got was this:
|
3dcdc77
to
8dabb10
Compare
I can't reproduce that. Just in case, I've rebased and rebuilt locally and it still works for me. Can you give a bit more detail? Does the editor freeze or crash, or does it keep working normally, just with onion skinning being futile? |
The error appears infinitely. The editor view becomes unresponsive, but it's actually possible to interact with the buttons and close the scene and editor, so I assume only rendering is stopped. But trying to click the onion skin button again to turn it off does not seem to do anything. Happens in rebased build too. For what it's worth, I'm running on Windows. Don't know if that's a factor. |
I'm on Windows, too, so it must be another thing. What GPU? |
Nvidia GeForce RTX 4090 |
Oh, I was kind of expecting a low VRAM graphics card. I'm clueless at the moment. Summoning @godotengine/production to ask them to give this a test to try to find out what's going on. |
@SlugFiller Could you try to see if this PR works in tandem with this PR? Maybe it's related to CPU/GPU synchronization issues with Vulkan. |
Nope, no change. And I even cherry picked both on top of master, so no other merged change had any influence, either. Interestingly, besides the errors above, I also get this when closing Godot:
One theory I can come up with is this: DisplayServer::WindowID root_vp_screen = get_tree()->get_root()->get_current_screen(); I have two monitors, and this might be doing something inappropriate |
Okay, confirmed this change makes the onion skin not freeze the window: diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index e674694fec..073f30f5f0 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -1491,7 +1491,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
// Tweak the root viewport to ensure it's rendered before our target.
RID root_vp = get_tree()->get_root()->get_viewport_rid();
Rect2 root_vp_screen_rect = Rect2(Vector2(), get_tree()->get_root()->get_size());
- DisplayServer::WindowID root_vp_screen = get_tree()->get_root()->get_current_screen();
+ DisplayServer::WindowID root_vp_screen = DisplayServer::MAIN_WINDOW_ID;//get_tree()->get_root()->get_current_screen();
RS::get_singleton()->viewport_attach_to_screen(root_vp, Rect2(), DisplayServer::INVALID_WINDOW_ID);
RS::get_singleton()->viewport_set_update_mode(root_vp, RS::VIEWPORT_UPDATE_ALWAYS); But at the same time, I confirmed the bug I was originally looking for, i.e. no onion skin is visible in this scene:
The reason stems from the fact that |
8dabb10
to
6493a65
Compare
@SlugFiller, I've been able to make a very comprehensive fix thanks to your feedback. Moreover, involved cases such as the one in your test scene now work. Onion skinning now uses a brute force approach to update the animation at each step instead of being anaytical in which calls are needed to make exactly to have, e.g., bones updated. Also, thanks to having to check the code more thoroughly, I've been able to remove the issue of onion layers being a frame late. Please give it another test. If it works for you, I believe this is ready for production (maybe with a disclaimer about it being experimental for now in the release notes). |
I think it's missing a final I'm also noticing some weird misalignment with the position of the "Center View" button and scroll bars in the onion renderings (arguably, they shouldn't appear at all in the onion layers, but if they do, they should be in the right spot) But I will note that it works surprisingly well, even on non-builtin modifications. When it works perfect, I'll try to give the code a quick browse too. (Should probably test in 3D too. But Don't have many 3D animations that are not in Godot 3) |
@SlugFiller, can you please check if replacing |
@RandomShaper Perfect There's still the weird part where the "center view" button is off in the onions (scroll bars too). But that's just a nitpick. This is working great. P.S. It might be an issue with how the blending is done, but it sort of looks like the onions are contributing more to the final color than the current frame, making them look "on top" of it. Or maybe it's just down to the step count? It doesn't matter much, because picking "differences only" already makes the current frame be on top of the others. But is there a way to adjust it slightly? |
6493a65
to
a8c708f
Compare
@SlugFiller, I can't express how much I appreciate your testing and feedback. In the end, I've left both methods of restoring the state of the properties affected by the animation (the original one plus the seek with Regarding the visuals, alpha could be handled better indeed and also it's true that some UI stuff like scrollbars or UI icons don't play very well with onion skinning. And, well, that's something I would like to leave for a future iteration, not even necessarilly by me. I think this already brings back a feature in a very functional state and now I have to keep focusing in other duties. (I'll be watching for bug fixes, though.) |
a8c708f
to
534a66f
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.
Looks fine to me. I trust the local reviews done by others.
The rendering server code looks good. I am less confident on the changes to the editor code as that is outside my area of expertise.
534a66f
to
bbcf119
Compare
Rebased and also added the change that a reset animation must be created (see #80813 (comment) and below). Since it's now based on a reset animation, it will only work correctly with tracks for which there's a corresponding well-setup reset track. I still think it's good enough, but I wish I (or other) can make a future iteration bringing back the former user-friendliness. |
This also reverts commit 6bbc3cb.
bbcf119
to
071d8e5
Compare
Does this work for 2D as well as 3D? |
Yes. If we had 4D (with the 4th not being time), it would work as well. 😃 |
Thanks! |
There may still be little defects (that were possibly present in the original implementation), but this is already big and worth merging to be polished over time.
Fixes #53870.