Material

GetMaterialAtCrosshair

Material.GetMaterialAtCrosshair()

[EN] Returns a string containing the material name [RU] Π’ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ строку, ΡΠΎΠ΄Π΅Ρ€ΠΆΠ°Ρ‰ΡƒΡŽ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ΠΌΠ°Ρ‚Π΅Ρ€ΠΈΠ°Π»Π°.

Material.GetMaterialAtCrosshair()

Replace

[EN] Creates a proxy for the original material using the new material as an override [RU] Π‘ΠΎΠ·Π΄Π°Π΅Ρ‚ прокси для исходного ΠΌΠ°Ρ‚Π΅Ρ€ΠΈΠ°Π»Π°, ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΡ Π½ΠΎΠ²Ρ‹ΠΉ ΠΌΠ°Ρ‚Π΅Ρ€ΠΈΠ°Π» Π² качСствС Π·Π°ΠΌΠ΅Π½Ρ‹

Parameters:original material name, new material name

Material.Replace(original_mat_name, new_mat_name)

[EN] Replacing a LightmappedGeneric with a WorldVertexTransition it may result in an invisible texture [RU] Π—Π°ΠΌΠ΅Π½Π° LightmappedGeneric Π½Π° WorldVertexTransition ΠΌΠΎΠΆΠ΅Ρ‚ привСсти ΠΊ Π½Π΅Π²ΠΈΠ΄ΠΈΠΌΠΎΠΉ тСкстурС.

RefreshProxy

Material.RefreshProxy(material_name)

[EN] Applies key values to the material [RU] ΠŸΡ€ΠΈΠΌΠ΅Π½ΡΠ΅Ρ‚ ΠΊΠ»ΡŽΡ‡Π΅Π²Ρ‹Π΅ значСния ΠΊ ΠΌΠ°Ρ‚Π΅Ρ€ΠΈΠ°Π»Ρƒ

Parameters:material_name

Material.RefreshProxy(material_name)

SetProxyKeyValue

Material.SetProxyKeyValue(material_name, key, value)

[EN] Sets key values of an overriden material [RU] УстанавливаСт ΠΊΠ»ΡŽΡ‡Π΅Π²Ρ‹Π΅ значСния Π·Π°ΠΌΠ΅Ρ‰Π°Π΅ΠΌΠΎΠ³ΠΎ ΠΌΠ°Ρ‚Π΅Ρ€ΠΈΠ°Π»Π°

Parameters:material_name, key, value

Material.SetProxyKeyValue(material_name, key, value)

DestroyProxy

Material.DestroyProxy(material_name)

[EN] Destroys the proxy [RU] Π£Π½ΠΈΡ‡Ρ‚ΠΎΠΆΠ°Π΅Ρ‚ прокси

Parameters:material_name

Material.DestroyProxy(material_name)

CreateProxy

Material.CreateProxy(material_name)

[EN] Creates a proxy to override material properties [RU] Π‘ΠΎΠ·Π΄Π°Π΅Ρ‚ прокси для пСрСопрСдСлСния свойств ΠΌΠ°Ρ‚Π΅Ρ€ΠΈΠ°Π»Π°

Parameters:material_name

Material.CreateProxy(material_name)

Refresh

Material.Refresh( material_index )

[EN] Used to apply new set key values. [RU] Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ΡΡ для примСнСния Π½ΠΎΠ²ΠΎΠ³ΠΎ Π½Π°Π±ΠΎΡ€Π° ΠΊΠ»ΡŽΡ‡Π΅Π²Ρ‹Ρ… Π·Π½Π°Ρ‡Π΅Π½ΠΈΠΉ.

Parametersmaterial_index

Return values: Returns if the operation succeeded.

Material.Create("testmaterial");
function updateMaterials()
{
    mat_index = Material.Get("testmaterial");
    if (mat_index > 0)
    {
        Material.SetKeyValue(mat_index, "$baseTexture", "vgui/white");
        Material.SetKeyValue(mat_index, "$envmap", "models/effects/cube_white");
        Material.SetKeyValue(mat_index, "$envmapfresnel", "1");
        Material.SetKeyValue(mat_index, "$envmapfresnelminmaxexp", "[0 1 2]");
        Material.SetKeyValue(mat_index, "$color", "[1.0 1.0 1.0]");
        Material.SetKeyValue(mat_index, "$envmaptint", "[1.0 1.0 1.0]");
        Material.Refresh(mat_index);
    }
}
Cheat.RegisterCallback("Material", "updateMaterials")

Note: This function can only be used in functions with Material callback. More keys and values can be found below: https://developer.valvesoftware.com/wiki/Category:List_of_Shader_Parameters https://developer.valvesoftware.com/wiki/VertexLitGeneric

SetKeyValue

Material.SetKeyValue( material_index, key, value )

[EN] Used to set key values. [RU] Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ΡΡ для установки ΠΊΠ»ΡŽΡ‡Π΅Π²Ρ‹Ρ… Π·Π½Π°Ρ‡Π΅Π½ΠΈΠΉ.

Parameters:material_index, key, value

Return values: Returns if the operation succeeded.

Material.Create("testmaterial");
function updateMaterials()
{
    mat_index = Material.Get("testmaterial");
    if (mat_index > 0)
    {
        Material.SetKeyValue(mat_index, "$baseTexture", "vgui/white");
        Material.SetKeyValue(mat_index, "$envmap", "models/effects/cube_white");
        Material.SetKeyValue(mat_index, "$envmapfresnel", "1");
        Material.SetKeyValue(mat_index, "$envmapfresnelminmaxexp", "[0 1 2]");
        Material.SetKeyValue(mat_index, "$color", "[1.0 1.0 1.0]");
        Material.SetKeyValue(mat_index, "$envmaptint", "[1.0 1.0 1.0]");
        Material.Refresh(mat_index);
    }
}
Cheat.RegisterCallback("Material", "updateMaterials")

Note: This function can only be used in functions with Material callback. More keys and values can be found below: https://developer.valvesoftware.com/wiki/Category:List_of_Shader_Parameters https://developer.valvesoftware.com/wiki/VertexLitGeneric

Get

Material.Get( name )

[EN] Used to get material index. [RU] Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ΡΡ для получСния индСкса ΠΌΠ°Ρ‚Π΅Ρ€ΠΈΠ°Π»Π°.

Parameters:name

Return values: Returns 0 if material doesn't exist.

Material.Create("testmaterial");
function updateMaterials()
{
    mat_index = Material.Get("testmaterial");
    if (mat_index > 0)
    {
        Material.SetKeyValue(mat_index, "$baseTexture", "vgui/white");
        Material.SetKeyValue(mat_index, "$envmap", "models/effects/cube_white");
        Material.SetKeyValue(mat_index, "$envmapfresnel", "1");
        Material.SetKeyValue(mat_index, "$envmapfresnelminmaxexp", "[0 1 2]");
        Material.SetKeyValue(mat_index, "$color", "[1.0 1.0 1.0]");
        Material.SetKeyValue(mat_index, "$envmaptint", "[1.0 1.0 1.0]");
        Material.Refresh(mat_index);
    }
}
Cheat.RegisterCallback("Material", "updateMaterials")

Note: This function can only be used in functions with Material callback.

Destroy

Material.Destroy( name )

[EN] Returns true if material was destroyed successfully.

[RU] Π’ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ истину, Ссли ΠΌΠ°Ρ‚Π΅Ρ€ΠΈΠ°Π» Π±Ρ‹Π» ΡƒΠ½ΠΈΡ‡Ρ‚ΠΎΠΆΠ΅Π½ ΡƒΡΠΏΠ΅ΡˆΠ½ΠΎ.

Parameters:name

Return values: Returns true if material was destroyed successfully.

Material.Destroy("cool material")

Create

Material.Create( name )

[EN] Returns true if material was created successfully or false otherwise. [RU] Π’ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ true, Ссли ΠΌΠ°Ρ‚Π΅Ρ€ΠΈΠ°Π» Π±Ρ‹Π» создан ΡƒΡΠΏΠ΅ΡˆΠ½ΠΎ, ΠΈΠ»ΠΈ false Π² ΠΏΡ€ΠΎΡ‚ΠΈΠ²Π½ΠΎΠΌ случаС.

Parameters:name

Return values: Returns true if material was created successfully or false otherwise.

Material.Create("cool material")

Last updated