Rebuild local Blender WASM environment and recovery evidence
This commit is contained in:
@@ -5,3 +5,5 @@ export { CorrectiveHistoryStore } from "../../protocol/corrective-history-store"
|
||||
export { createModifierMain, createModifierRegistry } from "../../protocol/corrective-modifier-command";
|
||||
export { createMeshMain, createMeshRegistry } from "../../protocol/corrective-mesh-command";
|
||||
export { runCorrectiveFamilyCases, summarizeCorrectiveFamilyResults } from "../../protocol/corrective-family-runner";
|
||||
export { ATOMIC_CORRECTIVE_FAMILIES, CORRECTIVE_FAMILIES } from "../../protocol/corrective-family-runner";
|
||||
export { createGenericFamilyMain, createGenericFamilyRegistry } from "../../protocol/corrective-generic-family-command";
|
||||
|
||||
@@ -30,6 +30,7 @@ export type OffscreenViewportRequest =
|
||||
|
||||
export type OffscreenViewportResponse =
|
||||
| { type: "ready" }
|
||||
| { type: "deviceStatus"; status: "ready" | "lost" | "restoring" }
|
||||
| { type: "frame"; visiblePixels: number; camera?: ViewportCameraState }
|
||||
| { type: "snapshotStatus"; nonMeshCount: number; nonMeshBlockedCount: number; greasePencilCount: number; greasePencilBlockedCount: number; greasePencilOnionStrokeCount: number; renderBudget: PBRLightingBudgetReport }
|
||||
| { type: "textureStatus"; loaded: number; rejected: number; bytes: number; errors: string[]; errorCodes: string[]; budget: PBRTextureBudgetReport }
|
||||
|
||||
@@ -137,6 +137,7 @@ export class OffscreenViewportRenderer implements ViewportBackend {
|
||||
canvas.dataset.pbrProfile = PBR_PROFILE;
|
||||
canvas.dataset.toneMapping = PBR_TONE_MAPPING;
|
||||
canvas.dataset.shadowMap = PBR_SHADOW_PROFILE;
|
||||
canvas.dataset.deviceStatus = "ready";
|
||||
this.publishInputModal();
|
||||
}
|
||||
|
||||
@@ -335,7 +336,11 @@ export class OffscreenViewportRenderer implements ViewportBackend {
|
||||
};
|
||||
|
||||
private handleMessage(message: OffscreenViewportResponse): void {
|
||||
if (message.type === "selected") this.onSelect?.(message.objectId, message.additive);
|
||||
if (message.type === "deviceStatus") {
|
||||
this.canvas.dataset.deviceStatus = message.status;
|
||||
if (message.status === "ready") this.canvas.dispatchEvent(new CustomEvent("viewport-device-restored"));
|
||||
}
|
||||
else if (message.type === "selected") this.onSelect?.(message.objectId, message.additive);
|
||||
else if (message.type === "elementSelected") this.onElementSelect?.(message.meshId, message.mode, message.index, message.additive, message.nonMeshKind);
|
||||
else if (message.type === "greasePencilPointSelected") this.onGreasePencilPointSelect?.(message.point, message.additive, message.baseSelectionRevision);
|
||||
else if (message.type === "greasePencilSelectionStatus") {
|
||||
|
||||
2
web/app/src/vendor/blender/web_engine.js
vendored
2
web/app/src/vendor/blender/web_engine.js
vendored
File diff suppressed because one or more lines are too long
BIN
web/app/src/vendor/blender/web_engine.wasm
vendored
BIN
web/app/src/vendor/blender/web_engine.wasm
vendored
Binary file not shown.
@@ -577,14 +577,17 @@ workerScope.onmessage = (event): void => {
|
||||
message.canvas.addEventListener("webglcontextlost", (event) => {
|
||||
event.preventDefault();
|
||||
contextLost = true;
|
||||
post({ type: "deviceStatus", status: "lost" });
|
||||
post({ type: "volumeStatus", status: "loading", count: 0, errorCode: "WEBGL_CONTEXT_LOST" });
|
||||
});
|
||||
message.canvas.addEventListener("webglcontextrestored", () => {
|
||||
contextLost = false;
|
||||
post({ type: "deviceStatus", status: "restoring" });
|
||||
configurePBRRenderer(renderer!);
|
||||
volumeRenderCache.clear();
|
||||
void refreshVolumes();
|
||||
render();
|
||||
post({ type: "deviceStatus", status: "ready" });
|
||||
});
|
||||
configurePBRRenderer(renderer);
|
||||
scene = new Scene();
|
||||
@@ -601,6 +604,7 @@ workerScope.onmessage = (event): void => {
|
||||
scene.add(light, light.target, new GridHelper(20, 20, 0x60656e, 0x383b42), root, importedLights);
|
||||
resize(message.width, message.height, message.pixelRatio);
|
||||
post({ type: "ready" });
|
||||
post({ type: "deviceStatus", status: "ready" });
|
||||
}
|
||||
else if (message.type === "snapshot") setSnapshot(message.snapshot, message.geometryBuffers, message.nonMeshGeometryBuffers);
|
||||
else if (message.type === "textureAssets") applyTextureAssets(message.assets);
|
||||
|
||||
Reference in New Issue
Block a user