Is it possibile to access walk_speed setting of Walk Navigation mode via python API? (I know how to activate the Walk mode by script, but I want to change the walk speed).
1 Answer
Sure, you can access all settings of WalkNavigation
via Preferences. Recommend use the python console to figure out:
>>> C.preferences
<bpy_struct, Preferences at 0x1108d8a28>
>>> C.preferences.inputs.walk_navigation.
walk_speed
use_gravity
walk_speed_factor
...
Demo on how to call bpy.ops.view3d.walk()
from a script and set the walk_speed
to 23
(default is 2.5
) by overriding the context of the operator (the actual area and the region):
import bpy
C = bpy.context
walk_nav = C.preferences.inputs.walk_navigation
walk_nav.walk_speed = 23
for area in C.screen.areas:
if area.type == 'VIEW_3D':
override = C.copy()
override['area'] = area
override["region"] = area.regions[-1]
bpy.ops.view3d.walk(override, 'INVOKE_DEFAULT')
break
Also see: Change Navigation into walk Navigation with scripting