API

Function selectVariant

  • Select a material variant by name on a loaded glTF asset.

    Two-step operation:

    1. Restores ALL variant-participating meshes to their original (default) materials.
    2. Applies the selected variant's material overrides.

    This ensures meshes without a mapping for the new variant revert to their defaults, even when switching between variants (e.g. Red → White).

    Works both before and after addToScene():

    • Before: materials are set directly (renderable built later).
    • After: the property-setter intercept triggers renderable rebuild automatically.

    Parameters

    Returns void