-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 storyboard videos not accepting transforms #27967
Fix storyboard videos not accepting transforms #27967
Conversation
This requires that they are a `StoryboardSprite` for simplicity. Luckily this works just fine.
I checked, and yeah they can, so the diff --git a/osu.Game/Storyboards/Drawables/DrawableStoryboardVideo.cs b/osu.Game/Storyboards/Drawables/DrawableStoryboardVideo.cs
index ca2c7b774c..e8f43a79f4 100644
--- a/osu.Game/Storyboards/Drawables/DrawableStoryboardVideo.cs
+++ b/osu.Game/Storyboards/Drawables/DrawableStoryboardVideo.cs
@@ -50,6 +50,8 @@ private void load(TextureStore textureStore)
Origin = Anchor.Centre,
Alpha = 0,
};
+
+ Video.ApplyTransforms(drawableVideo);
}
protected override void LoadComplete()
This diff as is appears to "fix" the issue, but only because the scale transform in the maps involved is basically a no-op and the only thing that "suffices to fix" is the presence of the scale transform forcing relative sizing off. This is more apparent if you test with a different transform. Here's a modified version of one of the maps in the issue: Frums - Options.zip (change extension to (Interestingly for whatever reason the rotate transform is broken - it just insta-rotates to the final value rather than do the rotation across 20s? And the patch above somehow mirrors this breakage? I dunno, just gonna accept it and move on given it matches.) |
{ | ||
Path = path; | ||
StartTime = offset; | ||
TimelineGroup.Alpha.Add(Easing.None, offset, offset, 0, 1); |
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'm not sure what this does given that the transforms from this aren't actually applied on the drawable, as per above. But aside from that, I do wonder how this is gonna work if the video has actual user-specified alpha transforms on it.
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.
This can be removed I believe. The equivalent is already done in DrawableVideo.LoadComplete
. Left it behind after finding the relevant fades there.
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.
On revisiting, I think this is required to set the correct StartTime
for the final usage to generate the transforms
public double StartTime |
osu/osu.Game/Storyboards/Drawables/DrawableStoryboardVideo.cs
Lines 63 to 71 in 17ca29c
using (drawableVideo.BeginAbsoluteSequence(Video.StartTime)) | |
{ | |
Schedule(() => drawableVideo.PlaybackPosition = Time.Current - Video.StartTime); | |
drawableVideo.FadeIn(500); | |
using (drawableVideo.BeginDelayedSequence(drawableVideo.Duration - 500)) | |
drawableVideo.FadeOut(500); | |
} |
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.
Well I see at least two problems here, one major one minor...
- The major one is that on all storyboards with videos the videos appear to fade in instantly now. That second fade you linked there appears to be just dead. Feels pretty bad.
- The minor one is that fade commands don't work on video sprites at all. This can probably be dismissed until someone inevitably drags in an example of a storyboard that uses this.
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've fixed the fade in not working. The other issue can be ignored for now, I agree.
Good catch..
I think your added transform is missing a piece
|
herp derp. yep that's what it was 😅 |
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
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.
probably fine for now
In stable, storyboard videos can actually accept all kinds of transforms.
Handling of scale is a bit special here as we need to undo relative sizing. In stable, the relevant sizing code is performed in
pSprite.ScaleToScreen()
, which is undone when a transform is run.Closes #27634.