Assigning to selection.items
from a panel raises the following error:
“Plugin Error: not permitted to make changes from the background. Return a Promise to continue execution asynchronously.”
Here’s the code:
function selectFirstArtboard(e) {
const firstArtboard = scenegraph.root.children.at(0)
console.log("Trying to select the first artboard: " + firstArtboard.name)
scenegraph.selection.items = [firstArtboard]
}
Here’s the reduced test-case repo.
How should this code be written so that we’re able to change the selection when the user interacts with the panel?
Thanks!
cc: @stevekwak