Class MaterialConfiguratorBasePlugin

Material Configurator Plugin (Base)

This plugin allows you to create variations of materials mapped to material names or uuids in the scene. These variations can be applied to the materials in the scene. (This copies the properties to the same material instances instead of assigning new materials) The plugin interfaces with the picking plugin and also provides uiConfig to show and edit the variations.

See MaterialConfiguratorPlugin in plugin-configurator for example on inheriting with a custom UI renderer.

Hierarchy (view full)

Constructors

Properties

_dirty: boolean = false
_picking: undefined | PickingPlugin
_previewGenerator: undefined | MaterialPreviewGenerator
_uiNeedRefresh: boolean = false
_viewer?: ThreeViewer
_viewerListeners: PartialRecord<"update" | "dispose" | "preRender" | "postRender" | "preFrame" | "postFrame" | "*" | "addPlugin" | "removePlugin" | "renderEnabled" | "renderDisabled", ((e) => void)> = {}

Type declaration

applyOnLoad: boolean = true

Apply all variations(by selected index or first item) when a config is loaded

constructor: typeof AViewerPluginSync & typeof AViewerPlugin
enabled: boolean = true
uiConfig: UiObjectConfig<any, string, any> = ...
variations: MaterialVariations[] = []
OldPluginType?: string
PluginType: string = 'MaterialConfiguratorPlugin'

Accessors

Methods

  • Get the preview for a material variation Should be called from preFrame ideally. (or preRender but set viewerSetDirty = false)

    Parameters

    • material: IMaterial<IMaterialEvent<IMaterialEventTypes>, IMaterialEventTypes>

      Material or index of the material in the variation.

    • preview: string

      Type of preview. Could be generate:sphere, generate:cube, color, map, emissive, etc.

    • viewerSetDirty: boolean = true

      call viewer.setDirty() after setting the preview. So that the preview is cleared from the canvas.

    Returns string

Generated using TypeDoc