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:
49
web/app/src/python/web_blender.py
Normal file
49
web/app/src/python/web_blender.py
Normal file
@@ -0,0 +1,49 @@
|
||||
"""Asynchronous access to the application's actual Blender WebEngine.
|
||||
|
||||
This is a WebEngine command interface, not the desktop bpy module.
|
||||
"""
|
||||
import json
|
||||
import contextvars
|
||||
from _web_blender_host import request as _request
|
||||
|
||||
_session_run = contextvars.ContextVar('web_blender_run', default=0)
|
||||
|
||||
|
||||
async def _call(method, value):
|
||||
response = await _request(_session_run.get(), method, json.dumps(value, allow_nan=False))
|
||||
return json.loads(response)
|
||||
|
||||
|
||||
async def snapshot():
|
||||
"""Read the current authoritative scene snapshot."""
|
||||
return await _call('snapshot', {})
|
||||
|
||||
|
||||
async def context():
|
||||
"""Read the active native workspace, screen, area and bound editor data."""
|
||||
return await _call('context', {})
|
||||
|
||||
|
||||
async def command(payload):
|
||||
"""Apply one WebEngine command through the normal Main transaction path."""
|
||||
if not isinstance(payload, dict):
|
||||
raise TypeError('command requires a dictionary')
|
||||
return await _call('command', payload)
|
||||
|
||||
|
||||
async def operators():
|
||||
"""List operators implemented by the compiled WebEngine."""
|
||||
return await _call('operators', {})
|
||||
|
||||
|
||||
async def operator(identifier, **properties):
|
||||
"""Invoke a source-backed operator in the current WebEngine context."""
|
||||
return await _call('operator', {'operator': identifier, 'properties': properties})
|
||||
|
||||
|
||||
async def data_blocks(**query):
|
||||
return await _call('data_blocks', query)
|
||||
|
||||
|
||||
async def properties(**query):
|
||||
return await _call('properties', query)
|
||||
Reference in New Issue
Block a user