Implement Check for missing reference parent action

This commit is contained in:
Brenden Harrell committed 2021-08-06 21:51:25 -05:00
1 parent 9870d01354
commit a5a9d933bf
4 files changed
+23 -7

No files matched your search

@@ -28,7 +28,27 @@ function newFoundationsFunctionLibraryWorkspaceFunctions() {
}
}
function checkForMissingReferences() {
console.log("this action is working")
// This function scales the current workspace and highlights any nodes that have unresolved references
function checkForMissingReferences(rootNodes) {
let nodes
for (let i = 0; i < rootNodes.length; i++) {
if (rootNodes[i] !== undefined) {
nodes = UI.projects.foundations.utilities.hierarchy.getHiriarchyMap(rootNodes[i])
for (let [key, value] of nodes) {
// Check nodes that have a saved reference parent
if (value.savedPayload.referenceParent !== undefined) {
// Highlight nodes that do not have an active reference connected to their referance parent
if (value.payload.referenceParent === undefined) {
console.log("[WARN] Reference Parent not found in the current workspace.\n Node:", value.name, " Type:", value.type, " ID:", key, " Node Object:", value)
UI.projects.foundations.spaces.floatingSpace.inMapMode = true
value.payload.uiObject.setWarningMessage('Reference Parent not found in the current workspace.', 10)
}
}
}
}
}
}
}