File size: 1,317 Bytes
92f480e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Build-time: bake the user preferences the task wants into
# /root/.config/blender/5.0/config/userpref.blend (run as
# `blender -b --python setprefs.py`). Blender writes prefs on exit only when
# they changed in the UI; baking them means the first launch the agent sees
# already has no splash, no Python tooltips, no developer extras, no auto-run
# of embedded scripts, and the Preferences window itself is untouched.
import bpy

p = bpy.context.preferences
p.view.show_splash = False
p.view.show_tooltips_python = False
p.view.show_developer_ui = False
p.filepaths.use_scripts_auto_execute = False
# autosave every 2 min into the temp dir: a crash mid-part leaves something
# for the launcher's relaunch to recover (Blender's own "Recover Auto Save").
p.filepaths.use_auto_save_temporary_files = True
p.filepaths.auto_save_time = 2
p.filepaths.save_version = 1
# xdotool has no mouse wheel emulation problem, but the tutorial's numpad
# view keys are used constantly; keep Blender's default (no numpad emulation)
# so the video's keys mean what they say.
p.inputs.use_emulate_numpad = False
# the harness's Chromium already owns the harness display; Blender's own
# window is put on :1 by the launcher — nothing to set here.
bpy.ops.wm.save_userpref()
print("setprefs: saved", bpy.utils.user_resource("CONFIG"))