Interface MaterialHandleItem Beta

A handle for manipulating materials from scripts.

Hierarchy

  • MaterialHandle

Methods

  • Sets the base color of the material. The value passed to this method is treated as a value in the sRGB color space.

    Each element of r, g, b, and a takes a value between 0 and 1. If a value is less than 0, 0 is passed to material. If a value is greater than 1, 1 is passed to material.

    If any element is NaN, Infinity, or -Infinity, calling this method has no effect.

    Parameters

    • r: number
    • g: number
    • b: number
    • a: number

    Returns void

  • This API is only available for worlds uploaded from the Creator Kit. This API is not available from Craft Items.

    Sets the value of the material's Color property.

    r, g, and b take values greater than or equal to 0. If a value is less than 0, 0 is passed to material.

    a is greater than or equal to 0 and less than or equal to 1. If a value is less than 0, 0 is passed to material. If a value is greater than 1, 1 is passed to material.

    If any element is NaN, Infinity, or -Infinity, calling this method has no effect.

    Gamma for HDR and color space follows the [HDR] and [Gamma] property specification in ShaderLab. propertyName supports up to 64 characters.

    Parameters

    • propertyName: string
    • r: number
    • g: number
    • b: number
    • a: number

    Returns void

  • Sets the material's Emissive color. The value passed to this method is treated as an HDR value in Linear's color space.

    r, g, and b take values greater than or equal to 0. If a value is less than 0, 0 is passed to material.

    a is greater than or equal to 0 and less than or equal to 1. If a value is less than 0, 0 is passed to material. If a value is greater than 1, 1 is passed to material.

    If any element is NaN, Infinity, or -Infinity, calling this method has no effect.

    Parameters

    • r: number
    • g: number
    • b: number
    • a: number

    Returns void

  • This API is only available for worlds uploaded from the Creator Kit. This API is not available from Craft Items.

    Sets the Float value property of the material. If value is NaN, Infinity, or -Infinity, calling this method has no effect.

    Gamma for HDR and color space follows the [HDR] and [Gamma] property specification in ShaderLab. propertyName supports up to 64 characters.

    Parameters

    • propertyName: string
    • value: number

    Returns void

  • This API is only available for worlds uploaded from the Creator Kit. This API is not available from Craft Items.

    Set the properties of the material's Float2 value. If any element is NaN, Infinity, or -Infinity, the call to this method will be ignored.

    Gamma for HDR and color space follows the [HDR] and [Gamma] property specification in ShaderLab. propertyName supports up to 64 characters.

    Parameters

    • propertyName: string
    • x: number
    • y: number

    Returns void

  • This API is only available for worlds uploaded from the Creator Kit. This API is not available from Craft Items.

    Set the properties of the material's Float3 value. If any element is NaN, Infinity, or -Infinity, the call to this method will be ignored.

    Gamma for HDR and color space follows the [HDR] and [Gamma] property specification in ShaderLab. propertyName supports up to 64 characters.

    Parameters

    • propertyName: string
    • x: number
    • y: number
    • z: number

    Returns void

  • This API is only available for worlds uploaded from the Creator Kit. This API is not available from Craft Items.

    Set the properties of the material's Float4 value. If any element is NaN, Infinity, or -Infinity, the call to this method will be ignored.

    Gamma for HDR and color space follows the [HDR] and [Gamma] property specification in ShaderLab. propertyName supports up to 64 characters.

    Parameters

    • propertyName: string
    • x: number
    • y: number
    • z: number
    • w: number

    Returns void

  • This API is only available for worlds uploaded from the Creator Kit. This API is not available from Craft Items.

    Sets the properties of a material's matrix value.

    Pass a Float32Array of 16 elements. If the number of elements is not 16, an error will occur. If any element is NaN, Infinity, or -Infinity, the call to this method will be ignored.

    propertyName supports up to 64 characters.

    Parameters

    • propertyName: string
    • matrix: Float32Array

    Returns void

Generated using TypeDoc