Script to view animation preview panel in fullscreen Similar to this post:
How to make the sequencer &#39;Preview&#39; area fullscreen with python?  

I am trying to have my script set the animation preview window to fullscreen without any other panels/menus:  



I'm trying to figure out how to navigate the hierarchy of screens, areas, and workspaces and set just that panel on the 'Animation' properly.  I'm often getting 'context is incorrect' run time errors or an error trying to set read-only object.

My script changes to the Animation screen:

# animation view
bpy.context.window.workspace = bpy.data.workspaces['Animation']


Changes the shading to rendered:

for area in bpy.data.screens['Animation'].areas:
    for space in area.spaces:
        if space.type == 'VIEW_3D':
            space.shading.type = 'RENDERED'


And then tries to changes the screen to fullscreen:

# full screen
bpy.ops.screen.screen_full_area(use_hide_panels=True)


But, the panel does not go full screen unless I do it manually via the GUI.

I'm hoping there's a way to achieve this similar to the sequencer preview full screen example that will work on the animation preview window.

Adding an completely separate view - without affecting the existing 'Animation' would be even better.

UPDATE:  Thanks @rjg for your involvement.  Now, when the animation runs (via script that kicks off the full-screen animation preview window) the objects are animating but the textures/images are blank:



I'm using:

bpy.context.scene.frame_set(f)
bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)


To do the animation playback after going full screen.
There are two things necessary to set the fullscreen mode successfully:


Wait for the workspace to be switched
Create a custom context for the operator


The first part can be accomplished by adding an application handler that is triggered after the dependency graph is updated. The second part is necessary to set the correct area to fullscreen. This can be solved by iterating through the areas of the current screen to find VIEW_3D.

You can leave the fullscreen mode by pressing CTRL + ALT + SPACE.

import bpy

# Press CTRL + ALT + SPACE to leave fullscreen mode 
def view3d_fullscreen(dummy):
    bpy.app.handlers.depsgraph_update_post.remove(view3d_fullscreen)
    context = bpy.context.copy()

    for area in bpy.context.screen.areas:
        if area.type == 'VIEW_3D':
            for space in area.spaces:
                if space.type == 'VIEW_3D':
                    space.shading.type = 'RENDERED'
            context['area'] = area
            bpy.ops.screen.screen_full_area(context, use_hide_panels=True)
            break

bpy.app.handlers.depsgraph_update_post.append(view3d_fullscreen)
bpy.context.window.workspace = bpy.data.workspaces['Animation']