â¨materials
Last updated
Last updated
materials.get(path: string[, force_load: boolean]):
Material
Name | Type | Description |
---|---|---|
Returns the material object in the specified path.
materials.get_materials(partial_path: string[, force_load: boolean, callback: function]):
table
Name | Type | Description |
---|---|---|
If the callback is nil, it returns the table of material objects along the specified path. Otherwise the callback will be called. Access the material object using the arguments of the specified callback.
materials.create(name: strings, key_values: string):
Material
Creates and returns a new material object
Material
material:get_name():
string
Returns the name of the material.
material:get_texture_group_name():
string
Returns the texture group name of the material.
material:var_flag(flag: number[, value: boolean]):
boolean
Gets or sets the value of the material var flag.
material:shader_param(name: string[, value: any]):
any
Gets or sets the value of the material shader parameter.
material:color_modulate([color: color])
Gets or sets the material color modulation value.
material:alpha_modulate([alpha: number])
Gets or sets the material alpha modulation value.
material:is_valid():
boolean
Returns true
if the material is valid.
material:reset()
Resets the material properties to its original values along with discarding the override.
material:override(mat: Material)
Overrides material properties to properties from another material without setting them.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
name
string
New material name
key_values
string
New material values
flag
number
Material var flag
value
boolean
New material var flag value
name
string
Shader parameter name
value
any
New shader parameter value
color
color
New color modulation value
alpha
number
New alpha modulation value
mat
Material
Material object with the needed properties
path
string
Directory to the specified material
force_load
force_load
Loads the material if not loaded
partial_path
string
Directory to the specified materials
force_load
force_load
Loads each material if not loaded
callback
function
A callback with a pointer to the material object as the argument