
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
unplugin-3d-object
Advanced tools
Import 3d objects with obj, mtl and textures whilte importing .obj file
Load whole 3d object while importing .obj files.
npm i unplugin-3d-object
# or
yarn add unplugin-3d-object
# or
pnpm i unplugin-3d-object
// vite.config.ts
import loader3dObject from 'unplugin-3d-object/vite'
export default defineConfig({
plugins: [
loader3dObject({ /* options */ }),
],
})
Example: playground/
// rollup.config.js
import loader3dObject from 'unplugin-3d-object/rollup'
export default {
plugins: [
loader3dObject({ /* options */ }),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-3d-object/webpack')({ /* options */ })
]
}
// nuxt.config.js
export default {
buildModules: [
['unplugin-3d-object/nuxt', { /* options */ }],
],
}
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-3d-object/webpack')({ /* options */ }),
],
},
}
Plugin load .obj, scan for mtl libs and trying to load them. From mtl plugin also trying to load textures. Plugin transform .obj files to OBJ
type.
import house from 'house/house.obj'
// ...
createObject(house.obj, house.mtl.toString(), house.mtl.paths)
import house from 'house/house.obj?three'
// ...
scene.add(house)
Example: playground
If .obj file require texture or mtl file that can not be found it will throw warning.
Make sure change absolute paths to relative in .obj and .mtl
You can turn off warnings by passing warnings: false
in plugin options if you don't care about missing assets.
FAQs
Import 3d objects with obj, mtl and textures whilte importing .obj file
The npm package unplugin-3d-object receives a total of 0 weekly downloads. As such, unplugin-3d-object popularity was classified as not popular.
We found that unplugin-3d-object demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.