chore: checkpoint web Blender migration source, tools and docs
Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer, web workflow engine and protocol, tooling, docs and task records. Large generated evidence, user-testing archives, build snapshots and imported test assets remain untracked. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
22
tools/web/native_preferences.py
Normal file
22
tools/web/native_preferences.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""Load the Web Blender profile without touching the desktop user's config."""
|
||||
from pathlib import Path
|
||||
import bpy
|
||||
|
||||
|
||||
def load_preferences(root):
|
||||
if (root / 'config' / 'userpref.blend').is_file():
|
||||
state = bpy.ops.wm.read_userpref('EXEC_DEFAULT')
|
||||
if 'FINISHED' not in state: raise RuntimeError('PREFERENCES_LOAD_FAILED')
|
||||
# Persistence is an explicit Web session command, not shutdown of a temporary job.
|
||||
bpy.context.preferences.use_preferences_save = False
|
||||
|
||||
|
||||
def save_preferences(root, sequence):
|
||||
state = bpy.ops.wm.save_userpref('EXEC_DEFAULT')
|
||||
if 'FINISHED' not in state: raise RuntimeError('PREFERENCES_SAVE_FAILED')
|
||||
source = Path(bpy.utils.user_resource('CONFIG')) / 'userpref.blend'
|
||||
if not source.is_file() or source.stat().st_size > 16 * 1024 * 1024:
|
||||
raise RuntimeError('PREFERENCES_SAVE_OUTPUT_INVALID')
|
||||
destination = root / f'preferences-{sequence:08d}.blend'
|
||||
destination.write_bytes(source.read_bytes())
|
||||
return destination
|
||||
Reference in New Issue
Block a user