Skip to content

TextureSwitch

TextureSwitch#

(Switch)

Go to User page.

Description#

Switch texture according to an input color.

Public Attributes#

Type Name Visual Hint Description
long mode VISUAL_HINT_DEFAULT Define how input color will be used to pick the texture. In Randomize mode, it will randomly pick a texture according to the input color. In Luminance mode, it will divide the computed luminance from the input color according to the number of textures. The texture located in the right luminance interval will be selected. In Value mode, it will take the red channel of the input, the texture located in the red value interval will be selected.
long seed VISUAL_HINT_DEFAULT Set the seed of the random generator
double[3] input VISUAL_HINT_COLOR Define the input color used to pick the texture.
reference (Texture) textures VISUAL_HINT_DEFAULT Set the list of texture picked according to input color.

Inherited Public Attributes#

Type Name Visual Hint Description
bool pass_through VISUAL_HINT_DEFAULT If checked, the current texture is not evaluated and the value of the attribute selected in Pass Through Attribute is directly forwarded.
string master_input VISUAL_HINT_TAG Name of the attribute that will be used as output if Pass Through is enabled.
bool invert VISUAL_HINT_DEFAULT If checked, the texture is inverted.
double opacity VISUAL_HINT_PERCENTAGE Set the opacity of the texture.

CID#

class "TextureSwitch" "Texture" {
    #version 0.9
    icon "../icons/object_icons/texture_switch.iconrc"
    category "/Texture/Utility"
    doc "Switch texture according to an input color."
    attribute_group "input" {
        long "mode" {
            doc "Define how input color will be used to pick the texture. In Randomize mode, it will randomly pick a texture according to the input color. In Luminance mode, it will divide the computed luminance from the input color according to the number of textures. The texture located in the right luminance interval will be selected. In Value mode, it will take the red channel of the input, the texture located in the red value interval will be selected."
            preset "Randomize" "0"
            preset "Luminance" "1"
            preset "Value" "2"
            value 0
        }
        long "seed" {
            doc "Set the seed of the random generator"
            animatable yes
            numeric_range yes 0.0 65535
            ui_range yes 0.0 65535
            value 0
        }
        color "input" {
            doc "Define the input color used to pick the texture."
            texturable yes
            animatable yes
            value 0.0 0.0 0.0
        }
        list<reference> "textures" {
            doc "Set the list of texture picked according to input color."
            filter "Texture"
            value <empty>
        }
    }
    set "master_input" {
        private no
        hidden no
        saveable yes
        texturable no
        animatable no
        slider no
        numeric_range no 0.0 1
        ui_range no 0.0 1
        dg_active yes
        dg_cyclic no
        dirtiness_pass_through no
        read_only no
        shading_variable no
        experimental no
        advanced no
        overriden no
        promote_attribute no
        allow_expression yes
        localizable yes
        value "input"
    }
}