The 3D add-on adds 3D models (.glb) to the media library of core. It works with every backend.
What it adds
- Upload: the media library takes
.glbfiles, up to 25 MB each. - A preview image: at upload, the browser makes a still image of the model. A site shows it as the thumbnail, with no 3D code.
- The viewer:
Pluto3dViewershows the model in the admin and on your site. It turns with the mouse or a finger, and it can turn by itself. - A check: a model that links files it does not hold (for example outside textures) gets a warning at upload.
three.js loads only in the browser, and only on the pages that show a model.
Install
Install the package first, with the command at the top of this page. extends does not install it.
Then extend it:
nuxt.config.ts
export default defineNuxtConfig({
extends: ['@plutocms/supabase-shop', '@plutocms/3d']
})
Add it next to the backend layer of your app. It does not extend core itself, so core loads once.
ProductModel.vue
<template>
<Pluto3dViewer :media="model" auto-rotate />
</template>