feat(web): Outliner filter popover exposes the desktop Options, Search and Filter fields

The popover now writes the native SpaceOutliner fields the desktop
OUTLINER_PT_filter panels expose: per-type object toggles (mesh,
armature, light, camera, grease pencil, empty, others), System
Overrides, exact match and case sensitivity, the five-state object
filter with the shared invert, Object Contents / Object Children,
sort alphabetically, scroll to active and the mode column gate.

Engine OUTLINER_SET_FILTER writes SO_FILTER_NO_OB_* +
SO_FILTER_SHOW_SYSTEM_OVERRIDES + SO_MODE_COLUMN + SO_SCROLL_TO_ACTIVE,
and the snapshot carries the flags plus the Main-derived type
availability so the controls follow the data like bpy.data.

Headed case [outliner-filter-options-web] drives all three panels and
verifies the engine round trip; existing filter cases use the new state
selector.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-12-01 16:52:56 +08:00
parent 32d9f000f2
commit 8173426da2
13 changed files with 248 additions and 33 deletions

View File

@@ -357,7 +357,8 @@ export interface NativeAreaLayout {
export interface NativeOutlinerRestrict { enable?: boolean; select?: boolean; hide?: boolean; viewport?: boolean; render?: boolean; holdout?: boolean; indirectOnly?: boolean }
export interface NativeOutlinerRow { id: string; label: string; depth: number; selected: boolean; active: boolean; expanded: boolean; hasChildren: boolean; objectId: string | null; kind?: string; restrict?: NativeOutlinerRestrict; restrictionEditable?: boolean; remapId?: string | null; collectionId?: string | null; objectType?: number | null; mode?: string | null; fakeUser?: boolean | null; users?: number | null; realUsers?: number | null; fakeUserEditable?: boolean | null; asset?: boolean | null; assetSupported?: boolean | null; linked?: boolean | null; libraryOverride?: boolean | null; colorTag?: number | null }
export interface NativeOutlinerRemapID { id: string; name: string; idType: number; library: string; editable: boolean }
export interface NativeOutlinerFilter { searchString: string; caseSensitive: boolean; complete: boolean; sortAlpha: boolean; invert: boolean; state: 'ALL' | 'VISIBLE' | 'SELECTED' | 'ACTIVE' | 'SELECTABLE'; showObjects: boolean; showObjectContents: boolean; showChildren: boolean; showCollections: boolean; showViewLayers: boolean }
export interface NativeOutlinerTypeAvailability { mesh: boolean; armature: boolean; light: boolean; camera: boolean; greasePencil: boolean; others: boolean }
export interface NativeOutlinerFilter { searchString: string; caseSensitive: boolean; complete: boolean; sortAlpha: boolean; invert: boolean; state: 'ALL' | 'VISIBLE' | 'SELECTED' | 'ACTIVE' | 'SELECTABLE'; showObjects: boolean; showObjectContents: boolean; showChildren: boolean; showCollections: boolean; showViewLayers: boolean; showMeshes: boolean; showArmatures: boolean; showEmpties: boolean; showLights: boolean; showCameras: boolean; showGreasePencil: boolean; showOthers: boolean; systemOverrides: boolean; showModeColumn: boolean; scrollToActive: boolean; typeAvailability?: NativeOutlinerTypeAvailability }
export interface NativeOutlinerTree { rows: NativeOutlinerRow[]; truncated: boolean; syncSelection: boolean; displayMode?: string; displayModes?: Array<{ id: string; label: string }>; filter?: NativeOutlinerFilter; restrictColumns?: NativeOutlinerRestrict; remapIds?: NativeOutlinerRemapID[] }
export interface EditorAreaIR { nativeLayout?: NativeAreaLayout; id: string; editor: EditorTypeIR; regions: EditorRegionIR[]; rect: { x: number; y: number; width: number; height: number }; maximized: boolean; filterText?: string; space?: { outliner?: NativeOutlinerTree; kind: string; dataId?: string | null; view?: NativeViewportState; textSelection?: TextSelectionIR; imageView?: NativeImageView; uvPackTarget?: NativeUVPackTarget; properties?: NativePropertiesContext; spreadsheet?: NativeSpreadsheetContext } }
export interface EditorWorkspaceIR { id: string; name: string; screenId?: string; writable?: boolean; areas: EditorAreaIR[]; activeAreaId: string; revision: number }
@@ -839,7 +840,12 @@ export function parseEditorWorkflow(value: unknown): EditorWorkflowIR {
if (!record(value) || typeof value.searchString !== 'string' || new TextEncoder().encode(value.searchString).byteLength > 63 ||
!['ALL', 'VISIBLE', 'SELECTED', 'ACTIVE', 'SELECTABLE'].includes(String(value.state)) ||
['caseSensitive', 'complete', 'sortAlpha', 'invert', 'showObjects', 'showObjectContents',
'showChildren', 'showCollections', 'showViewLayers'].some(key => typeof value[key] !== 'boolean')) {
'showChildren', 'showCollections', 'showViewLayers', 'showMeshes', 'showArmatures',
'showEmpties', 'showLights', 'showCameras', 'showGreasePencil', 'showOthers',
'systemOverrides', 'showModeColumn', 'scrollToActive'].some(key => typeof value[key] !== 'boolean') ||
(value.typeAvailability !== undefined && (!record(value.typeAvailability) ||
['mesh', 'armature', 'light', 'camera', 'greasePencil', 'others']
.some(key => typeof (value.typeAvailability as Record<string, unknown>)[key] !== 'boolean')))) {
throw new EditorWorkflowValidationError('EDITOR_LAYOUT_INVALID', 'Invalid native Outliner filter');
}
filter = { searchString: value.searchString, state: value.state as NativeOutlinerFilter['state'],
@@ -847,7 +853,13 @@ export function parseEditorWorkflow(value: unknown): EditorWorkflowIR {
sortAlpha: value.sortAlpha as boolean, invert: value.invert as boolean,
showObjects: value.showObjects as boolean, showObjectContents: value.showObjectContents as boolean,
showChildren: value.showChildren as boolean, showCollections: value.showCollections as boolean,
showViewLayers: value.showViewLayers as boolean };
showViewLayers: value.showViewLayers as boolean,
showMeshes: value.showMeshes as boolean, showArmatures: value.showArmatures as boolean,
showEmpties: value.showEmpties as boolean, showLights: value.showLights as boolean,
showCameras: value.showCameras as boolean, showGreasePencil: value.showGreasePencil as boolean,
showOthers: value.showOthers as boolean, systemOverrides: value.systemOverrides as boolean,
showModeColumn: value.showModeColumn as boolean, scrollToActive: value.scrollToActive as boolean,
...(value.typeAvailability !== undefined ? { typeAvailability: value.typeAvailability as unknown as NativeOutlinerTypeAvailability } : {}) };
}
let displayMode: string | undefined;
let displayModes: Array<{ id: string; label: string }> | undefined;