Skip to main content

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 Referencematerial_pathThe new Material to apply
integerindex?-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
CanvascanvasThe Canvas object to use as a materia
integerindex?-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
SceneCapturescene_captureThe SceneCapture object to use as a material
integerindex?-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
WebUIwebuiThe WebUI object to use as a material
integerindex?-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
integerindex?-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
stringparameter_nameThe name of the material parameter
ColorcolorThe value to set

SetMaterialScalarParameter

Sets a Scalar parameter in this Actor's material

my_paintable:SetMaterialScalarParameter(parameter_name, scalar)
TypeParameterDefaultDescription
stringparameter_nameThe name of the material parameter
floatscalarThe 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
stringparameter_nameThe name of the material parameter
Image Pathtexture_pathThe path to the texture

SetMaterialVectorParameter

Sets a Vector parameter in this Actor's material

my_paintable:SetMaterialVectorParameter(parameter_name, vector)
TypeParameterDefaultDescription
stringparameter_nameThe name of the material parameter
VectorvectorThe value to set

SetPhysicalMaterial

Overrides this Actor's Physical Material with a new one

my_paintable:SetPhysicalMaterial(physical_material_path)
TypeParameterDefaultDescription
Material Referencephysical_material_pathThe Physical Material to override