Option to duplicate from a scenenode that's outside the edit context

Option to pass in a scene node to the duplicate method.

Currently you have to select the object or objects for duplicate command to work.

Use Case
Kuwabara is making a text drop shadow plugin. He walks through the scene graph and in each text object he finds he creates a duplicate in the same size and position adding a small offset. Each text object has numerous properties he has to ensure are copied to the drop shadow copy. He finds the new duplicate() command accepts scene nodes in the arguments.

Is the intent for this to be more like a clone operation where the new object isn’t part of the scenegraph, or just shorthand for:

selection.items = [ someObject ];
commands.duplicate();
const newObject = selection.items[0];

Yes. The issue with the code above is that if the items are nested or out of the edit context they can’t be selected so the duplicate function isn’t available to those elements.

I see, so the issue is you want to clone an object from some other context into the current edit context? I’ve adjusted the feature request title based on that assumption, but let me know if I’m misunderstanding.