@buoy-gg/three

中文文档
7.0.87发布于 2026/11/07TypeScriptESM + CJS近 30 天下载 3972

See and edit a three.js scene.

原始使用文档
文档目录4 节
  1. title: Scene (Beta) description: See and edit a three.js sc…
  2. Set it up
  3. Counts and loads
  4. Scene edits

title: Scene (Beta) description: See and edit a three.js scene.

Scene (Beta)

See the tree of objects in your 3D app. Pick a node to draw a box around it. Hide it, move it, turn it, or change its size. You can change a mesh's color too.

Set it up

Three.js support is in Beta. Use the beta tag once it ships. Keep all Buoy packages on the same beta release. Install @buoy-gg/three@beta with three in your web app. Add its module to Buoy's modules map.

import * as threeTools from '@buoy-gg/three/web';
import * as perfMonitor from '@buoy-gg/perf-monitor/web';
import * as assets from '@buoy-gg/assets/web';
import * as events from '@buoy-gg/events/web';
import { registerThree } from '@buoy-gg/three/web';

const modules = { three: threeTools, 'perf-monitor': perfMonitor, assets, events };
// Add these modules to your FloatingDevTools or mountBuoy options.
const stop = registerThree({ renderer, scene, camera, loadingManager });
// Call stop() when the scene is replaced or torn down.

Call stop() on hot reload too. Each renderer has its own group. In R3F, call this in an effect with useThree(). Pass gl as renderer. Return stop from the effect.

The early boot hook can find scenes and renderers. It cannot tell which ones belong together. Use registerThree to link them. Load @buoy-gg/core/web/register before three.js, as shown in the web guide.

Counts and loads

Perf Monitor shows counts after the app renders. WebGL and WebGPU have different fields. A field with no data shows as unknown. Counts are objects, not bytes. A count that keeps rising says "Keeps growing". A cache can cause this too.

Buoy does not reset counts or change autoReset. With many render passes, counts follow your reset rules. With no new render, the last counts stay on screen.

Assets and Events show file loads. Buoy watches DefaultLoadingManager. Pass a custom manager to registerThree to watch it too. Size and time come from the browser's resource timing. If that data is absent, they stay unknown. Cache hits show when the cache or browser proves a hit.

Scene edits

Each tree has at most 500 nodes. Long names are cut short. The panel tells you when it hits the node limit. Turn values use radians. Enter three numbers for a move, turn, or size. Colors use six digit hex, such as #ff8800.

Each field needs a value. Live changes keep your draft until you press Save.

A box marks the picked node's bounds at the time you pick it. Clear it with "Clear box". App code may overwrite an edit on its next frame.

Desktop uses this same panel. MCP has get_three_scene, get_three_stats, and three_action. MCP needs a paid account. Read the scene first to get IDs for edits.

Workers and WebXR are not supported. For full screen, use a wrapper around the canvas. A bare canvas cannot show Buoy's DOM panel.

版本与发布记录

@buoy-gg/three 共发布 25 个版本,首次发布于 2026/10/09;过去 12 个月发布了 25 个版本。

版本发布日期距今
7.0.87latest2026/11/071 天前
7.0.862026/11/062 天前
7.0.852026/11/053 天前
7.0.842026/11/035 天前
7.0.832026/11/035 天前
7.0.822026/11/036 天前

关于 @buoy-gg/three 的常见问题

@buoy-gg/three 是什么?

See and edit a three.js scene.

如何安装 @buoy-gg/three?

在项目目录运行 npm install @buoy-gg/three,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(*)、three(>=0.170.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@buoy-gg/three 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@buoy-gg/three 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@buoy-gg/three 可以商用吗?

@buoy-gg/three 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@buoy-gg/three 的下载量有多少?

根据 npm 官方下载统计,@buoy-gg/three 在 2026/10/09 – 2026/11/07 这 30 天内被下载 3,972 次,日均约 132 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@buoy-gg/three 还在维护吗?

最新版本 7.0.87 发布于 2026/11/07(1 天前);至今共发布 25 个版本,其中过去 12 个月发布了 25 个;首次发布于 2026/10/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。