feat(web): continue source-backed implementation waves
This commit is contained in:
@@ -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 };
|
||||
},
|
||||
|
||||
8
web/protocol/compositor-commands.ts
Normal file
8
web/protocol/compositor-commands.ts
Normal 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);
|
||||
9
web/protocol/geometry-node-commands.ts
Normal file
9
web/protocol/geometry-node-commands.ts
Normal 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);
|
||||
@@ -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 };
|
||||
},
|
||||
|
||||
9
web/protocol/physics-commands.ts
Normal file
9
web/protocol/physics-commands.ts
Normal 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);
|
||||
8
web/protocol/resource-commands.ts
Normal file
8
web/protocol/resource-commands.ts
Normal 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);
|
||||
@@ -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" },
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user