chore: checkpoint web Blender migration source, tools and docs
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

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:
mes123456
2026-11-10 11:18:01 +08:00
parent 122142c26c
commit f3e21c6b98
6887 changed files with 257154 additions and 12294 deletions

View File

@@ -210,6 +210,18 @@ static void screen_blend_write(BlendWriter *writer, ID *id, const void *id_addre
{
bScreen *screen = id_cast<bScreen *>(id);
screen->active_region = nullptr; /* Runtime focus is rebuilt when the screen is read. */
screen->skip_handling = false; /* One-iteration event-loop delay is not document state. */
screen->do_draw = false; /* Redraw notifications are runtime state, not document edits. */
/* Menus, tooltips and timers are runtime-only screen state. Leaving their pointers
* in the file makes two writes of one unchanged Main differ, which the Web engine
* compares to decide whether the user edited anything. Restore them after writing
* so an open popup keeps working. */
const bScreen saved_screen = *screen;
screen->regionbase = {nullptr, nullptr};
screen->animtimer = nullptr;
screen->context = nullptr;
screen->tool_tip = nullptr;
/* write LibData */
/* in 2.50+ files, the file identifier for screens is patched, forward compatibility */
writer->write_struct_at_address_by_id_with_filecode(
@@ -220,6 +232,8 @@ static void screen_blend_write(BlendWriter *writer, ID *id, const void *id_addre
/* direct data */
BKE_screen_area_map_blend_write(writer, AREAMAP_FROM_SCREEN(screen));
screen->regionbase = saved_screen.regionbase; screen->animtimer = saved_screen.animtimer;
screen->context = saved_screen.context; screen->tool_tip = saved_screen.tool_tip;
}
bool BKE_screen_blend_read_data(BlendDataReader *reader, bScreen *screen)
@@ -1285,6 +1299,22 @@ static void write_region(BlendWriter *writer, ARegion *region, int spacetype)
{
ARegion region_copy = *region;
region_copy.runtime = nullptr;
/* HUD pixel bounds are rebuilt after redo/file-browser layout, not authored Main data. */
if (region_copy.regiontype == RGN_TYPE_HUD) {
region_copy.winrct = {};
region_copy.winx = region_copy.winy = 0;
}
region_copy.v2d.vert = {}; /* Scroll-bar hit rectangles are rebuilt by view2d_masks. */
region_copy.v2d.hor = {};
#ifdef WITH_WEB
if (!BLO_write_is_undo(writer)) region_copy.v2d.alpha_hor = region_copy.v2d.alpha_vert = 0;
#endif
if (spacetype == SPACE_PROPERTIES && region->regiontype == RGN_TYPE_NAV_BAR) {
region_copy.v2d.scroll &= ~V2D_SCROLL_VERTICAL;
}
if (spacetype == SPACE_STATUSBAR) {
region_copy.v2d.tot = {}; /* Status text bounds are recalculated by header layout. */
}
writer->write_struct_at_address(region, &region_copy);
if (region->regiondata) {
@@ -1335,6 +1365,9 @@ static void write_panel_list(BlendWriter *writer, ListBaseT<Panel> *lb)
Panel panel_copy = panel;
panel_copy.runtime_flag = 0;
panel_copy.runtime = nullptr;
panel_copy.type = nullptr;
panel_copy.drawname = nullptr;
panel_copy.activedata = nullptr;
writer->write_struct_at_address(&panel, &panel_copy);
writer->write_struct_list(&panel.layout_panel_states);
for (LayoutPanelState &state : panel.layout_panel_states) {
@@ -1390,7 +1423,12 @@ void BKE_screen_area_map_blend_write(BlendWriter *writer, ScrAreaMap *area_map)
for (ScrArea &area : area_map->areabase) {
area.butspacetype = area.spacetype; /* Just for compatibility, will be reset below. */
writer->write_struct(&area);
ScrArea saved = dna::shallow_copy(area);
saved.flag &= ~AREA_FLAG_ACTIVE_TOOL_UPDATE;
#ifdef WITH_WEB
if (!BLO_write_is_undo(writer)) saved.flag &= ~AREA_FLAG_ACTIONZONES_UPDATE;
#endif
writer->write_struct_at_address(&area, &saved);
writer->write_struct(area.global);