Skip to content

Conversation

@diando
Copy link

@diando diando commented Apr 3, 2023

UI: Added option to screenshot the current scene (preview screen) by hotkey

Description

New option in settings for screenshoting the current scene, i.e. preview scene
image
image
image

Motivation and Context

I personally use Studio Mode a lot and I realized that the only hotkey options for screenshoting were for a selected source, the ouput/program screen or a specified scene. However, no hotkey options were available for what was shown in the preview.

How Has This Been Tested?

Built obs-studio. Set-up a hotkey for screenshotting the preview, took screenshots, unregistered it and repeated the process.

Tested on Windows 11.

Types of changes

New feature (non-breaking change which adds functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@WizardCM WizardCM added the Enhancement Improvement to existing functionality label Apr 3, 2023
@diando
Copy link
Author

diando commented Apr 3, 2023

Dang, I really thought a proper clang check was done. I'll re-do it and make another request shortly.

@WizardCM
Copy link
Member

WizardCM commented Apr 3, 2023

You can just force-push to the branch after amending. Please don't open a second PR to replace this one.

@diando
Copy link
Author

diando commented Apr 3, 2023

You can just force-push to the branch after amending. Please don't open a second PR to replace this one.

Okay, duly noted.

Copy link
Contributor

@norihiro norihiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, I prefer the text Screenshot Preview instead of Screenshot Current (Preview) Scene, and the variable naming of screenshotPreviewSceneHotkey instead of screenshotCurrentSceneHotkey.

However, in non-studio mode, saying preview is not accurate. If having Screenshot Preview, the hotkey should be ignored in the function screenshotCurrentScene, for example.

Suggestions below are just nitpick.

@RytoEX RytoEX added the New Feature New feature or plugin label Apr 3, 2023
@diando diando requested a review from norihiro April 4, 2023 16:01
@diando diando force-pushed the master branch 3 times, most recently from 0b96cb5 to d8fd73d Compare April 6, 2023 17:04
@diando
Copy link
Author

diando commented Apr 6, 2023

@Vainock Some updated/already merged code (window-basic-main.cpp) came along for the ride during the squash. That should be okay right?

Copy link
Contributor

@norihiro norihiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I'm afraid is the hotkey is working even when OBS is not in Studio Mode.
It might be better to block to make screenshot. This should not be an issue.

The squash looks ok so far. See RytoEX's comment below.

@RytoEX RytoEX added this to the OBS Studio (Next Release) milestone Apr 8, 2023
@RytoEX
Copy link
Member

RytoEX commented Apr 8, 2023

It looks like some unrelated changes were pulled in during a rebase attempt.

@diando
Copy link
Author

diando commented Apr 9, 2023

It looks like some unrelated changes were pulled in during a rebase attempt.

Yes, I also noted that above. I'll try to make adjustments to avoid that.

@diando
Copy link
Author

diando commented Apr 9, 2023

What I'm afraid is the hotkey is working even when OBS is not in Studio Mode. It might be better to block to make screenshot. This should not be an issue.

The squash looks ok so far. See RytoEX's comment below.

I'll see if there's anything I can do about that.

@Warchamp7
Copy link
Member

What I'm afraid is the hotkey is working even when OBS is not in Studio Mode. It might be better to block to make screenshot. This should not be an issue.

The squash looks ok so far. See RytoEX's comment below.

When not in Studio mode, Preview and Program are effectively one and the same. I would expect both Screenshot Preview and Screenshot Output hotkeys to both function when not in Studio mode, and to produce the same output.

Can you confirm this behaviour @diando?

@diando
Copy link
Author

diando commented Jun 17, 2023

What I'm afraid is the hotkey is working even when OBS is not in Studio Mode. It might be better to block to make screenshot. This should not be an issue.
The squash looks ok so far. See RytoEX's comment below.

When not in Studio mode, Preview and Program are effectively one and the same. I would expect both Screenshot Preview and Screenshot Output hotkeys to both function when not in Studio mode, and to produce the same output.

Can you confirm this behaviour @diando?

I can confirm that is the behaviour. I must apologize. I have had to deal with moving house halfway across the world recently. I'll get back on cleaning stuff up for this feature sometime soon.

@PatTheMav
Copy link
Member

It looks like this PR also changes a lot of other things not related to the screenshot hotkey, so I guess this needs rebasing and also a cleanup.

@diando diando force-pushed the master branch 3 times, most recently from 830d209 to 8d53713 Compare August 7, 2023 02:57
@diando
Copy link
Author

diando commented Aug 7, 2023

It looks like this PR also changes a lot of other things not related to the screenshot hotkey, so I guess this needs rebasing and also a cleanup.

Finally got a chance to come back and cleanup the code.

@PatTheMav
Copy link
Member

Scope looks fine to me now - @RytoEX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Improvement to existing functionality New Feature New feature or plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants