@amaspace-editor/editor-3d
Amaspace 三维编辑器 SDK — 三维产品的反应+反应- 三纤维组件 视觉、定制和AR.
安装
npm i @amaspace-editor/editor-3d
要求数 反应 18 (同类依赖). SDK号飞船自有3.js/ @ react-3/fiber 8 sack 作为硬依赖性——主机在React 19/R3F 9上 无法与它共享反应树, 并且应该在单独的运行时间嵌入它 (参见龙卷风-定制器中的部件模式).
使用量
import { AMAMode, EditorConstructor } from '@amaspace-editor/editor-3d'
import '@amaspace-editor/editor-3d/dist/style.css'
<EditorConstructor
type="scene"
assetId={productId}
apiKey={AMASPACE_API_KEY}
presetConfig={{
mode: AMAMode.VIEWER,
applyProductRules: true,
grid: false,
startAnimation: false,
baseURL: AMASPACE_BASE_URL,
// Opt-in demand rendering (>=0.2.16): renders only when the scene
// changes instead of continuously.
frameloop: 'demand',
}}
/>
AMAMode.VIEWER 使只读配置符; AMAMode.EDITOR 启用
完全编辑 UI. 除了构造器外, 软件包还输出场景
库存(useSelectorsStore、.)、钩子、动作和功用——见 lib/editor-3d.ts
为整个地表.
发展
npm run build # vite build --config vite-config.js → dist/