Is it not possible to select the parent element from the panel? When I run the following code from a click handler I get an error:
Plugin Error: Cannot select node outside the current edit context’s scope: Group (‘Main’)
I’ve tried all three of these:
async function selectParentElement(sceneNode) {
const { selection } = require("scenegraph");
if (sceneNode && sceneNode.parent) {
try {
editDocument( async() => {
selection.items = [sceneNode.parent];
})
}
catch(error) {
console.log("Error:" + error.stack);
}
}
}
function selectParentElement(sceneNode) {
const { selection } = require("scenegraph");
if (sceneNode && sceneNode.parent) {
try {
editDocument(() => {
selection.items = [sceneNode.parent];
})
}
catch(error) {
console.log("Error:" + error.stack);
}
}
}
function selectParentElement(sceneNode) {
const { selection } = require("scenegraph");
if (sceneNode && sceneNode.parent) {
try {
selection.items = [sceneNode.parent];
}
catch(error) {
console.log("Error:" + error.stack);
}
}
}