From 52b9972882f1b8a509b05df9407724fe77446cd5 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sun, 2 Mar 2025 22:48:50 -0500 Subject: [PATCH] Adding Child Entities Tab Adding Child Entities Tab --- scripts/system/create/edit.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/scripts/system/create/edit.js b/scripts/system/create/edit.js index 24df1c9e0f..5cd3fb1a23 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 // @@ -2609,6 +2609,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; @@ -2980,6 +2984,8 @@ type: 'importUi_LOAD_DATA', importUiPersistedData: importUiPersistedData }); + } else if (data.type === "specificEntityNavigation") { + selectionManager.setSelections([data.id], this); } }; @@ -3386,7 +3392,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."); @@ -3396,4 +3402,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