I currently have
class OpenNodeEditor(bpy.types.Operator):
"""Open the node editor"""
bl_idname = "scene.open_node_editor"
bl_label = "Open Node Editor"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
bpy.ops.wm.context_set_string(data_path="area.type", value="NODE_EDITOR")
return {'FINISHED'}
This works, but when I press the button, it switches the space that the button is in (active editor), in this case, the properties editor, to the node editor. How can I make it open up a new section in the layout or open the node editor in the largest open editor?