feat(manual): add the illustrated Web Blender HTML user manual
A single-page 28-chapter manual generated from manual.json covers the 11 workspaces, all React editors, OPFS save/reopen, explicit local downloads, import/export routes, preferences/keymap and the capability matrix. It reuses verified course screenshots and adds 14 fresh Chromium captures for shell, storage, area, camera, preferences, IO and troubleshooting chapters. Manual-driven fixes: Save As now states OPFS-only, GLTF import is restored, quick toolbar honors its preference, startup workspace is applied, Properties tabs jump to sections, Outliner fallback search filters, and the editor-header ⋮ opens the area menu. Help and the tutorial landing link the new manual; the PDF remains as an archive. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -214,7 +214,7 @@ function sceneCameraPose(snapshot: SceneSnapshotIR | null): BlenderViewportCamer
|
||||
}
|
||||
|
||||
const IO_FORMAT_UI_REGISTRY = parseIOFormatUIRegistry(ioFormatUIRegistryJSON);
|
||||
IO_FORMAT_UI_REGISTRY.importRoutes = IO_FORMAT_UI_REGISTRY.importRoutes.filter((route) => ["OBJ", "STL", "PLY", "GLB"].includes(route.format));
|
||||
IO_FORMAT_UI_REGISTRY.importRoutes = IO_FORMAT_UI_REGISTRY.importRoutes.filter((route) => ["OBJ", "STL", "PLY", "GLB", "GLTF"].includes(route.format));
|
||||
const NATIVE_FILE_EXPORT_EXTENSIONS = new Map<string,string>([['wm.obj_export','.obj'],['wm.stl_export','.stl'],['wm.ply_export','.ply'],['wm.usd_export','.usdc'],['wm.alembic_export','.abc']]);
|
||||
const IO_FORMAT_RUNTIME_RECEIPTS = parseIOFormatReceiptFreshness(ioFormatRuntimeReceiptFreshnessJSON);
|
||||
const IO_FORMAT_RUNTIME_RECEIPT_EXPECTED = ioFormatRuntimeReceiptFreshnessExpectedJSON as unknown as IOFormatReceiptFreshnessExpectedIR;
|
||||
@@ -1339,7 +1339,7 @@ function Area({ className = "", editor, children, areaId }: AreaProps) {
|
||||
<span>{editor}</span>
|
||||
</button>
|
||||
<span className="header-spacer" />
|
||||
<button className="icon-button" type="button" aria-label={`${editor} 菜单`}>⋮</button>
|
||||
<DesktopMenu className="area-menu" label="⋮" items={areaMenuItems} />
|
||||
</header>
|
||||
<div className="area-content">{useDefaultContent ? newAreaContent : context!.render(activeEditor, areaKey)}</div>
|
||||
</section>
|
||||
@@ -1816,6 +1816,7 @@ function Outliner({ snapshot, areaId, onSelect, onToggleVisibility, onRefresh, o
|
||||
const selectedIds = snapshot ? selectionFromSnapshot(snapshot) : new Set<string>();
|
||||
const collectionRows = snapshot?.collections ?? [];
|
||||
const [collapsed,setCollapsed]=useState<Set<string>>(new Set());
|
||||
const [fallbackSearch,setFallbackSearch]=useState("");
|
||||
const workflow = snapshot?.editorWorkflow;
|
||||
const workspace = workflow?.workspaces.find(item => item.id === workflow.context.workspaceId);
|
||||
const nativeArea = workspace?.areas.find(item => item.editor === 'OUTLINER' &&
|
||||
@@ -2107,11 +2108,28 @@ function Outliner({ snapshot, areaId, onSelect, onToggleVisibility, onRefresh, o
|
||||
</form>
|
||||
</DesktopDialog> : null}
|
||||
</div>;
|
||||
const fallbackQuery = fallbackSearch.trim().toLowerCase();
|
||||
const fallbackAllowed = (() => {
|
||||
if (!fallbackQuery) return null;
|
||||
const allowed = new Set<string>();
|
||||
const children = new Map<string, string[]>();
|
||||
for (const node of snapshot?.nodes ?? []) if (node.parentId) children.set(node.parentId, [...(children.get(node.parentId) ?? []), node.id]);
|
||||
for (const node of snapshot?.nodes ?? []) {
|
||||
if (!node.name.toLowerCase().includes(fallbackQuery)) continue;
|
||||
allowed.add(node.id);
|
||||
let parent = node.parentId;
|
||||
while (parent) { allowed.add(parent); parent = nodeById.get(parent)?.parentId ?? null; }
|
||||
const stack = [...(children.get(node.id) ?? [])];
|
||||
while (stack.length) { const id = stack.pop()!; allowed.add(id); stack.push(...(children.get(id) ?? [])); }
|
||||
}
|
||||
return allowed;
|
||||
})();
|
||||
const visibleCollections = fallbackAllowed ? collectionRows.filter((collection) => collection.objectIds.some((id) => fallbackAllowed.has(id))) : collectionRows;
|
||||
const rowsFor=(objectIds:string[])=>{
|
||||
const members=new Set(objectIds),children=new Map<string,string[]>(),rows:{id:string;depth:number;hasChildren:boolean}[]=[],visited=new Set<string>();
|
||||
for(const id of objectIds){const parent=nodeById.get(id)?.parentId;if(parent&&members.has(parent))children.set(parent,[...(children.get(parent)??[]),id]);}
|
||||
const visit=(id:string,depth:number,hidden=false)=>{if(visited.has(id))return;visited.add(id);const childIds=children.get(id)??[];
|
||||
if(!hidden)rows.push({id,depth,hasChildren:childIds.length>0});
|
||||
if(!hidden&&(!fallbackAllowed||fallbackAllowed.has(id)))rows.push({id,depth,hasChildren:childIds.length>0});
|
||||
for(const child of childIds)visit(child,depth+1,hidden||collapsed.has(id));
|
||||
};
|
||||
for(const id of objectIds){const parent=nodeById.get(id)?.parentId;if(!parent||!members.has(parent))visit(id,0);}
|
||||
@@ -2120,9 +2138,9 @@ function Outliner({ snapshot, areaId, onSelect, onToggleVisibility, onRefresh, o
|
||||
};
|
||||
return (
|
||||
<div className="outliner-content">
|
||||
<div className="outliner-tools"><input aria-label="搜索场景" placeholder="搜索场景" /><button type="button" aria-label="筛选">⌄</button>{onRefresh ? <button type="button" aria-label="刷新大纲树" onClick={() => onRefresh()}>↻</button> : null}{onSelectAll ? <><button type="button" aria-label="全选大纲对象" onClick={() => onSelectAll('SELECT')}>全选</button><button type="button" aria-label="取消选择大纲对象" onClick={() => onSelectAll('DESELECT')}>清除</button><button type="button" aria-label="反选大纲对象" onClick={() => onSelectAll('INVERT')}>反选</button><button type="button" aria-label="切换大纲选择" onClick={() => onSelectAll('TOGGLE')}>切换</button></> : null}</div>
|
||||
<div className="outliner-tools">{!tree ? <><input aria-label="搜索场景" placeholder="搜索场景" value={fallbackSearch} onChange={(event) => setFallbackSearch(event.target.value)} />{fallbackQuery ? <button type="button" aria-label="清除大纲搜索" onClick={() => setFallbackSearch("")}>×</button> : null}</> : null}<button type="button" aria-label="筛选">⌄</button>{onRefresh ? <button type="button" aria-label="刷新大纲树" onClick={() => onRefresh()}>↻</button> : null}{onSelectAll ? <><button type="button" aria-label="全选大纲对象" onClick={() => onSelectAll('SELECT')}>全选</button><button type="button" aria-label="取消选择大纲对象" onClick={() => onSelectAll('DESELECT')}>清除</button><button type="button" aria-label="反选大纲对象" onClick={() => onSelectAll('INVERT')}>反选</button><button type="button" aria-label="切换大纲选择" onClick={() => onSelectAll('TOGGLE')}>切换</button></> : null}</div>
|
||||
<div className="outliner-tree" role="tree" aria-label="场景层级" aria-multiselectable="true">
|
||||
{collectionRows.length === 0 ? <div className="tree-row collection" role="treeitem" aria-expanded="true"><span>▾</span><strong>Scene Collection</strong></div> : collectionRows.map((collection, index) => (
|
||||
{visibleCollections.length === 0 ? <div className="tree-row collection" role="treeitem" aria-expanded="true"><span>▾</span><strong>{fallbackQuery ? "没有匹配的对象" : "Scene Collection"}</strong></div> : visibleCollections.map((collection, index) => (
|
||||
<div key={collection.id}>
|
||||
<div className={index === 0 ? "tree-row collection" : "tree-row"} role="treeitem" aria-expanded="true"><span>▾</span><span className="tree-icon">◈</span><strong>{collection.name}</strong></div>
|
||||
<div role="group">
|
||||
@@ -2637,6 +2655,13 @@ function Properties({ selectedEdgeIndices, nonMeshGeometryBuffers, client, snaps
|
||||
onActiveMaterialSlotChange: (slot: number) => void;
|
||||
}) {
|
||||
const greasePencilPointSelection = greasePencilSelection?.selectedPoints ?? [];
|
||||
const [propertyTab, setPropertyTab] = useState<"object" | "modifier" | "material">("object");
|
||||
const jumpToPropertySection = (tab: "object" | "modifier" | "material", event: React.MouseEvent<HTMLButtonElement>): void => {
|
||||
setPropertyTab(tab);
|
||||
const content = event.currentTarget.closest(".properties-content");
|
||||
const selector = tab === "object" ? '[data-testid="object-transform-readout"]' : tab === "modifier" ? ".modifier-panel" : '[data-testid="material-slots-section"]';
|
||||
content?.querySelector<HTMLElement>(selector)?.scrollIntoView({ block: "start", behavior: "smooth" });
|
||||
};
|
||||
const [mode, setMode] = useState<SimplifyMode>("COLLAPSE");
|
||||
const [ratio, setRatio] = useState(0.5);
|
||||
const [targetKind, setTargetKind] = useState<'RATIO' | 'TRIANGLES'>('RATIO');
|
||||
@@ -3276,9 +3301,9 @@ function Properties({ selectedEdgeIndices, nonMeshGeometryBuffers, client, snaps
|
||||
return (
|
||||
<div className="properties-content">
|
||||
<div className="property-tabs" role="tablist" aria-label="属性标签">
|
||||
<button className="property-tab active" type="button" role="tab" aria-selected="true" title="对象属性"><span aria-hidden="true">▣</span><span className="property-tab-label">对象</span></button>
|
||||
<button className="property-tab" type="button" role="tab" aria-selected="false" title="修改器属性"><span aria-hidden="true">⌕</span><span className="property-tab-label">修改器</span></button>
|
||||
<button className="property-tab" type="button" role="tab" aria-selected="false" title="材质属性"><span aria-hidden="true">●</span><span className="property-tab-label">材质</span></button>
|
||||
<button className={`property-tab${propertyTab === "object" ? " active" : ""}`} type="button" role="tab" aria-selected={propertyTab === "object"} title="对象属性" onClick={(event) => jumpToPropertySection("object", event)}><span aria-hidden="true">▣</span><span className="property-tab-label">对象</span></button>
|
||||
<button className={`property-tab${propertyTab === "modifier" ? " active" : ""}`} type="button" role="tab" aria-selected={propertyTab === "modifier"} title="修改器属性" onClick={(event) => jumpToPropertySection("modifier", event)}><span aria-hidden="true">⌕</span><span className="property-tab-label">修改器</span></button>
|
||||
<button className={`property-tab${propertyTab === "material" ? " active" : ""}`} type="button" role="tab" aria-selected={propertyTab === "material"} title="材质属性" onClick={(event) => jumpToPropertySection("material", event)}><span aria-hidden="true">●</span><span className="property-tab-label">材质</span></button>
|
||||
</div>
|
||||
<div className="property-section" data-testid="object-transform-readout"><h3>Transform</h3>
|
||||
<label>位置 <output data-testid="object-location">{activeNode ? activeNode.transform.translation.map(value => value.toFixed(3)).join(", ") : "--"}</output></label>
|
||||
@@ -3631,7 +3656,7 @@ function Properties({ selectedEdgeIndices, nonMeshGeometryBuffers, client, snaps
|
||||
{activeMesh && activeNode ? <div className="property-section" data-testid="paint-editor"><h3>Paint</h3><label>Vertex color <input aria-label="Paint vertex color" type="color" value={paintColor} onChange={(event) => setPaintColor(event.target.value)} /></label><label>Vertex group <input aria-label="Paint vertex group" value={paintGroup} onChange={(event) => setPaintGroup(event.target.value)} /></label><label>Weight <input aria-label="Paint vertex weight" type="range" min="0" max="1" step="0.01" value={paintWeight} onChange={(event) => setPaintWeight(Number(event.target.value))} /><output>{paintWeight.toFixed(2)}</output></label><label>Selection mask <input aria-label="Paint selection mask" type="range" min="0" max="1" step="0.01" value={paintSelectionMask} onChange={(event) => setPaintSelectionMask(Number(event.target.value))} /><output>{paintSelectionMask.toFixed(2)}</output></label><label>Normalize weights <input aria-label="Paint normalize weights" type="checkbox" checked={paintNormalize} onChange={(event) => setPaintNormalize(event.target.checked)} /></label><label>Limit influences <select aria-label="Paint influence limit" value={paintLimit} onChange={(event) => setPaintLimit(Number(event.target.value))}>{[1, 2, 3, 4, 8].map((limit) => <option key={limit} value={limit}>{limit}</option>)}</select></label><label>Mirror X/Y/Z <input aria-label="Paint mirror weights" type="checkbox" checked={paintMirror} onChange={(event) => setPaintMirror(event.target.checked)} /></label>{paintMirror ? <label>Mirror axis <select aria-label="Paint mirror axis" value={paintMirrorAxis} onChange={(event) => setPaintMirrorAxis(Number(event.target.value) as 0 | 1 | 2)}><option value={0}>X</option><option value={1}>Y</option><option value={2}>Z</option></select></label> : null}<div className="property-actions"><button type="button" disabled={selectedVertexIndices.length === 0} onClick={() => { const rgb = [1, 3, 5].map((offset) => Number.parseInt(paintColor.slice(offset, offset + 2), 16) / 255) as [number, number, number]; onCommand({ type: "setVertexColors", meshId: activeMesh.id, attributeName: "WebPaintColor", domain: "POINT", indices: selectedVertexIndices, colors: selectedVertexIndices.flatMap(() => [...rgb, 1]) }); }}>Apply Color</button><button type="button" disabled={selectedVertexIndices.length === 0 || !paintGroup} onClick={() => onCommand({ type: "setVertexWeights", objectId: activeNode.id, vertexGroup: paintGroup, indices: selectedVertexIndices, values: selectedVertexIndices.map(() => paintWeight), normalize: paintNormalize, limit: paintLimit, mirror: paintMirror, ...(paintMirror ? { mirrorAxis: paintMirrorAxis, mirrorTolerance: 1e-4 } : {}) })}>Apply Weight</button><button type="button" disabled={selectedVertexIndices.length === 0 || paintSelectionMask <= 0} onClick={blendPaintColor}>Blend Color</button><button type="button" disabled={selectedVertexIndices.length === 0 || !paintGroup || paintSelectionMask <= 0} onClick={blendPaintWeight}>Blend Weight</button></div><output>{selectedVertexIndices.length} selected vertices</output><output data-testid="paint-color-attribute">{activeMesh.attributes?.some((attribute) => attribute.name === "WebPaintColor" && attribute.domain === "POINT") ? "WebPaintColor POINT" : "No WebPaintColor"}</output><output data-testid="paint-vertex-group">{activeMesh.vertexGroups?.some((group) => group.name === paintGroup) ? paintGroup : "No paint group"}</output></div> : null}
|
||||
{activeMesh ? <div className="property-section" data-testid="sculpt-editor" data-command="sculptStroke,setSculptMeshAttributes,invokeBlenderOperator"><h3>Sculpt</h3><label>Brush <select aria-label="Sculpt brush" value={sculptBrush} onChange={(event) => setSculptBrush(event.target.value as SculptBrush)}><option value="DRAW">Draw</option><option value="INFLATE">Inflate</option><option value="GRAB">Grab</option><option value="SMOOTH">Smooth</option></select></label><label>Radius <input aria-label="Sculpt radius" type="number" min="0.001" step="0.01" value={sculptRadius} onChange={(event) => setSculptRadius(Math.max(0.001, Number(event.target.value) || 0.001))} /></label><label>Strength <input aria-label="Sculpt strength" type="range" min="-1" max="1" step="0.01" value={sculptStrength} onChange={(event) => setSculptStrength(Number(event.target.value))} /><output>{sculptStrength.toFixed(2)}</output></label><label>Pressure <input aria-label="Sculpt pressure" type="range" min="0" max="1" step="0.01" value={sculptPressure} onChange={(event) => setSculptPressure(Number(event.target.value))} /><output>{sculptPressure.toFixed(2)}</output></label><label>Symmetry X/Y/Z <span className="property-actions">{([0, 1, 2] as const).map((axis) => <label key={axis}><input aria-label={`Sculpt symmetry ${axis === 0 ? "X" : axis === 1 ? "Y" : "Z"}`} type="checkbox" checked={sculptSymmetry[axis]} onChange={(event) => setSculptSymmetry((current) => current.map((value, index) => index === axis ? event.target.checked : value) as [boolean, boolean, boolean])} />{axis === 0 ? "X" : axis === 1 ? "Y" : "Z"}</label>)}</span></label><label>Mirror object space <input aria-label="Sculpt mirror object space" type="checkbox" checked={sculptMirrorObjectSpace} onChange={(event) => setSculptMirrorObjectSpace(event.target.checked)} /></label><div className="property-actions"><button type="button" onClick={applySculptStroke}>Apply Sculpt Stroke ({sculptCursorSamples.length || 3} samples)</button></div><label>Mask <input aria-label="Sculpt mask" type="range" min="0" max="1" step="0.01" value={sculptMaskValue} onChange={(event) => setSculptMaskValue(Number(event.target.value))} /><output>{sculptMaskValue.toFixed(2)}</output></label><label>Active face set <input aria-label="Sculpt active face set" type="number" min="0" step="1" value={sculptActiveFaceSet} onChange={(event) => setSculptActiveFaceSet(Math.max(0, Math.floor(Number(event.target.value) || 0)))} /></label><div className="property-actions"><button type="button" disabled={activeMesh.vertexCount <= 0} onClick={applySculptMeshAttributes}>Apply Sculpt Attributes</button></div><label>Remesh voxel size <input aria-label="Sculpt remesh voxel size" type="number" min="0.001" step="0.001" value={sculptRemeshVoxelSize} onChange={(event) => setSculptRemeshVoxelSize(Math.max(0.001, Number(event.target.value) || 0.001))} /></label><div className="property-actions"><button type="button" disabled={!client || sculptRemeshBusy} onClick={() => { void applySculptRemesh(); }}>Voxel Remesh</button>
|
||||
{sculptRemeshError && <p role="alert">{sculptRemeshError}</p>}</div><output>{activeMesh.vertexCount} vertices · {(activeMesh as typeof activeMesh & { faceCount?: number }).faceCount ?? 0} faces</output></div> : null}
|
||||
{activeMesh ? <div className="property-section">
|
||||
{activeMesh ? <div className="property-section" data-testid="material-slots-section">
|
||||
<h3>Material Slots</h3>
|
||||
<div className="material-slots">{activeMesh.materialSlotIds?.map((id, index) => { const material = snapshot?.materials.find((item) => item.id === id); return <span key={`${id}:${index}`}><input type="radio" name="active-material-slot" aria-label={`激活材质槽 ${index + 1}`} checked={index === activeMaterialSlot} onChange={() => onActiveMaterialSlotChange(index)} />{index + 1}. <select aria-label={`材质槽 ${index + 1}`} value={id} disabled={materialSlotsReadOnly || !activeNode} onChange={(event) => activeNode && onCommand({ type: "assignMaterialSlot", objectId: activeNode.id, materialId: event.target.value, slotIndex: index })}>{snapshot?.materials.map((candidate) => <option key={candidate.id} value={candidate.id}>{candidate.name}</option>)}</select>{material?.sourceLibrary ? ` · ${material.sourceLibrary}` : ""}</span>; })}</div>
|
||||
{materialSlotsReadOnly ? <p role="status">链接对象或网格的材质槽只读。</p> : null}
|
||||
@@ -4104,12 +4129,15 @@ export function App({localOnly=false,course}:{localOnly?:boolean;course?:Availab
|
||||
const [areaLayouts,setAreaLayouts]=useState<Record<string,AreaIR[]>>({});
|
||||
const settingsRef = useRef<WebSettingsFile>(initialWebSettings ?? { schemaVersion: WEB_PREFERENCES_SCHEMA_VERSION, updatedAt: new Date().toISOString(), preferences: structuredClone(DEFAULT_WEB_PREFERENCES), areaLayouts: {}, areaEditorOverrides: {}, cameraLocks: {} });
|
||||
const settingsLoadedRef = useRef(false);
|
||||
const [settingsHydrated, setSettingsHydrated] = useState(false);
|
||||
const startupWorkspaceAppliedRef = useRef(false);
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
void loadWebSettings().then(({ settings }) => {
|
||||
if (cancelled) return;
|
||||
settingsRef.current = settings;
|
||||
settingsLoadedRef.current = true;
|
||||
setSettingsHydrated(true);
|
||||
setWebPreferences(settings.preferences);
|
||||
setQuickTools(settings.preferences.interface.quickTools);
|
||||
setShowStatus(settings.preferences.interface.showStatus);
|
||||
@@ -4380,6 +4408,15 @@ export function App({localOnly=false,course}:{localOnly?:boolean;course?:Availab
|
||||
}
|
||||
setUIState((state) => reduceUICommand(state, command));
|
||||
};
|
||||
useEffect(() => {
|
||||
if (startupWorkspaceAppliedRef.current || !settingsHydrated || !settingsLoadedRef.current || !snapshot) return;
|
||||
startupWorkspaceAppliedRef.current = true;
|
||||
const parameters = new URLSearchParams(window.location.search);
|
||||
if (parameters.get("tutorial") || parameters.get("workspace")) return;
|
||||
const target = webPreferences.interface.startupWorkspace as WorkspaceId;
|
||||
if (!BLENDER_WORKSPACE_IDS.includes(target)) return;
|
||||
if (uiState.context.workspaceId !== target) dispatchUI({ type: "switchWorkspace", workspaceId: target });
|
||||
}, [snapshot, settingsHydrated, webPreferences.interface.startupWorkspace, uiState.context.workspaceId, dispatchUI]);
|
||||
useEffect(() => {
|
||||
if (!snapshot?.editorWorkflow || snapshot.editorWorkflowStatus !== "AVAILABLE") {
|
||||
setEditorWorkflow(null);
|
||||
@@ -8034,7 +8071,7 @@ else:
|
||||
menuAction('完整桌面工作区',()=>{void openFullDesktop();},!hasProject),separator,menuAction('下一个工作区',()=>cycleWorkspace(1)),menuAction('上一个工作区',()=>cycleWorkspace(-1)),{label:'编辑器',children:NATIVE_EDITORS.map(item=>menuAction(item.label,()=>openNativeEditor(item.id),!hasProject))},{label:'显示状态栏',checked:showStatus,action:()=>setShowStatus(!showStatus)},separator,
|
||||
menuAction('保存视口截图',()=>{const canvas=document.querySelector<HTMLCanvasElement>('canvas.viewport-canvas');if(!canvas)return;canvas.toBlob(blob=>{if(!blob)return;const url=URL.createObjectURL(blob),link=document.createElement('a');link.href=url;link.download='viewport.png';link.click();setTimeout(()=>URL.revokeObjectURL(url),1000);});},workspace==='Rendering'||new URLSearchParams(location.search).get('offscreen')==='1'),
|
||||
{label:'Web 扩展',children:[menuAction('六轴机器人工具',()=>setRobotToolOpen(true)),menuAction('原生桌面会话',()=>setInteractiveDesktop({context:nativeContext()}),!hasProject),{label:'显示快捷操作栏',checked:quickTools,action:()=>setQuickTools(!quickTools)}]}],
|
||||
'帮助':[menuAction('使用手册',()=>{window.open('/manuals/WEB_Blender_Function_User_Guide.pdf','_blank','noopener');}),menuAction('菜单操作对照',()=>{window.open('/manuals/WEB_Blender_Desktop_Menus.pdf','_blank','noopener');}),menuAction('导航操作说明',()=>{window.open('/manuals/WEB_Blender_Viewport_Navigation.pdf','_blank','noopener');}),menuAction('机器人工具说明',()=>{window.open('/manuals/WEB_Blender_Robot_Tool_User_Manual.pdf','_blank','noopener');}),menuAction('零件建模教学',()=>{window.open('/?tutorial=parts','_blank','noopener');}),menuAction('二级减速器教学',()=>{window.open('/?tutorial=reducer','_blank','noopener');}),menuAction('PBR 渲染教学',()=>{window.open('/?ui=web&tutorial=pbr','_blank','noopener');}),menuAction('PBR 渲染图文/视频教案',()=>{window.open('/tutorial/pbr/render-lesson.html','_blank','noopener');}),separator,
|
||||
'帮助':[menuAction('使用手册(网页版)',()=>{window.open('/manuals/index.html','_blank','noopener');}),menuAction('PDF 手册(旧版下载)',()=>{window.open('/manuals/WEB_Blender_Function_User_Guide.pdf','_blank','noopener');}),menuAction('菜单操作对照',()=>{window.open('/manuals/WEB_Blender_Desktop_Menus.pdf','_blank','noopener');}),menuAction('导航操作说明',()=>{window.open('/manuals/WEB_Blender_Viewport_Navigation.pdf','_blank','noopener');}),menuAction('机器人工具说明',()=>{window.open('/manuals/WEB_Blender_Robot_Tool_User_Manual.pdf','_blank','noopener');}),menuAction('零件建模教学',()=>{window.open('/?tutorial=parts','_blank','noopener');}),menuAction('二级减速器教学',()=>{window.open('/?tutorial=reducer','_blank','noopener');}),menuAction('PBR 渲染教学',()=>{window.open('/?ui=web&tutorial=pbr','_blank','noopener');}),menuAction('PBR 渲染图文/视频教案',()=>{window.open('/tutorial/pbr/render-lesson.html','_blank','noopener');}),separator,
|
||||
menuAction('导出诊断报告',exportDiagnosticReport,diagnostics.length===0),menuAction('关于 Web Blender',()=>setHeaderDialog('about'))]
|
||||
};
|
||||
const primitiveItems:DesktopMenuItem[]=([['CUBE','立方体'],['PLANE','平面'],['UV_SPHERE','UV 球体'],['ICO_SPHERE','棱角球'],['CYLINDER','柱体'],['CONE','锥体'],['TORUS','环体']] as [MeshPrimitive,string][]).map(([type,label])=>menuAction(label,()=>{void applyEditCommand(coreSceneCommands.createPrimitive(type));},!hasProject||uiState.context.mode!=='Object'));
|
||||
@@ -8695,7 +8732,7 @@ else:
|
||||
{headerDialog?<DesktopDialog title={{new:'新建工程','save-as':'另存为','save-copy':'保存副本',rename:'重命名',about:'关于 Web Blender',preferences:'偏好设置',history:'撤销历史',export:'导出模型','obj-import':'导入 OBJ 与材质'}[headerDialog]} onClose={()=>{if(!headerPending)setHeaderDialog(null);}}>
|
||||
{headerDialog==='obj-import'?<OBJImportPanel initialFile={objImportFile} disabled={headerBusy || projectActionLocked || Boolean(localInvokePending) || localInvokeActive || nativeModalActive} onPrepare={prepareOBJImport}/>:null}
|
||||
{headerDialog==='save-copy'&&<p>下载当前工程的副本,并继续编辑当前项目;未保存标记将保留。</p>}
|
||||
{headerDialog==='save-as'&&<p>另存为会保留原项目,创建并切换到新的浏览器项目,同时下载 .blend 文件。后续保存使用新项目和文件名。</p>}
|
||||
{headerDialog==='save-as'&&<p>另存为会保留原项目,创建并切换到新的浏览器 OPFS 项目,不会自动下载文件。后续保存使用新项目和文件名;需要本地副本时请使用“文件 → 下载 .blend 到本地”。</p>}
|
||||
{headerDialog==='export'?<NativeExportPanel key={exportFormat} initialFormat={exportFormat} client={webClientRef.current} snapshot={snapshot} busy={nativeBusy} output={nativeOutput} files={nativeFiles} onRun={runNativeWorkflow} onCancel={()=>nativeAbortRef.current?.abort()}/>:null}
|
||||
{headerDialog==='history'&&historyView&&!historyView.sourceHash?<button type="button" disabled={headerBusy||historyView.history.cursor<=0} onClick={()=>{setHeaderDialog(null);void applyEditCommand({type:'undo'});}}>撤销上一步(恢复)</button>:null}
|
||||
{headerDialog==='history'?<><div className="desktop-history-list" aria-busy={headerPending}>{historyView?.history.entries.map(entry=><button key={entry.index} aria-current={entry.index===historyView.history.cursor?'step':undefined} disabled={headerPending||Boolean(historyError)||!historyView.sourceHash||entry.index===historyView.history.cursor} onClick={()=>void jumpHistory(entry.index)}><span>{entry.index+1}. {entry.label}</span>{entry.index===historyView.history.cursor?<strong>当前</strong>:null}</button>)}</div>{(historyError||!historyView||!historyView.sourceHash)?<button disabled={headerPending} onClick={()=>void openHistory()}>重新读取历史</button>:null}{headerPending?<output>正在读取工程历史…</output>:null}{historyError?<output role="alert">{historyError}</output>:null}</>:null}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.desktop-menu-trigger{display:inline-flex;flex:none;position:relative}.desktop-menu-trigger>button{min-height:24px;padding:3px 7px;background:transparent;color:#d3d3d3;white-space:nowrap;border-radius:2px}.desktop-menu-trigger>button[aria-expanded=true]{background:#454545}.desktop-menu-panel{position:fixed;z-index:1500;width:280px;max-width:calc(100vw - 8px);padding:5px;background:#282b2a;color:#e0e3e1;border:1px solid #656b67;box-shadow:0 7px 20px #0007;border-radius:4px;overflow:auto}.desktop-menu-panel>button{display:flex;position:relative;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:7px;width:100%;min-height:28px;text-align:left;padding:5px 9px;color:inherit;background:transparent;border:0;border-radius:2px;font-size:12px}.desktop-menu-panel>button:hover:enabled,.desktop-menu-panel>button:focus-visible{background:#44644f;color:white;outline:1px solid #bdd7c4}.desktop-menu-panel>button:disabled{color:#949c96;cursor:default}.desktop-menu-panel small{display:block;flex-basis:100%;font-size:10px;color:#a7b1a9;white-space:normal;line-height:1.4}.desktop-menu-shortcut{color:#b2beb5;font-size:10px}.desktop-menu-panel [role=separator]{height:1px;background:#49514b;margin:5px 3px}.desktop-menu-back{border-bottom:1px solid #657268!important;margin-bottom:4px}.desktop-header-menus{display:flex;align-items:center;min-width:0;gap:1px}.desktop-selection-controls{display:flex;align-items:center;gap:3px;margin-left:8px}.desktop-header-label{color:#cbd4ce;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:11px}.desktop-dialog-backdrop{position:fixed;inset:0;z-index:1600;background:#0006;display:flex;align-items:center;justify-content:center;padding:14px}.desktop-dialog{background:#292d2a;border:1px solid #87948b;border-radius:5px;width:440px;max-width:100%;max-height:90vh;overflow:auto;padding:14px;color:#e3e8e4}.desktop-dialog header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.desktop-dialog h2{font-size:16px;margin:0}.desktop-dialog button{padding:6px 11px;color:inherit;background:#49534c;border:1px solid #7c8b81;border-radius:3px}.desktop-dialog header button{padding:2px;width:27px;height:27px}.desktop-dialog input:not([type=checkbox]){width:100%;padding:7px;background:#1e211f;border:1px solid #6d7c72;color:inherit}.desktop-dialog p{font-size:12px;line-height:1.7}.desktop-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:15px}.desktop-dialog label{display:flex;gap:8px;align-items:center;margin:12px 0}.workspace-toolbar{overflow:visible}.desktop-header-actions{display:flex;min-width:0;align-items:center;overflow-x:auto;scrollbar-width:none}.legacy-quick-toolbar{display:none}.blender-app:not([data-native-canvas=true]) .legacy-quick-toolbar,.blender-app[data-quick-tools=true] .legacy-quick-toolbar{display:flex;position:absolute;top:58px;left:0;right:0;z-index:10;background:#303532;overflow-x:auto;gap:4px;padding:4px}.legacy-quick-toolbar>button{white-space:nowrap;min-height:27px;padding:3px 7px;background:#414942}.blender-app[data-hide-status=true] .status-bar{display:none}.blender-app[data-hide-status=true]{grid-template-rows:28px 30px minmax(0,1fr) 0}.workspace-menu-control{flex:none}.workspace-tabs{min-width:90px}.workspace-tabs .workspace-menu-control{position:sticky;right:0;background:#222}.viewport-header-status{margin-left:auto;display:flex;align-items:center;gap:12px;font-size:11px;white-space:nowrap;padding-right:8px}.topbar-actions .extension-robot{color:#bbd4c3}
|
||||
.desktop-menu-trigger{display:inline-flex;flex:none;position:relative}.desktop-menu-trigger>button{min-height:24px;padding:3px 7px;background:transparent;color:#d3d3d3;white-space:nowrap;border-radius:2px}.desktop-menu-trigger>button[aria-expanded=true]{background:#454545}.desktop-menu-panel{position:fixed;z-index:1500;width:280px;max-width:calc(100vw - 8px);padding:5px;background:#282b2a;color:#e0e3e1;border:1px solid #656b67;box-shadow:0 7px 20px #0007;border-radius:4px;overflow:auto}.desktop-menu-panel>button{display:flex;position:relative;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:7px;width:100%;min-height:28px;text-align:left;padding:5px 9px;color:inherit;background:transparent;border:0;border-radius:2px;font-size:12px}.desktop-menu-panel>button:hover:enabled,.desktop-menu-panel>button:focus-visible{background:#44644f;color:white;outline:1px solid #bdd7c4}.desktop-menu-panel>button:disabled{color:#949c96;cursor:default}.desktop-menu-panel small{display:block;flex-basis:100%;font-size:10px;color:#a7b1a9;white-space:normal;line-height:1.4}.desktop-menu-shortcut{color:#b2beb5;font-size:10px}.desktop-menu-panel [role=separator]{height:1px;background:#49514b;margin:5px 3px}.desktop-menu-back{border-bottom:1px solid #657268!important;margin-bottom:4px}.desktop-header-menus{display:flex;align-items:center;min-width:0;gap:1px}.desktop-selection-controls{display:flex;align-items:center;gap:3px;margin-left:8px}.desktop-header-label{color:#cbd4ce;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:11px}.desktop-dialog-backdrop{position:fixed;inset:0;z-index:1600;background:#0006;display:flex;align-items:center;justify-content:center;padding:14px}.desktop-dialog{background:#292d2a;border:1px solid #87948b;border-radius:5px;width:440px;max-width:100%;max-height:90vh;overflow:auto;padding:14px;color:#e3e8e4}.desktop-dialog header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.desktop-dialog h2{font-size:16px;margin:0}.desktop-dialog button{padding:6px 11px;color:inherit;background:#49534c;border:1px solid #7c8b81;border-radius:3px}.desktop-dialog header button{padding:2px;width:27px;height:27px}.desktop-dialog input:not([type=checkbox]){width:100%;padding:7px;background:#1e211f;border:1px solid #6d7c72;color:inherit}.desktop-dialog p{font-size:12px;line-height:1.7}.desktop-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:15px}.desktop-dialog label{display:flex;gap:8px;align-items:center;margin:12px 0}.workspace-toolbar{overflow:visible}.desktop-header-actions{display:flex;min-width:0;align-items:center;overflow-x:auto;scrollbar-width:none}.legacy-quick-toolbar{display:none}.blender-app[data-quick-tools=true] .legacy-quick-toolbar{display:flex;position:absolute;top:58px;left:0;right:0;z-index:10;background:#303532;overflow-x:auto;gap:4px;padding:4px}.legacy-quick-toolbar>button{white-space:nowrap;min-height:27px;padding:3px 7px;background:#414942}.blender-app[data-hide-status=true] .status-bar{display:none}.blender-app[data-hide-status=true]{grid-template-rows:28px 30px minmax(0,1fr) 0}.workspace-menu-control{flex:none}.workspace-tabs{min-width:90px}.workspace-tabs .workspace-menu-control{position:sticky;right:0;background:#222}.viewport-header-status{margin-left:auto;display:flex;align-items:center;gap:12px;font-size:11px;white-space:nowrap;padding-right:8px}.topbar-actions .extension-robot{color:#bbd4c3}
|
||||
@media(max-width:700px){.desktop-header-label{display:none}.viewport-header-status{gap:3px;font-size:10px}.desktop-selection-controls{margin-left:0}.desktop-header-menus{max-width:100%;overflow-x:auto;scrollbar-width:none}}
|
||||
@media(max-width:900px){.topbar .menu-bar{display:flex}.topbar .menu-bar button{padding-inline:5px}.topbar-actions>select,.topbar-actions>.topbar-context,.topbar-actions>.extension-robot{display:none}.workspace-tabs .workspace-tab:nth-child(n+4){display:initial}.workspace-tabs .workspace-tab{flex:none}.workspace-tabs{min-width:40px}.workspace-menu-control>button{font-size:0;width:26px;padding:3px}.workspace-menu-control>button::after{content:'▾';font-size:14px}}
|
||||
@media(max-width:550px){.topbar-actions{display:none}.workspace-tabs{min-width:48px}.brand{padding:0}.topbar .menu-bar button{padding-inline:4px;font-size:11px}}
|
||||
|
||||
@@ -38,7 +38,7 @@ export function TutorialLanding({ course }: { course: TutorialCourse }) {
|
||||
return <main className="parts-tutorial-landing" data-course={course.id}>
|
||||
<header className="parts-landing-top">
|
||||
<a className="parts-landing-brand" href="/" aria-label="返回 Web Blender"><span className="brand-mark" aria-hidden="true"><span className="brand-orbit" /></span><span>Blender Web</span></a>
|
||||
<nav aria-label="教程导航"><a href="/manuals/WEB_Blender_Function_User_Guide.pdf" target="_blank" rel="noopener">使用手册</a><a href="/tutorial/full/index.html" target="_blank" rel="noopener">全站入门课程</a>{course.lessonUrl ? <a href={course.lessonUrl} target="_blank" rel="noopener">渲染图文/视频教案</a> : null}<a href="/" className="parts-landing-return">直接打开 Blender</a></nav>
|
||||
<nav aria-label="教程导航"><a href="/manuals/index.html" target="_blank" rel="noopener">使用手册</a><a href="/manuals/WEB_Blender_Function_User_Guide.pdf" target="_blank" rel="noopener">PDF 版</a><a href="/tutorial/full/index.html" target="_blank" rel="noopener">全站入门课程</a>{course.lessonUrl ? <a href={course.lessonUrl} target="_blank" rel="noopener">渲染图文/视频教案</a> : null}<a href="/" className="parts-landing-return">直接打开 Blender</a></nav>
|
||||
</header>
|
||||
<section className="parts-landing-hero">
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user