Files
workinf_Blender_Wasm/web/protocol/blender-operator.ts
mes123456 4eb08faf31 chore(web): checkpoint export fixes, operator routing and three-domain evidence
- Web engine CMake: apply WITH_WEB_USD_PYTHON to blender_web_engine_core,
  embed /usd resources, link pxr Python bindings after the core archive and
  whole-archive the monolithic OpenUSD archive. Fixes the wm.usd_export abort
  and restores Alembic/USD embedded export.
- ?ui=web menus: fix inverted localOnly gating and route queueLocalDesktopOperator
  and nativeAdd through the desktop operator channel with a VIEW_3D context;
  non-mesh edit-mode selection uses the native VIEW3D_SELECT bridge.
- Refresh WebEngine wasm/js artifacts, manual/course pages and the complete
  course video asset.
- Record focused Chromium probes for Add/F3/parameters/modifier/UV/curve/deform,
  scene operations, OPFS save/reopen and worker restart. Evidence is NOT_CLAIMED.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-14 06:12:44 +08:00

155 lines
5.0 KiB
TypeScript

import type { NativeWorkflowContext } from "./native-workflow";
export type BlenderOperatorPropertyType = "boolean" | "number" | "enum" | "string" | "pointer" | "collection" | "number-array" | "boolean-array" | "enum-set";
/** Local embedded-bpy pointer input, including nested dictionary/collection fields.
* `$rna` is a native RNA path relative to bpy.data (default) or the selected
* bpy.context after editor/mode override. It is not a Python expression.
* The tag distinguishes references from literal PropertyGroup dictionaries.
* Existing string and {name, type?} ID references remain supported.
*/
export interface BlenderOperatorRNAReference {
$rna: string;
root?: "data" | "context";
type?: string;
}
export type BlenderOperatorPropertyValue = string | number | boolean | null | number[] | boolean[] | string[] | Record<string, unknown> | Array<Record<string, unknown>>;
export interface BlenderOperatorEnumItem {
value: string;
label: string;
}
export interface BlenderOperatorPropertySpec {
name: string;
type: BlenderOperatorPropertyType;
required: boolean;
label?: string;
description?: string;
defaultValue?: BlenderOperatorPropertyValue;
min?: number;
max?: number;
integer?: boolean;
arrayLength?: number;
pointerType?: string;
pointerValueKind?: "reference" | "properties";
collectionItemType?: string;
/** Live RNA fields of a property dictionary or one collection item. */
properties?: BlenderOperatorPropertySpec[];
subtype?: string;
unit?: string;
enumItems?: BlenderOperatorEnumItem[];
}
export interface BlenderOperatorDescriptor {
id: string;
label: string;
description?: string;
family: string;
context: "scene" | "object" | "main";
backgroundSafe: true;
properties: BlenderOperatorPropertySpec[];
}
export interface BlenderServerOperatorSchema {
operator: BlenderOperatorDescriptor;
blenderBuild: { version: string; buildSha256: string };
}
export interface BlenderOperatorInvocation {
operator: string;
properties?: Record<string, BlenderOperatorPropertyValue>;
baseRevision?: number;
}
export type BlenderFeatureRoute = "WEB_MAIN" | "SERVER_NATIVE" | "BROWSER_EQUIVALENT" | "UNAVAILABLE";
/** Browser-owned replacements for desktop context/window operators. */
export type BlenderBrowserActionGroup = "OPEN" | "SAVE" | "AUTOSAVE" | "RECOVERY" | "LAST_SESSION" | "WORKSPACE" | "SELECTION" | "VIEW" | "EDITOR";
export interface BlenderBrowserEquivalentInvocation {
command: "invokeBrowserEquivalent";
route: string;
actionGroup: BlenderBrowserActionGroup;
browserCommand: string;
}
export interface BlenderFeatureRouteRuntimeAudit {
command: "featureRouteRuntimeAudit";
status: "PASS" | "FAILED" | "STATIC_DECLARATION";
behavioralEvidence: { separate: true };
}
export interface BlenderFeatureRouteLocation {
path: string;
line?: number;
evidence?: string;
}
/** Source-unit route metadata used by the F3 feature palette. */
export interface BlenderFeatureRouteEntry {
id: string;
kind: string;
identifier: string;
family: string;
route: BlenderFeatureRoute;
reason: string;
/** HTTP provider used by SERVER_NATIVE routes. */
httpRoute?: string;
/** Existing browser workflow used by BROWSER_EQUIVALENT routes. */
browserActionGroup?: BlenderBrowserActionGroup;
/** Real execution channel; absent means the entry is not invokable. */
invokeVia?: "typed-command" | "desktop-operator" | "server" | "browser";
/** Dotted bpy operator ID used by the execution channel. */
invokeId?: string;
label?: string;
description?: string;
properties?: BlenderOperatorPropertySpec[];
locations?: BlenderFeatureRouteLocation[];
}
export interface BlenderFeatureRouteInvocation {
route: BlenderFeatureRouteEntry;
properties?: Record<string, BlenderOperatorPropertyValue>;
baseRevision?: number;
/** Current Main/editor context for the embedded desktop_operator channel. */
context?: NativeWorkflowContext;
/** Resolve and poll the operator through the native WM/RNA context. */
native?: boolean;
}
/** SERVER_NATIVE accepts bounded scalars, fixed RNA arrays and enum flag sets. */
export const BLENDER_OPERATOR_BACKGROUND_CONTEXT = "BACKGROUND" as const;
export type BlenderMacroStepKind = "MAIN_COMMAND" | "SERVER_NATIVE" | "CONTEXT_DEPENDENT";
export interface BlenderMacroStep {
id: string;
kind: BlenderMacroStepKind;
context: "MAIN" | "BACKGROUND" | "UI";
operator?: string;
command?: Record<string, unknown>;
source: BlenderFeatureRouteLocation[];
}
/** A bounded, source-backed native plan assembled from Blender operator units. */
export interface BlenderMacroDescriptor {
id: string;
label: string;
description?: string;
family: string;
route: BlenderFeatureRoute;
contextDependent: boolean;
source: BlenderFeatureRouteLocation[];
steps: BlenderMacroStep[];
properties?: BlenderOperatorPropertySpec[];
}
export interface BlenderMacroInvocation {
macro: string;
properties?: Record<string, BlenderOperatorPropertyValue>;
baseRevision?: number;
serverJob?: Record<string, unknown>;
}