Actually another idea I hadn’t thought of, but your suggestion made me think of it.
You could create a custom action via the custom_actions.py hook. You would then add the hook setting something like this:
I’ve not tried it, but I think if you created a new action called “Open in new window”, and that action when executed would set the
TANK_CONTEXT env var, and then run
nuke.scriptOpen(file["path"]) then it should launch the new Nuke instance in the correct context and leave the current window in the same context.
To set the
TANK_CONTEXT env var you would do the following when the action was run:
os.environ["TANK_CONTEXT"] = context.serialize()
This approach would mean that the normal open logic was still there, but the user would have the option to open in a new Nuke session, via the right-click menu, when you right-click on a file in the File Open dialog.