threepipe
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

plugin-tweakpane.md 1.5KB

1 год назад
1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ---
  2. prev: false
  3. next:
  4. text: '@threepipe/plugin-blueprintjs'
  5. link: './plugin-blueprintjs'
  6. ---
  7. # @threepipe/plugin-tweakpane
  8. [Tweakpane](https://tweakpane.github.io/docs/) UI plugin for ThreePipe
  9. [//]: # (todo: image)
  10. [Example](https://threepipe.org/examples/#tweakpane-ui-plugin/) —
  11. [Source Code](https://github.com/repalash/threepipe/blob/master/plugins/tweakpane/src/TweakpaneUiPlugin.ts) —
  12. [API Reference](https://threepipe.org/plugins/tweakpane/docs/classes/TweakpaneUiPlugin.html)
  13. [![NPM Package](https://img.shields.io/npm/v/@threepipe/plugin-tweakpane.svg)](https://www.npmjs.com/package/@threepipe/plugin-tweakpane)
  14. ```bash
  15. npm install @threepipe/plugin-tweakpane
  16. ```
  17. TweakpaneUiPlugin adds support for using [uiconfig-tweakpane](https://github.com/repalash/uiconfig-tweakpane)
  18. to create a configuration UI in applications using the [Tweakpane](https://tweakpane.github.io/docs/) library.
  19. The plugin takes the [uiconfig](https://github.com/repalash/uiconfig.js)
  20. that's defined in the viewer and all the objects to automatically render a UI in the browser.
  21. ```typescript
  22. import {IObject3D, ThreeViewer, TonemapPlugin} from 'threepipe'
  23. import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'
  24. const viewer = new ThreeViewer({...})
  25. // Add the plugin
  26. const plugin = viewer.addPluginSync(new TweakpaneUiPlugin(true)) // true to show expanded the UI by default
  27. // Add the UI for the viewer
  28. plugin.appendChild(viewer.uiConfig)
  29. // Add UI for some plugins
  30. plugin.setupPlugins(TonemapPlugin, DropzonePlugin)
  31. ```