Protected_Protected_Protected_Protected Optional_Protected_Apply all variations(by selected index or first item) when a config is loaded
Size in pixels of the generated previews (generate:sphere, generate:cube...).
They render offscreen with the viewer's environment map and tone mapping, see MaterialPreviewGenerator.renderToCanvas.
Static Optional ReadonlyOldStaticPluginProtected_Protected_Protected_Protected_Optionalprefix: stringOptionalmaterial: IMaterial<IMaterialEventMap>OptionalvariationKey: stringApply a material variation based on index or uuid.
OptionalsetSelectedIndex: boolean
default true, to be used with animation
Optionaltime: AnimateTime & { from?: string | number }
optional data to animate(lerp) from current value to the target material.
OptionalvariationKey: stringOptionalv: MaterialVariationsOptionalmapping: stringOptionalmeta: anyGet the preview for a material variation
Should be called from preFrame or postFrame ideally (not during a render).
Generated previews (generate:...) render offscreen and do not change the canvas.
Material or index of the material in the variation.
Type of preview. Could be generate:sphere, generate:cube, color, map, emissive, etc.
call viewer.setDirty() after setting the preview. Not needed since the previews do not change the canvas, kept for compatibility.
Reapply all selected variations again.
Useful when a model or config is loaded or changed and the variations are not applied in the model.
It is automatically called when the config is loaded if applyOnLoad is true.
Refreshes the UI in the next frame
OptionalsetOptionalmeta: SerializationMetaType
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
MaterialConfiguratorPluginin plugin-configurator for example on inheriting with a custom UI renderer.