feat(web): continue source-backed implementation waves
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

This commit is contained in:
mes123456
2026-08-29 05:46:53 +08:00
parent e9b9d343a1
commit 81113159dc
180 changed files with 12316 additions and 82 deletions

View File

@@ -14,6 +14,12 @@ export const animationRenderCommands = Object.freeze({
setConstraint(objectId: string, constraintName: string, enabled: boolean, influence: number): AnimationCommand<"setConstraint"> {
return { type: "setConstraint", objectId, constraintName, enabled, influence };
},
setActiveAction(objectId: string, actionId: string | null): AnimationCommand<"setActiveAction"> {
return { type: "setActiveAction", objectId, actionId };
},
setNLAStack(objectId: string, tracks: AnimationCommand<"setNLAStack">["tracks"], baseRevision?: number): AnimationCommand<"setNLAStack"> {
return { type: "setNLAStack", objectId, tracks, ...(baseRevision === undefined ? {} : { baseRevision }) };
},
setLightProperties(dataId: string, properties: AnimationCommand<"setLightProperties">["properties"]): AnimationCommand<"setLightProperties"> {
return { type: "setLightProperties", dataId, properties };
},

View File

@@ -0,0 +1,8 @@
import type { CompositorGraphIR } from "./compositor";
/** Workbench command payload for the bounded local compositor evaluator. */
export const compositorCommands = Object.freeze({
evaluate(graph: CompositorGraphIR): CompositorGraphIR {
return structuredClone(graph);
},
} as const);

View File

@@ -0,0 +1,9 @@
import type { GeometryNodeGraphIR } from "./geometry-nodes";
import type { WebEngineEditCommand } from "./web-engine";
/** Workbench constructors for validated Geometry Node graph transactions. */
export const geometryNodeCommands = Object.freeze({
setGraph(meshId: string, graph: GeometryNodeGraphIR): Extract<WebEngineEditCommand, { type: "setGeometryNodeGraph" }> {
return { type: "setGeometryNodeGraph", meshId, graph };
},
} as const);

View File

@@ -13,9 +13,15 @@ export const nonMeshGeometryCommands = Object.freeze({
setFontBody(dataId: string, body: string): NonMeshCommand<"setFontBody"> {
return { type: "setFontBody", dataId, body };
},
setFontProperties(dataId: string, properties: NonMeshCommand<"setFontProperties">["properties"]): NonMeshCommand<"setFontProperties"> {
return { type: "setFontProperties", dataId, properties: { ...properties } };
},
setVolumeProperties(dataId: string, sourcePath: string, displayDensity: number, interpolation: "NEAREST" | "LINEAR", stepSize: number): NonMeshCommand<"setVolumeProperties"> {
return { type: "setVolumeProperties", dataId, sourcePath, displayDensity, interpolation, stepSize };
},
setMetaballElements(dataId: string, elements: NonMeshCommand<"setMetaballElements">["elements"]): NonMeshCommand<"setMetaballElements"> {
return { type: "setMetaballElements", dataId, elements: elements.map((element) => ({ ...element, position: [...element.position] as [number, number, number], scale: [...element.scale] as [number, number, number] })) };
},
createGreasePencilLayer(dataId: string, name: string): NonMeshCommand<"createGreasePencilLayer"> {
return { type: "createGreasePencilLayer", dataId, name };
},

View File

@@ -0,0 +1,9 @@
import type { PhysicsSimulationManifestIR } from "./physics-simulation";
import type { WebEngineEditCommand } from "./web-engine";
/** Typed constructor for bounded physics metadata commits to WebEngine Main. */
export const physicsCommands = Object.freeze({
setManifest(manifest: PhysicsSimulationManifestIR): Extract<WebEngineEditCommand, { type: "setPhysicsSimulation" }> {
return { type: "setPhysicsSimulation", manifest };
},
} as const);

View File

@@ -0,0 +1,8 @@
import type { WebEngineRequest } from "./web-engine";
/** Resource-facing command constructors; asset bytes remain owned by the worker/storage path. */
export const resourceCommands = Object.freeze({
requestAsset(assetId: string): Extract<WebEngineRequest["command"], { type: "requestAsset" }> {
return { type: "requestAsset", assetId };
},
} as const);

View File

@@ -61,6 +61,7 @@ export const WEB_ENGINE_COMMAND_CAPABILITIES = {
setFontAdvanced: { family: "FONT", route: "MAIN_AUTHORITATIVE", implementation: "SOURCE_BACKED" },
importVFont: { family: "FONT", route: "MAIN_AUTHORITATIVE", implementation: "SOURCE_BACKED" },
setFontLinks: { family: "FONT", route: "MAIN_AUTHORITATIVE", implementation: "SOURCE_BACKED" },
setTextSource: { family: "IO", route: "MAIN_AUTHORITATIVE", implementation: "SOURCE_BACKED" },
setVolumeProperties: { family: "VOLUME", route: "MAIN_AUTHORITATIVE", implementation: "SOURCE_BACKED" },
createGreasePencilLayer: { family: "GREASE_PENCIL", route: "MAIN_AUTHORITATIVE", implementation: "SOURCE_BACKED" },
removeGreasePencilLayer: { family: "GREASE_PENCIL", route: "MAIN_AUTHORITATIVE", implementation: "SOURCE_BACKED" },

View File

@@ -125,6 +125,7 @@ export type WebEngineEditCommand =
| { type: "setFontAdvanced"; dataId: string; characters: NonMeshFontCharacterIR[]; textBoxes: NonMeshFontTextBoxIR[]; activeTextBox: number }
| { type: "importVFont"; schemaVersion: 1; projectId: string; assetId: string; assetPath: string; sourcePath: string; name: string; format: "TTF" | "OTF" | "PFB"; mimeType: string; byteLength: number; sha256: string; base64: string }
| { type: "setFontLinks"; dataId: string; links: NonMeshFontLinksIR }
| { type: "setTextSource"; dataId: string; source: string }
| { type: "setVolumeProperties"; dataId: string; sourcePath: string; displayDensity: number; interpolation: "NEAREST" | "LINEAR"; stepSize: number; velocityGrid?: string; velocityScale?: number }
| { type: "createGreasePencilLayer"; dataId: string; name: string }
| { type: "removeGreasePencilLayer"; dataId: string; layerId: string }