Class: QgsMetalRoughMaterialSettings

A PBR metal rough shading material used for rendering.

Warning

This is not considered stable API, and may change in future QGIS releases. It is exposed to the Python bindings as a tech preview only.

Added in version 3.36.

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.core.QgsMetalRoughMaterialSettings

Base classes

QgsAbstractMaterialSettings

Abstract base class for material settings.

Abstract Methods

averageColor

Returns an approximate color representing the blended material color.

setColorsFromBase

Decomposes a base color into the material's color components, and sets the material's color accordingly.

Methods

anisotropy

Returns the material's anisotropy, as a value between 0 and 1.

anisotropyRotation

Returns the rotation of the material's anisotropy, as a angle in degrees.

baseColor

Returns the base material color.

clearCoatFactor

Returns the material's clear coat factor, as a value between 0 and 1.

clearCoatRoughness

Returns the material's clear coat roughness, as a value between 0 and 1.

emissionColor

Returns the material's emissive color.

emissionFactor

Returns the emission factor, which dictates the strength of the emission effect.

metalness

Returns the material's metalness, as a value between 0 and 1.

opacity

Returns the opacity of the surface

reflectance

Returns the material's reflectance, as a value between 0 and 1.

roughness

Returns the material's roughness, as a value between 0 and 1.

setAnisotropy

Sets the material's anisotropy, as a value between 0 and 1.

setAnisotropyRotation

Sets the rotation of the material's anisotropy, as a angle in degrees.

setBaseColor

Sets the base material color.

setClearCoatFactor

Sets the material's clear coat factor, as a value between 0 and 1.

setClearCoatRoughness

Sets the material's clear coat roughness, as a value between 0 and 1.

setEmissionColor

Sets the material's emissive color.

setEmissionFactor

Sets the emission factor, which dictates the strength of the emission effect.

setMetalness

Sets the material's metalness, as a value between 0 and 1.

setOpacity

Sets the opacity of the surface.

setReflectance

Sets the material's reflectance, as a value between 0 and 1.

setRoughness

Sets the material's roughness, as a value between 0 and 1.

Static Methods

create

Returns a new instance of QgsMetalRoughMaterialSettings.

supportsTechnique

Returns True if the specified technique is supported by the metal rough material.

class qgis.core.QgsMetalRoughMaterialSettings[source]

Bases: QgsAbstractMaterialSettings

anisotropy(self) float[source]

Returns the material’s anisotropy, as a value between 0 and 1.

Anisotropic materials are those with properties which vary in different directions.

See also

setAnisotropy()

Added in version 4.2.

Return type:

float

anisotropyRotation(self) float[source]

Returns the rotation of the material’s anisotropy, as a angle in degrees.

Anisotropic materials are those with properties which vary in different directions.

See also

anisotropy()

Added in version 4.2.

Return type:

float

abstract averageColor(self) QColor[source]

Returns an approximate color representing the blended material color.

Since this material contains only a single color, this function simply returns baseColor().

See also

baseColor()

Added in version 4.2.

Return type:

QColor

baseColor(self) QColor[source]

Returns the base material color.

See also

setBaseColor()

Return type:

QColor

clearCoatFactor(self) float[source]

Returns the material’s clear coat factor, as a value between 0 and 1.

Added in version 4.2.

Return type:

float

clearCoatRoughness(self) float[source]

Returns the material’s clear coat roughness, as a value between 0 and 1.

Added in version 4.2.

Return type:

float

static create() QgsAbstractMaterialSettings | None[source]

Returns a new instance of QgsMetalRoughMaterialSettings.

Return type:

Optional[QgsAbstractMaterialSettings]

emissionColor(self) QColor[source]

Returns the material’s emissive color.

Added in version 4.2.

Return type:

QColor

emissionFactor(self) float[source]

Returns the emission factor, which dictates the strength of the emission effect.

A value of 1.0 indicates that the emission color values should be used directly. Larger values result in more light emission.

See also

emissionColor()

Added in version 4.2.

Return type:

float

metalness(self) float[source]

Returns the material’s metalness, as a value between 0 and 1.

See also

setMetalness()

Return type:

float

opacity(self) float[source]

Returns the opacity of the surface

See also

setOpacity()

Added in version 4.2.

Return type:

float

reflectance(self) float[source]

Returns the material’s reflectance, as a value between 0 and 1.

This controls the specular intensity for non-metals.

See also

setReflectance()

Added in version 4.2.

Return type:

float

roughness(self) float[source]

Returns the material’s roughness, as a value between 0 and 1.

See also

setRoughness()

Return type:

float

setAnisotropy(self, anisotropy: float)[source]

Sets the material’s anisotropy, as a value between 0 and 1.

Anisotropic materials are those with properties which vary in different directions.

See also

anisotropy()

Added in version 4.2.

Parameters:

anisotropy (float)

setAnisotropyRotation(self, rotation: float)[source]

Sets the rotation of the material’s anisotropy, as a angle in degrees.

Anisotropic materials are those with properties which vary in different directions.

See also

setAnisotropy()

Added in version 4.2.

Parameters:

rotation (float)

setBaseColor(self, color: QColor | Qt.GlobalColor | int)[source]

Sets the base material color.

See also

baseColor()

Parameters:

color (Union[QColor, Qt.GlobalColor, int])

setClearCoatFactor(self, factor: float)[source]

Sets the material’s clear coat factor, as a value between 0 and 1.

Added in version 4.2.

Parameters:

factor (float)

setClearCoatRoughness(self, roughness: float)[source]

Sets the material’s clear coat roughness, as a value between 0 and 1.

Added in version 4.2.

Parameters:

roughness (float)

abstract setColorsFromBase(self, baseColor: QColor | Qt.GlobalColor | int)[source]

Decomposes a base color into the material’s color components, and sets the material’s color accordingly.

Since this material contains only a single color, this function is equivalent to calling setBaseColor(baseColor).

Parameters:

baseColor (Union[QColor, Qt.GlobalColor, int]) – The color to decompose

See also

setBaseColor()

Added in version 4.2.

setEmissionColor(self, color: QColor | Qt.GlobalColor | int)[source]

Sets the material’s emissive color.

See also

emissionColor()

Added in version 4.2.

Parameters:

color (Union[QColor, Qt.GlobalColor, int])

setEmissionFactor(self, factor: float)[source]

Sets the emission factor, which dictates the strength of the emission effect.

A value of 1.0 indicates that the emission color values should be used directly. Larger values result in more light emission.

See also

emissionFactor()

Added in version 4.2.

Parameters:

factor (float)

setMetalness(self, metalness: float)[source]

Sets the material’s metalness, as a value between 0 and 1.

See also

metalness()

Parameters:

metalness (float)

setOpacity(self, opacity: float)[source]

Sets the opacity of the surface.

See also

opacity()

Added in version 4.2.

Parameters:

opacity (float)

setReflectance(self, reflectance: float)[source]

Sets the material’s reflectance, as a value between 0 and 1.

This controls the specular intensity for non-metals.

See also

reflectance()

Added in version 4.2.

Parameters:

reflectance (float)

setRoughness(self, roughness: float)[source]

Sets the material’s roughness, as a value between 0 and 1.

See also

roughness()

Parameters:

roughness (float)

static supportsTechnique(technique: Qgis.MaterialRenderingTechnique) bool[source]

Returns True if the specified technique is supported by the metal rough material.

Parameters:

technique (Qgis.MaterialRenderingTechnique)

Return type:

bool