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

baseColor

Returns the base material color.

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

roughness

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

setBaseColor

Sets the base material color.

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.

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

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

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

roughness(self) float[source]

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

See also

setRoughness()

Return type:

float

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

Sets the base material color.

See also

baseColor()

Parameters:

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

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)

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