mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-15 01:48:07 +02:00
Add: Copy Skybox Color to Ambient Color
Add: Copy Skybox Color to Ambient Color
This commit is contained in:
parent
b3d9b62971
commit
df387d29a1
1 changed files with 19 additions and 1 deletions
|
@ -477,6 +477,13 @@ const GROUPS = [
|
|||
propertyID: "ambientLight.ambientColor",
|
||||
showPropertyRule: { "ambientLightMode": "enabled" },
|
||||
},
|
||||
{
|
||||
type: "buttons",
|
||||
buttons: [ { id: "copy", label: "Copy color from Skybox",
|
||||
className: "black", onClick: copySkyboxColorToAmbientColor } ],
|
||||
propertyID: "copyColorToAmbient",
|
||||
showPropertyRule: { "ambientLightMode": "enabled" },
|
||||
},
|
||||
{
|
||||
label: "Ambient Intensity",
|
||||
type: "number-draggable",
|
||||
|
@ -2259,6 +2266,7 @@ let currentSpaceMode = PROPERTY_SPACE_MODE.LOCAL;
|
|||
let zonesList = [];
|
||||
let canViewAssetURLs = false;
|
||||
let maSelectedId;
|
||||
let skyboxColorForCopy;
|
||||
|
||||
function createElementFromHTML(htmlString) {
|
||||
let elTemplate = document.createElement('template');
|
||||
|
@ -3811,6 +3819,10 @@ function copySkyboxURLToAmbientURL() {
|
|||
updateProperty("ambientLight.ambientURL", skyboxURL, false);
|
||||
}
|
||||
|
||||
function copySkyboxColorToAmbientColor() {
|
||||
updateProperty("ambientLight.ambientColor", skyboxColorForCopy, false);
|
||||
}
|
||||
|
||||
function copyPositionProperty() {
|
||||
EventBridge.emitWebEvent(JSON.stringify({
|
||||
type: "action",
|
||||
|
@ -5014,15 +5026,21 @@ function handleEntitySelectionUpdate(selections, isPropertiesToolUpdate) {
|
|||
selectedEntityIDs = new Set(selections.map(selection => selection.id));
|
||||
const multipleSelections = currentSelections.length > 1;
|
||||
const hasSelectedEntityChanged = !areSetsEqual(selectedEntityIDs, previouslySelectedEntityIDs);
|
||||
|
||||
|
||||
if (selections.length === 1) {
|
||||
if (maSelectedId !== selections[0].id) {
|
||||
closeMaterialAssistant();
|
||||
}
|
||||
maSelectedId = selections[0].id;
|
||||
if (selections[0].properties.type === "Zone") {
|
||||
skyboxColorForCopy = selections[0].properties.skybox.color;
|
||||
} else {
|
||||
skyboxColorForCopy = undefined;
|
||||
}
|
||||
} else {
|
||||
closeMaterialAssistant();
|
||||
maSelectedId = "";
|
||||
skyboxColorForCopy = undefined;
|
||||
}
|
||||
|
||||
requestZoneList();
|
||||
|
|
Loading…
Reference in a new issue