threepipe
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

plugin-blend-importer.md 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ---
  2. prev:
  3. text: '@threepipe/plugin-network'
  4. link: './plugin-network'
  5. next:
  6. text: '@threepipe/plugin-gaussian-splatting'
  7. link: './plugin-gaussian-splatting'
  8. ---
  9. # @threepipe/plugin-blend-importer
  10. Exports [BlendImporterPlugin](https://threepipe.org/plugins/blend-importer/docs/classes/BlendLoadPlugin.html) which adds support for loading .blend files.
  11. It uses [`js.blend`](https://github.com/acweathersby/js.blend) for parsing blend file structure.
  12. ::: warning Note
  13. This is still a WIP.
  14. :::
  15. Currently working: `Mesh`, `BufferGeometry` and basic `PointLight`.
  16. To be added: `PhysicalMaterial`, `UnlitMaterial` (similar to blender-gltf-io plugin)
  17. [Example](https://threepipe.org/examples/#blend-load/) —
  18. [Source Code](https://github.com/repalash/threepipe/blob/master/plugins/blend-importer/src/index.ts) —
  19. [API Reference](https://threepipe.org/plugins/blend-importer/docs)
  20. [![NPM Package](https://img.shields.io/npm/v/@threepipe/plugin-blend-importer.svg)](https://www.npmjs.com/package/@threepipe/plugin-blend-importer)
  21. ```bash
  22. npm install @threepipe/plugin-blend-importer
  23. ```
  24. ```typescript
  25. import {ThreeViewer} from 'threepipe'
  26. import {BlendLoadPlugin} from '@threepipe/plugin-blend-importer'
  27. const viewer = new ThreeViewer({...})
  28. viewer.addPluginSync(BlendLoadPlugin)
  29. // Now load any .blend file.
  30. const model = await viewer.load<IObject3D>('path/to/file.blend')
  31. // To load the file as a data url, use the correct mimetype
  32. const model1 = await viewer.load<IObject3D>('data:application/x-blender;base64,...')
  33. ```
  34. [//]: # ( TODO: The plugin should parse and references to other assets and find them relative to the .blend file or the current location.)