Material Configurator Plugin (Basic UI) 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. This functionality is inherited from MaterialConfiguratorBasePlugin

Additionally this plugin adds a Grid UI using GridItemListPlugin in the DOM over the viewer canvas to show various material variations and allow the user to apply them. The UI can also be used in the editor to edit the variations and apply them.

Hierarchy

  • MaterialConfiguratorBasePlugin
    • MaterialConfiguratorPlugin

Constructors

Properties

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

Type declaration

    • (e): void
    • Parameters

      • e: IViewerEvent

      Returns void

applyOnLoad: boolean = true

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

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

Accessors

Methods

  • Parameters

    • e: IViewerEvent

    Returns IViewerEvent

  • Parameters

    • Optional prefix: string

    Returns string

  • Apply a material variation based on index or uuid.

    Parameters

    • variations: MaterialVariations
    • matUuidOrIndex: string | number

    Returns boolean

  • Returns ISerializedConfig | Record<string, never>

  • 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

  • Parameters

    • state: any

    Returns Promise<void>

  • Parameters

    • variation: MaterialVariations
    • uuid: string

    Returns {
        Remove: (() => Promise<void>);
    }

    • Remove: (() => Promise<void>)
        • (): Promise<void>
        • Returns Promise<void>

  • Parameters

    • Rest ...args: any[]

    Returns any

  • Parameters

    • Optional meta: SerializationMetaType

    Returns ISerializedConfig

  • Parameters

    • variation: MaterialVariations

    Returns {
        Clear Materials: (() => Promise<void>);
        Remove Section: (() => Promise<void>);
        Rename mapping: (() => Promise<void>);
        Rename title: (() => Promise<void>);
    }

    • Clear Materials: (() => Promise<void>)
        • (): Promise<void>
        • Returns Promise<void>

    • Remove Section: (() => Promise<void>)
        • (): Promise<void>
        • Returns Promise<void>

    • Rename mapping: (() => Promise<void>)
        • (): Promise<void>
        • Returns Promise<void>

    • Rename title: (() => Promise<void>)
        • (): Promise<void>
        • Returns Promise<void>

Generated using TypeDoc