History

Merge pull request #12343 from NissimHadar/saveSnapshotWithName

Added option to select snapshot filename in scripts.

John Conklin II committed 8 years ago

Commit 3377aac2 parents 51bf3c1 5579eac6 files · +37 −21Browse files

Showing the changes to interface/src/Application.cpp (1 of 6 files). Show all

Unified · Split

interface/src/Application.cpp+6−6
@@ -6935,10 +6935,10 @@ void Application::loadAvatarBrowser() const { · 6934 unmodified lines
6935 DependencyManager::get<HMDScriptingInterface>()->openTablet();6935 DependencyManager::get<HMDScriptingInterface>()->openTablet();
6936}6936}
6937 6937
6938void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio) {6938void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio, const QString& filename) {
6939 postLambdaEvent([notify, includeAnimated, aspectRatio, this] {6939 postLambdaEvent([notify, includeAnimated, aspectRatio, filename, this] {
6940 // Get a screenshot and save it6940 // Get a screenshot and save it
6941 QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));6941 QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio), filename);
6942 // If we're not doing an animated snapshot as well...6942 // If we're not doing an animated snapshot as well...
6943 if (!includeAnimated) {6943 if (!includeAnimated) {
6944 // Tell the dependency manager that the capture of the still snapshot has taken place.6944 // Tell the dependency manager that the capture of the still snapshot has taken place.
@@ -6950,9 +6950,9 @@ void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRa · 5 unmodified lines
6950 });6950 });
6951}6951}
6952 6952
6953void Application::takeSecondaryCameraSnapshot() {6953void Application::takeSecondaryCameraSnapshot(const QString& filename) {
6954 postLambdaEvent([this] {6954 postLambdaEvent([filename, this] {
6955 QString snapshotPath = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getSecondaryCameraScreenshot());6955 QString snapshotPath = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getSecondaryCameraScreenshot(), filename);
6956 emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, true);6956 emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, true);
6957 });6957 });
6958}6958}