mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 04:24:47 +02:00
Add Dimensions Copy Paste
Add Dimensions Copy Paste
This commit is contained in:
parent
634dc64f8f
commit
9acd1a93c1
1 changed files with 23 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
// edit.js
|
// edit.js
|
||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 10/2/14.
|
// Created by Brad Hefta-Gaub on October 2nd, 2014.
|
||||||
// Persist toolbar by HRS 6/11/15.
|
// Persist toolbar by HRS on June 2nd, 2015.
|
||||||
// Copyright 2014 High Fidelity, Inc.
|
// Copyright 2014 High Fidelity, Inc.
|
||||||
// Copyright 2020 Vircadia contributors.
|
// Copyright 2020 Vircadia contributors.
|
||||||
// Copyright 2022-2024 Overte e.V.
|
// Copyright 2022-2024 Overte e.V.
|
||||||
|
@ -121,6 +121,7 @@
|
||||||
|
|
||||||
var copiedPosition;
|
var copiedPosition;
|
||||||
var copiedRotation;
|
var copiedRotation;
|
||||||
|
var copiedDimensions;
|
||||||
|
|
||||||
var cameraManager = new CameraManager();
|
var cameraManager = new CameraManager();
|
||||||
|
|
||||||
|
@ -2707,6 +2708,13 @@
|
||||||
copiedRotation = properties.rotation;
|
copiedRotation = properties.rotation;
|
||||||
Window.copyToClipboard(JSON.stringify(copiedRotation));
|
Window.copyToClipboard(JSON.stringify(copiedRotation));
|
||||||
}
|
}
|
||||||
|
} else if (data.action === "copyDimensions") {
|
||||||
|
if (selectionManager.selections.length === 1) {
|
||||||
|
selectionManager.saveProperties();
|
||||||
|
properties = selectionManager.savedProperties[selectionManager.selections[0]];
|
||||||
|
copiedDimensions = properties.dimensions;
|
||||||
|
Window.copyToClipboard(JSON.stringify(copiedDimensions));
|
||||||
|
}
|
||||||
} else if (data.action === "pastePosition") {
|
} else if (data.action === "pastePosition") {
|
||||||
if (copiedPosition !== undefined && selectionManager.selections.length > 0 && SelectionManager.hasUnlockedSelection()) {
|
if (copiedPosition !== undefined && selectionManager.selections.length > 0 && SelectionManager.hasUnlockedSelection()) {
|
||||||
selectionManager.saveProperties();
|
selectionManager.saveProperties();
|
||||||
|
@ -2720,6 +2728,19 @@
|
||||||
} else {
|
} else {
|
||||||
audioFeedback.rejection();
|
audioFeedback.rejection();
|
||||||
}
|
}
|
||||||
|
} else if (data.action === "pasteDimensions") {
|
||||||
|
if (copiedDimensions !== undefined && selectionManager.selections.length > 0 && SelectionManager.hasUnlockedSelection()) {
|
||||||
|
selectionManager.saveProperties();
|
||||||
|
for (i = 0; i < selectionManager.selections.length; i++) {
|
||||||
|
Entities.editEntity(selectionManager.selections[i], {
|
||||||
|
dimensions: copiedDimensions
|
||||||
|
});
|
||||||
|
}
|
||||||
|
createApp.pushCommandForSelections();
|
||||||
|
selectionManager._update(false, this);
|
||||||
|
} else {
|
||||||
|
audioFeedback.rejection();
|
||||||
|
}
|
||||||
} else if (data.action === "pasteRotation") {
|
} else if (data.action === "pasteRotation") {
|
||||||
if (copiedRotation !== undefined && selectionManager.selections.length > 0 && SelectionManager.hasUnlockedSelection()) {
|
if (copiedRotation !== undefined && selectionManager.selections.length > 0 && SelectionManager.hasUnlockedSelection()) {
|
||||||
selectionManager.saveProperties();
|
selectionManager.saveProperties();
|
||||||
|
|
Loading…
Reference in a new issue