mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:47:30 +02:00
Add a "Set Rotation to Zero" button
Add a "Set Rotation to Zero" button in properties tab (Spatial section) of the create app.
This commit is contained in:
parent
0d39eea2a6
commit
494740f819
1 changed files with 16 additions and 4 deletions
|
@ -1383,7 +1383,8 @@ const GROUPS = [
|
||||||
{
|
{
|
||||||
type: "buttons",
|
type: "buttons",
|
||||||
buttons: [ { id: "copyRotation", label: "Copy Rotation", className: "secondary", onClick: copyRotationProperty },
|
buttons: [ { id: "copyRotation", label: "Copy Rotation", className: "secondary", onClick: copyRotationProperty },
|
||||||
{ id: "pasteRotation", label: "Paste Rotation", className: "secondary", onClick: pasteRotationProperty } ],
|
{ id: "pasteRotation", label: "Paste Rotation", className: "secondary", onClick: pasteRotationProperty },
|
||||||
|
{ id: "setRotationToZero", label: "Set Rotation to Zero", className: "secondary_red", onClick: setRotationToZeroProperty }],
|
||||||
propertyID: "copyPasteRotation"
|
propertyID: "copyPasteRotation"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1874,10 +1875,16 @@ function setCopyPastePositionAndRotationAvailability (selectionLength, islocked)
|
||||||
|
|
||||||
if (selectionLength > 0 && !islocked) {
|
if (selectionLength > 0 && !islocked) {
|
||||||
$('#property-copyPastePosition-button-pastePosition').attr('disabled', false);
|
$('#property-copyPastePosition-button-pastePosition').attr('disabled', false);
|
||||||
$('#property-copyPasteRotation-button-pasteRotation').attr('disabled', false);
|
$('#property-copyPasteRotation-button-pasteRotation').attr('disabled', false);
|
||||||
|
if (selectionLength === 1) {
|
||||||
|
$('#property-copyPasteRotation-button-setRotationToZero').attr('disabled', false);
|
||||||
|
} else {
|
||||||
|
$('#property-copyPasteRotation-button-setRotationToZero').attr('disabled', true);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$('#property-copyPastePosition-button-pastePosition').attr('disabled', true);
|
$('#property-copyPastePosition-button-pastePosition').attr('disabled', true);
|
||||||
$('#property-copyPasteRotation-button-pasteRotation').attr('disabled', true);
|
$('#property-copyPasteRotation-button-pasteRotation').attr('disabled', true);
|
||||||
|
$('#property-copyPasteRotation-button-setRotationToZero').attr('disabled', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3273,7 +3280,12 @@ function pasteRotationProperty() {
|
||||||
action: "pasteRotation"
|
action: "pasteRotation"
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
function setRotationToZeroProperty() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: "action",
|
||||||
|
action: "setRotationToZero"
|
||||||
|
}));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* USER DATA FUNCTIONS
|
* USER DATA FUNCTIONS
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue