mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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",
|
||||
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"
|
||||
},
|
||||
{
|
||||
|
@ -1874,10 +1875,16 @@ function setCopyPastePositionAndRotationAvailability (selectionLength, islocked)
|
|||
|
||||
if (selectionLength > 0 && !islocked) {
|
||||
$('#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 {
|
||||
$('#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"
|
||||
}));
|
||||
}
|
||||
|
||||
function setRotationToZeroProperty() {
|
||||
EventBridge.emitWebEvent(JSON.stringify({
|
||||
type: "action",
|
||||
action: "setRotationToZero"
|
||||
}));
|
||||
}
|
||||
/**
|
||||
* USER DATA FUNCTIONS
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue