diff --git a/scripts/system/create/edit.js b/scripts/system/create/edit.js index 4ef523167c..fd0ff46d2d 100644 --- a/scripts/system/create/edit.js +++ b/scripts/system/create/edit.js @@ -4,7 +4,7 @@ // Persist toolbar by HRS on June 2nd, 2015. // Copyright 2014 High Fidelity, Inc. // Copyright 2020 Vircadia contributors. -// Copyright 2022-2024 Overte e.V. +// Copyright 2022-2025 Overte e.V. // // This script allows you to edit entities with a new UI/UX for mouse and trackpad based editing // @@ -544,7 +544,7 @@ localOnly: false }, }; - + var fcreateNewEntity; var toolBar = (function () { var EDIT_SETTING = "io.highfidelity.isEditing"; // for communication with other scripts var that = {}, @@ -554,7 +554,7 @@ dialogWindow = null, tablet = null; - function createNewEntity(requestedProperties) { + function createNewEntity(requestedProperties, entityHostType="domain") { var dimensions = requestedProperties.dimensions ? requestedProperties.dimensions : DEFAULT_DIMENSIONS; var position = createApp.getPositionToCreateEntity(); var entityID = null; @@ -634,7 +634,7 @@ properties.visible = false; } - entityID = Entities.addEntity(properties); + entityID = Entities.addEntity(properties, entityHostType); var dimensionsCheckCallback = function(){ // Adjust position of entity per bounding box after it has been created and auto-resized. @@ -713,7 +713,9 @@ return entityID; } - + + fcreateNewEntity = createNewEntity; + function closeExistingDialogWindow() { if (dialogWindow) { dialogWindow.close(); @@ -2611,6 +2613,10 @@ entity.properties.keyLight.direction = Vec3.toPolar(entity.properties.keyLight.direction); entity.properties.keyLight.direction.z = 0.0; } + if (selectionManager.selections.length === 1) { + entity.properties.children = createApp.getChildEntitiesList(entity.id); + } + selections.push(entity); } data.selections = selections; @@ -2982,6 +2988,10 @@ type: 'importUi_LOAD_DATA', importUiPersistedData: importUiPersistedData }); + } else if (data.type === "specificEntityNavigation") { + selectionManager.setSelections([data.id], this); + } else if (data.type === "createChildEntity") { + fcreateNewEntity(data.properties, data.entityHostType); } }; @@ -3388,7 +3398,7 @@ } } - createApp.rotateAsNextClickedSurface = function() { + createApp.rotateAsNextClickedSurface = function() { if (!SelectionManager.hasSelection() || !SelectionManager.hasUnlockedSelection()) { audioFeedback.rejection(); Window.notifyEditError("You have nothing selected, or the selection is locked."); @@ -3398,4 +3408,19 @@ } } + createApp.getChildEntitiesList = function(parentID) { + let children = Entities.getChildrenIDs(parentID); + let childList = []; + let i, properties; + if (children.length > 0) { + for (i = 0; i < children.length; i++ ) { + properties = Entities.getEntityProperties(children[i], ["id", "name", "type", "entityHostType"]); + if (properties.name !== undefined && properties.name !== entityShapeVisualizerSessionName) { + childList.push(properties); + } + } + } + return childList; + } + }()); // END LOCAL_SCOPE diff --git a/scripts/system/create/entityProperties/html/entityProperties.html b/scripts/system/create/entityProperties/html/entityProperties.html index 5fd7892fae..8d78d5c6f8 100644 --- a/scripts/system/create/entityProperties/html/entityProperties.html +++ b/scripts/system/create/entityProperties/html/entityProperties.html @@ -5,7 +5,7 @@ // Created by Ryan Huffman on 13 Nov 2014 // Copyright 2014 High Fidelity, Inc. // Copyright 2020 Vircadia contributors. -// Copyright 2022-2024 Overte e.V. +// Copyright 2022-2025 Overte e.V. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html @@ -20,6 +20,7 @@ + @@ -62,6 +63,13 @@ +