Skip to main content
Version: latest - a1.19.x βš–οΈ

Base Paintable

Base class for all Paintable entities. This class provides customization for materials, exposing common functions to allow you to set custom material parameters, including loading textures from disk.

info

This is a base class. You cannot spawn it directly.

🦠 Functions​

ReturnsNameDescription
SetMaterialSets the material at the specified index of this Actor
SetMaterialFromCanvasSets the material at the specified index of this Actor to a Canvas object
SetMaterialFromSceneCaptureSets the material at the specified index of this Actor to a SceneCapture object
SetMaterialFromWebUISets the material at the specified index of this Actor to a WebUI object
ResetMaterialResets the material from the specified index to the original one
SetMaterialColorParameterSets a Color parameter in this Actor's material
SetMaterialScalarParameterSets a Scalar parameter in this Actor's material
SetMaterialTextureParameterSets a texture parameter in this Actor's material to an image on disk
SetMaterialVectorParameterSets a Vector parameter in this Actor's material
SetPhysicalMaterialOverrides this Actor's Physical Material with a new one

SetMaterial​

Sets the material at the specified index of this Actor
my_paintable:SetMaterial(material_path, index?)
TypeParameterDefaultDescription
Material Reference material_pathThe new Material to apply
number index?-1The index to apply
-1 means all indices

SetMaterialFromCanvas​

Sets the material at the specified index of this Actor to a Canvas object
my_paintable:SetMaterialFromCanvas(canvas, index?)
TypeParameterDefaultDescription
Canvas canvasThe Canvas object to use as a materia
number index?-1The index to apply
-1 means all indices

SetMaterialFromSceneCapture​

Sets the material at the specified index of this Actor to a SceneCapture object
my_paintable:SetMaterialFromSceneCapture(scene_capture, index?)
TypeParameterDefaultDescription
SceneCapture scene_captureThe SceneCapture object to use as a material
number index?-1The index to apply
-1 means all indices

SetMaterialFromWebUI​

Sets the material at the specified index of this Actor to a WebUI object
my_paintable:SetMaterialFromWebUI(webui, index?)
TypeParameterDefaultDescription
WebUI webuiThe WebUI object to use as a material
number index?-1The index to apply
-1 means all indices

ResetMaterial​

Resets the material from the specified index to the original one
my_paintable:ResetMaterial(index?)
TypeParameterDefaultDescription
number index?-1The index to apply
-1 means all indices

SetMaterialColorParameter​

Sets a Color parameter in this Actor's material
my_paintable:SetMaterialColorParameter(parameter_name, color)
TypeParameterDefaultDescription
string parameter_nameThe name of the material parameter
Color colorThe value to set

SetMaterialScalarParameter​

Sets a Scalar parameter in this Actor's material
my_paintable:SetMaterialScalarParameter(parameter_name, scalar)
TypeParameterDefaultDescription
string parameter_nameThe name of the material parameter
number scalarThe value to set

SetMaterialTextureParameter​

Sets a texture parameter in this Actor's material to an image on disk
my_paintable:SetMaterialTextureParameter(parameter_name, texture_path)
TypeParameterDefaultDescription
string parameter_nameThe name of the material parameter
Image Path texture_pathThe path to the texture

SetMaterialVectorParameter​

Sets a Vector parameter in this Actor's material
my_paintable:SetMaterialVectorParameter(parameter_name, vector)
TypeParameterDefaultDescription
string parameter_nameThe name of the material parameter
Vector vectorThe value to set

SetPhysicalMaterial​

Overrides this Actor's Physical Material with a new one
my_paintable:SetPhysicalMaterial(physical_material_path)
TypeParameterDefaultDescription
Material Reference physical_material_pathThe Physical Material to override