Blender 4.0 : temp_override & ops.view3d.walk()?

Context override argument is depreciated in Blender 4, so we have to use temp_override, but it’s not working… is it me or a bug in v4 ?
I need help : )

my code before Blender 4, to activate walk :

for area in bpy.context.screen.areas:
if area.type == ‘VIEW_3D’:
rv3d = area.spaces[0].region_3d
if rv3d is not None:
c = {}
c[“area”] = area
c[“region”] = area.regions[-1]
bpy.ops.view3d.walk(c,‘INVOKE_DEFAULT’)

one of the code I try in Blender 4 that do not work :

area = [area for area in bpy.context.screen.areas if area.type == “VIEW_3D”][0]

region = area.regions[-1]
with bpy.context.temp_override(area=area, region=region):
bpy.ops.view3d.walk()

You will still need to use INVOKE_DEFAULT for that operator. The following works for me:

    area = [area for area in bpy.context.screen.areas if area.type == "VIEW_3D"][0]
    region = area.regions[-1]

    with bpy.context.temp_override(area=area, region=region):
        bpy.ops.view3d.walk('INVOKE_DEFAULT')

In the future, questions like these might be better served elsewhere. See the “User Community” links above. Namely the “Blender Stack Overflow” site would be helpful as well as the #python channel on the blender.chat service.

3 Likes

It work ! Thank you very much.

The problem is ‘bpy.ops.view3d.walk()’ is documented without argument.