mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-15 21:04:46 +01:00
feature (3d): handle mesh files
This commit is contained in:
parent
aed0f414c8
commit
73bab4a2e3
4 changed files with 28 additions and 0 deletions
|
|
@ -100,6 +100,7 @@
|
|||
"md": "text/markdown",
|
||||
"mdc": "image/x-minolta-mdc",
|
||||
"mef": "image/x-mamiya-mef",
|
||||
"mesh": "model/mesh",
|
||||
"mid": "audio/midi",
|
||||
"midi": "application/x-midi",
|
||||
"mjs": "application/javascript",
|
||||
|
|
|
|||
|
|
@ -4,3 +4,7 @@ all:
|
|||
install:
|
||||
zip -r application_3d.zip .
|
||||
mv application_3d.zip ../../../dist/data/state/plugins/application_3d.zip
|
||||
|
||||
deps_mesh:
|
||||
[ -d vendor ] || mkdir vendor
|
||||
curl https://gist.githubusercontent.com/mickael-kerjean/9a517f95112410fcacaad8563c1ba314/raw/ab483b38aebb7048832aad7b342f9161dd928e49/gistfile1.txt > vendor/MeshLoader.js
|
||||
|
|
|
|||
17
server/plugin/plg_application_3d/index_mesh.js
Normal file
17
server/plugin/plg_application_3d/index_mesh.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
export default async function(I3D, { THREE }) {
|
||||
const module = await import("./vendor/MeshLoader.js");
|
||||
|
||||
return class Impl extends I3D {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
load(url, onLoad, onProgress, onError) {
|
||||
return (new module.MeshLoader()).load(url, onLoad, onProgress, onError);
|
||||
}
|
||||
|
||||
transform(obj) {
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -37,6 +37,12 @@
|
|||
"mime": "model/step",
|
||||
"entrypoint": "/index_step.js",
|
||||
"application": "3d"
|
||||
},
|
||||
{
|
||||
"type": "xdg-open",
|
||||
"mime": "model/mesh",
|
||||
"entrypoint": "/index_mesh.js",
|
||||
"application": "3d"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue