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

Base Paintable

Base class for all Paintables

A Paintable class is a base class in nanos world which 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
SetMaterialFromWebUISets the material at the specified index of this Actor to a WebUI object
SetMaterialFromSceneCaptureSets the material at the specified index of this Actor to a SceneCapture 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_entity:SetMaterial(new_material, index)
TypeParameterDefaultDescription
Material Assetmaterial_pathThe new Material to apply
numberindex-1The index to apply - -1 means all indices

SetMaterialFromCanvas​

Sets the material at the specified index of this Actor to a Canvas object

my_entity:SetMaterialFromCanvas(canvas, index)
TypeParameterDefaultDescription
CanvascanvasThe Canvas object to use as a material
numberindex-1The index to apply - -1 means all indices

SetMaterialFromSceneCapture​

Sets the material at the specified index of this Actor to a SceneCapture object

my_entity:SetMaterialFromSceneCapture(webui, index)
TypeParameterDefaultDescription
SceneCapturescene_captureThe SceneCapture object to use as a material
numberindex-1The index to apply - -1 means all indices

SetMaterialFromWebUI​

Sets the material at the specified index of this Actor to a WebUI object

my_entity:SetMaterialFromWebUI(webui, index)
TypeParameterDefaultDescription
WebUIwebuiThe WebUI object to use as a material
numberindex-1The index to apply - -1 means all indices

ResetMaterial​

Resets the material from the specified index to the original one

my_entity:ResetMaterial(index)
TypeParameterDefaultDescription
numberindex-1The index to apply - -1 means all indices

SetMaterialColorParameter​

Sets a Color parameter in this Actor’s material

my_entity:SetMaterialColorParameter(parameter_name, color)
TypeParameterDescription
stringparameter_nameThe name of the material parameter
ColorcolorThe value to set

SetMaterialScalarParameter​

Sets a Scalar parameter in this Actor's material

For setting a parameter in an Attachable mesh, use the following parameter_name pattern: attachable///[ATTACHABLE_ID]/[PARAMETER_NAME]

my_entity:SetMaterialScalarParameter(parameter_name, number)
TypeParameterDescription
stringparameter_nameThe name of the material parameter
stringscalarThe value to set

SetMaterialTextureParameter​

Sets a texture parameter in this Actor's material to an image on disk

my_entity:SetMaterialTextureParameter(parameter_name, texture_path)
TypeParameterDescription
stringparameter_nameThe name of the material parameter
Image Special Pathtexture_pathThe path to the texture

SetMaterialVectorParameter​

Sets a Vector parameter in this Actor's material

For setting a parameter in an Attachable mesh, use the following parameter_name pattern: attachable///[ATTACHABLE_ID]/[PARAMETER_NAME]

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

SetPhysicalMaterial​

Overrides this Actor's Physical Material with a new one

my_entity:SetPhysicalMaterial(physical_material_path)
TypeParameterDescription
Material Assetphysical_material_pathThe Physical Material to override