Adding Child Entities Tab

Adding Child Entities Tab
This commit is contained in:
Alezia Kurdis 2025-03-02 22:48:50 -05:00 committed by GitHub
parent 356f4579b7
commit 52b9972882
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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