Class: QgsMetalRoughTexturedMaterialSettings

A PBR metal rough shading material used for rendering with support for image texture maps.

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 4.2.

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.core.QgsMetalRoughTexturedMaterialSettings

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 colors accordingly.

Methods

ambientOcclusionTexturePath

Returns the path to the ambient occlusion texture map.

baseColorTexturePath

Returns the path to the base color texture map.

emissionFactor

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

emissionTexturePath

Returns the path to the emission/luminosity texture map.

heightTexturePath

Returns the path to the height texture map.

metalnessTexturePath

Returns the path to the metalness texture map.

normalTexturePath

Returns the path to the normal texture map.

opacity

Returns the opacity of the surface

parallaxScale

Returns the parallax scale, which dictates the strength of the height displacement effect.

roughnessTexturePath

Returns the path to the roughness texture map.

setAmbientOcclusionTexturePath

Sets the path to the ambient occlusion texture map.

setBaseColorTexturePath

Sets the path to the base color texture map.

setEmissionFactor

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

setEmissionTexturePath

Sets the path to the emission/luminosity texture map.

setHeightTexturePath

Sets the path to the height texture map.

setMetalnessTexturePath

Sets the path to the metalness texture map.

setNormalTexturePath

Sets the path to the normal texture map.

setOpacity

Sets the opacity of the surface.

setParallaxScale

Sets the parallax scale, which dictates the strength of the height displacement effect.

setRoughnessTexturePath

Sets the path to the roughness texture map.

setTextureRotation

Sets the texture rotation, in degrees.

setTextureScale

Sets the texture scale.

textureRotation

Returns the texture rotation, in degrees.

textureScale

Returns the texture scale.

Static Methods

create

Returns a new instance of QgsMetalRoughTexturedMaterialSettings.

supportsTechnique

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

class qgis.core.QgsMetalRoughTexturedMaterialSettings[source]

Bases: QgsAbstractMaterialSettings

ambientOcclusionTexturePath(self) str[source]

Returns the path to the ambient occlusion texture map.

Return type:

str

abstract averageColor(self) QColor[source]

Returns an approximate color representing the blended material color.

This function returns an approximation of the material’s appearance based on the average color of the base color texture and the emission texture. Other texture maps are not taken into account.

Return type:

QColor

baseColorTexturePath(self) str[source]

Returns the path to the base color texture map.

Return type:

str

static create() QgsAbstractMaterialSettings | None[source]

Returns a new instance of QgsMetalRoughTexturedMaterialSettings.

Return type:

Optional[QgsAbstractMaterialSettings]

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 texture values should be used directly. Larger values result in more light emission.

Return type:

float

emissionTexturePath(self) str[source]

Returns the path to the emission/luminosity texture map.

See also

emissionFactor()

Return type:

str

heightTexturePath(self) str[source]

Returns the path to the height texture map.

Return type:

str

metalnessTexturePath(self) str[source]

Returns the path to the metalness texture map.

Return type:

str

normalTexturePath(self) str[source]

Returns the path to the normal texture map.

Return type:

str

opacity(self) float[source]

Returns the opacity of the surface

See also

setOpacity()

Added in version 4.2.

Return type:

float

parallaxScale(self) float[source]

Returns the parallax scale, which dictates the strength of the height displacement effect.

Return type:

float

roughnessTexturePath(self) str[source]

Returns the path to the roughness texture map.

Return type:

str

setAmbientOcclusionTexturePath(self, path: str | None)[source]

Sets the path to the ambient occlusion texture map.

Parameters:

path (Optional[str])

setBaseColorTexturePath(self, path: str | None)[source]

Sets the path to the base color texture map.

Parameters:

path (Optional[str])

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

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

This method has no effect for QgsMetalRoughTexturedMaterialSettings, as the material is fully defined by texture maps.

Parameters:

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

Added in version 4.2.

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 texture values should be used directly. Larger values result in more light emission.

See also

emissionFactor()

Parameters:

factor (float)

setEmissionTexturePath(self, path: str | None)[source]

Sets the path to the emission/luminosity texture map.

Parameters:

path (Optional[str])

setHeightTexturePath(self, path: str | None)[source]

Sets the path to the height texture map.

Parameters:

path (Optional[str])

setMetalnessTexturePath(self, path: str | None)[source]

Sets the path to the metalness texture map.

Parameters:

path (Optional[str])

setNormalTexturePath(self, path: str | None)[source]

Sets the path to the normal texture map.

Parameters:

path (Optional[str])

setOpacity(self, opacity: float)[source]

Sets the opacity of the surface.

See also

opacity()

Added in version 4.2.

Parameters:

opacity (float)

setParallaxScale(self, scale: float)[source]

Sets the parallax scale, which dictates the strength of the height displacement effect.

See also

parallaxScale()

Parameters:

scale (float)

setRoughnessTexturePath(self, path: str | None)[source]

Sets the path to the roughness texture map.

Parameters:

path (Optional[str])

setTextureRotation(self, rotation: float)[source]

Sets the texture rotation, in degrees.

Parameters:

rotation (float)

setTextureScale(self, scale: float)[source]

Sets the texture scale.

The texture scale changes the size of the displayed texture in the 3D scene. If the texture scale is less than 1, the texture will be stretched.

See also

textureScale()

Parameters:

scale (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

textureRotation(self) float[source]

Returns the texture rotation, in degrees.

Return type:

float

textureScale(self) float[source]

Returns the texture scale.

The texture scale changes the size of the displayed texture in the 3D scene. If the texture scale is less than 1, the texture will be stretched.

Return type:

float