소스 검색

Set isEditor for LoadingScreenPlugin and FrameFadePlugin in editor example

master
Palash Bansal 1 년 전
부모
커밋
4f074dbda1
No account linked to committer's email address
2개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 5
    0
      examples/tweakpane-editor/script.ts
  2. 2
    2
      plugins/configurator/src/SwitchNodePlugin.ts

+ 5
- 0
examples/tweakpane-editor/script.ts 파일 보기

@@ -148,6 +148,11 @@ async function init() {
viewer.getPlugin(MaterialConfiguratorPlugin)!.enableEditContextMenus = true
viewer.getPlugin(SwitchNodePlugin)!.enableEditContextMenus = true

// disable fading on update
viewer.getPlugin(LoadingScreenPlugin)!.isEditor = true
// disable fading on update
viewer.getPlugin(FrameFadePlugin)!.isEditor = true

const rt = viewer.getOrAddPluginSync(RenderTargetPreviewPlugin)
rt.addTarget({texture: viewer.getPlugin(GBufferPlugin)?.normalDepthTexture}, 'normalDepth')
rt.addTarget({texture: viewer.getPlugin(GBufferPlugin)?.flagsTexture}, 'gBufferFlags')

+ 2
- 2
plugins/configurator/src/SwitchNodePlugin.ts 파일 보기

@@ -8,10 +8,10 @@ import {GridItemListPlugin} from './GridItemListPlugin'
* This works by toggling the `visible` property of the children of a parent object.
* The plugin interfaces with the picking plugin and also provides uiConfig to show and edit the variations.
* It also provides a function to create snapshot previews of individual variations. This creates a limited render of the object with the selected child visible.
* To get a proper render, its better to render it offline and set the image as a preview.
* To get a proper render, it's better to render it offline and set the image as a preview.
* This functionality is inherited from `SwitchNodeBasePlugin`.
*
* Additionally this plugin adds a Grid UI using {@link GridItemListPlugin} in the DOM over the viewer canvas to show various object variations and allow the user to select them.
* Additionally, this plugin adds a Grid UI using {@link GridItemListPlugin} in the DOM over the viewer canvas to show various object variations and allow the user to select them.
* The UI can also be used in the editor to edit the variations and apply them.
*/
export class SwitchNodePlugin extends SwitchNodeBasePlugin {

Loading…
취소
저장